Commit f782c15e authored by German Leon's avatar German Leon
Browse files

Intento de termina despues de 10 fallos de injeccion

parent f4173eff
...@@ -17,7 +17,7 @@ faultModel = 0 ...@@ -17,7 +17,7 @@ faultModel = 0
# RF -> Register File # RF -> Register File
# INST_OUT -> Instruction Output (NOT IMPLEMENTED YET) # INST_OUT -> Instruction Output (NOT IMPLEMENTED YET)
# INST_composed -> Instruction Adress (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 # 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 # 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 # Considered as a crash is 10s
......
...@@ -537,7 +537,8 @@ def fault_injection_by_signal(**kwargs): ...@@ -537,7 +537,8 @@ def fault_injection_by_signal(**kwargs):
injection_site = kwargs.get('injection_site') injection_site = kwargs.get('injection_site')
summary_file = kwargs.get('summary_file') summary_file = kwargs.get('summary_file')
header = kwargs.get('header') header = kwargs.get('header')
max_fallos=10
acc_fault_injected=0
cf.printf("-----------------------------------------------------------------------------------------------") cf.printf("-----------------------------------------------------------------------------------------------")
# Execute the fault injector for each one of the sections(apps) of the configuration file # Execute the fault injector for each one of the sections(apps) of the configuration file
for fault_model in fault_models: for fault_model in fault_models:
...@@ -560,6 +561,7 @@ def fault_injection_by_signal(**kwargs): ...@@ -560,6 +561,7 @@ def fault_injection_by_signal(**kwargs):
hang, crash, masked,sdc, signal_init_time, block, hang, crash, masked,sdc, signal_init_time, block,
thread, instruction, user_defined_val] = gdb_inject_fault(**kwargs) thread, instruction, user_defined_val] = gdb_inject_fault(**kwargs)
# Time toc # Time toc
fi_toc = int(time.time()) fi_toc = int(time.time())
...@@ -585,10 +587,20 @@ def fault_injection_by_signal(**kwargs): ...@@ -585,10 +587,20 @@ def fault_injection_by_signal(**kwargs):
with lock: with lock:
summary_file.write_row(row) summary_file.write_row(row)
num_rounds += 1 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) pretty_print(header=header, row=row)
return num_rounds
""" """
Main function Main function
""" """
...@@ -700,12 +712,13 @@ def main(): ...@@ -700,12 +712,13 @@ def main():
fi_master_thread = Thread(target=fault_injection_by_signal, kwargs=kwargs) fi_master_thread = Thread(target=fault_injection_by_signal, kwargs=kwargs)
gpus_threads.append(fi_master_thread) gpus_threads.append(fi_master_thread)
ret=0
for thread in gpus_threads: for thread in gpus_threads:
thread.start() thread.start()
for thread in gpus_threads: for thread in gpus_threads:
thread.join() thread.join()
ret += thread.exit_code
os.system("rm -f {}/bin/*".format(current_path)) os.system("rm -f {}/bin/*".format(current_path))
if exit_injector: if exit_injector:
...@@ -714,7 +727,7 @@ def main(): ...@@ -714,7 +727,7 @@ def main():
cf.printf("Fault injection finished, results can be found in {}".format(csv_file)) cf.printf("Fault injection finished, results can be found in {}".format(csv_file))
######################################################################## ########################################################################
return res
######################################################################## ########################################################################
# Main # # Main #
######################################################################## ########################################################################
......
#cut -d, -f 3,4,9,10,11,12,13,14,15 fi_lavaMD_single_bit_RF.csv #cut -d, -f 3,4,9,10,11,12,13,14,15 fi_lavaMD_single_bit_RF.csv
fi_field=10 ./res-new-ind-simple.sh $1
hang=$[$fi_field + 1] reg=2
crash=$[$hang + 1] for i in $(seq 0 1 255)
masked=$[$crash +1 ]
sdc=$[$masked +1 ]
for i in $fi_field $hang $crash $masked $sdc
do do
cab=$(cut -d, -f$i $1|head -1) ib=$(echo "R"$i)
trues=$(cut -d, -f$i $1|grep "True"|wc -l) n=$(cut -f $reg -d, $1|grep $ib|wc -l)
echo $cab "=" $trues if [ "$n" -gt 0 ];
then
done echo $ib"="$n
excep=$[$sdc +1] fi
for i in $(seq 1 1 15) done
for i in $(seq 0 1 255)
do do
ib=$(echo "_"$i$) ib=$(echo "R"$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 ) n=$(cut -f $reg -d, $1|grep $ib|wc -l)
echo "CUDA_EXCEPTION_"$i"="$n 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 done
...@@ -17,6 +17,7 @@ echo "Step 1 - Profiling the application for fault injection" ...@@ -17,6 +17,7 @@ echo "Step 1 - Profiling the application for fault injection"
echo "Step 2 - Running ${FAULTS} on ${CONFFILE}" echo "Step 2 - Running ${FAULTS} on ${CONFFILE}"
./fault_injector.py -i ${FAULTS} -c ${CONFFILE} -n 1 $* ./fault_injector.py -i ${FAULTS} -c ${CONFFILE} -n 1 $*
echo $?
echo "Fault injection finished" echo "Fault injection finished"
exit 0 exit 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment