Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
German Leon
Carol-fi
Commits
f782c15e
Commit
f782c15e
authored
Dec 15, 2020
by
German Leon
Browse files
Intento de termina despues de 10 fallos de injeccion
parent
f4173eff
Changes
4
Show whitespace changes
Inline
Side-by-side
codes/mmElem/matrixmul.conf
View file @
f782c15e
...
...
@@ -17,7 +17,7 @@ faultModel = 0
# RF -> Register File
# INST_OUT -> Instruction Output (NOT IMPLEMENTED YET)
# INST_composed -> Instruction Adress (NOT IMPLEMENTED YET)
injectionSite
=
INST_OUT
injectionSite
=
RF
# Max time factor to finish the app, this will be multiplied by the application running time
# For example if your app spend 2s, and the maxWaitTimes is 5, the max running time before it is
# Considered as a crash is 10s
...
...
fault_injector.py
View file @
f782c15e
...
...
@@ -537,7 +537,8 @@ def fault_injection_by_signal(**kwargs):
injection_site
=
kwargs
.
get
(
'injection_site'
)
summary_file
=
kwargs
.
get
(
'summary_file'
)
header
=
kwargs
.
get
(
'header'
)
max_fallos
=
10
acc_fault_injected
=
0
cf
.
printf
(
"-----------------------------------------------------------------------------------------------"
)
# Execute the fault injector for each one of the sections(apps) of the configuration file
for
fault_model
in
fault_models
:
...
...
@@ -560,6 +561,7 @@ def fault_injection_by_signal(**kwargs):
hang
,
crash
,
masked
,
sdc
,
signal_init_time
,
block
,
thread
,
instruction
,
user_defined_val
]
=
gdb_inject_fault
(
**
kwargs
)
# Time toc
fi_toc
=
int
(
time
.
time
())
...
...
@@ -585,9 +587,19 @@ def fault_injection_by_signal(**kwargs):
with
lock
:
summary_file
.
write_row
(
row
)
num_rounds
+=
1
acc_fault_injeted
=
0
else
:
acc_fault_injected
+=
1
if
(
acc_fault_injected
==
(
max_fallos
/
2
)):
time
.
sleep
(
240
)
if
(
acc_fault_injected
==
max_fallos
):
break
pretty_print
(
header
=
header
,
row
=
row
)
return
num_rounds
"""
Main function
...
...
@@ -700,12 +712,13 @@ def main():
fi_master_thread
=
Thread
(
target
=
fault_injection_by_signal
,
kwargs
=
kwargs
)
gpus_threads
.
append
(
fi_master_thread
)
ret
=
0
for
thread
in
gpus_threads
:
thread
.
start
()
for
thread
in
gpus_threads
:
thread
.
join
()
ret
+=
thread
.
exit_code
os
.
system
(
"rm -f {}/bin/*"
.
format
(
current_path
))
if
exit_injector
:
...
...
@@ -714,7 +727,7 @@ def main():
cf
.
printf
(
"Fault injection finished, results can be found in {}"
.
format
(
csv_file
))
########################################################################
return
res
########################################################################
# Main #
########################################################################
...
...
res-new-ind.sh
View file @
f782c15e
#cut -d, -f 3,4,9,10,11,12,13,14,15 fi_lavaMD_single_bit_RF.csv
fi_field
=
10
hang
=
$[$fi_field
+ 1]
crash
=
$[$hang
+ 1]
masked
=
$[$crash
+1
]
sdc
=
$[$masked
+1
]
for
i
in
$fi_field
$hang
$crash
$masked
$sdc
./res-new-ind-simple.sh
$1
reg
=
2
for
i
in
$(
seq
0 1 255
)
do
cab
=
$(
cut
-d
,
-f
$i
$1
|head
-1
)
trues
=
$(
cut
-d
,
-f
$i
$1
|grep
"True"
|wc
-l
)
echo
$cab
"="
$trues
ib
=
$(
echo
"R"
$i
)
n
=
$(
cut
-f
$reg
-d
,
$1
|grep
$ib
|wc
-l
)
if
[
"
$n
"
-gt
0
]
;
then
echo
$ib
"="
$n
fi
done
excep
=
$[$sdc
+1]
for
i
in
$(
seq
1 1 15
)
for
i
in
$(
seq
0 1 255
)
do
ib
=
$(
echo
"_"
$i$)
n
=
$(
cut
-f
$excep
-d
,
$1
|
sed
"s/CUDA_EXCEPTION_1 CUDA_EXCEPTION_1/CUDA_EXCEPTION_1/"
|
sed
"s/SIGKILL CUDA_EXCEPTION//"
|grep
$ib
|
wc
-l
)
echo
"CUDA_EXCEPTION_"
$i
"="
$n
ib
=
$(
echo
"R"
$i
)
n
=
$(
cut
-f
$reg
-d
,
$1
|grep
$ib
|wc
-l
)
if
[
"
$n
"
-gt
0
]
;
then
echo
"============"
$ib
"========="
head
-1
$1
>
filetempreg.csv
grep
$ib
$1
>>
filetempreg.csv
./res-new-ind-simple.sh filetempreg.csv
fi
done
test_mult.sh
View file @
f782c15e
...
...
@@ -17,6 +17,7 @@ echo "Step 1 - Profiling the application for fault injection"
echo
"Step 2 - Running
${
FAULTS
}
on
${
CONFFILE
}
"
./fault_injector.py
-i
${
FAULTS
}
-c
${
CONFFILE
}
-n
1
$*
echo
$?
echo
"Fault injection finished"
exit
0
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment