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

Version en funcionamiento

parent 1bc72d3b
...@@ -128,11 +128,11 @@ def main(): ...@@ -128,11 +128,11 @@ def main():
print ("Time kernel= "+str(max_time_kernel)+ "Time app "+str(max_time_app)) print ("Time kernel= "+str(max_time_kernel)+ "Time app "+str(max_time_app))
# saving gold # saving gold
print ("Saving gold"); print ("Saving gold");
generate_gold_result = generate_gold(gdb_exec=gdb_exec, #generate_gold_result = generate_gold(gdb_exec=gdb_exec,
benchmark_binary=benchmark_binary, benchmark_args=benchmark_args,device=args.device) # benchmark_binary=benchmark_binary, benchmark_args=benchmark_args,device=args.device)
if generate_gold_result != 0: #if generate_gold_result != 0:
raise EnvironmentError("Gold generation did not finish well, the fault injection will not work") # raise EnvironmentError("Gold generation did not finish well, the fault injection will not work")
# Remove trash GDB info from the std output and the err output # Remove trash GDB info from the std output and the err output
cf.remove_useless_information_from_output(cp.GOLD_OUTPUT_PATH) cf.remove_useless_information_from_output(cp.GOLD_OUTPUT_PATH)
......
...@@ -200,16 +200,17 @@ class BitFlip: ...@@ -200,16 +200,17 @@ class BitFlip:
def __select_register(self): def __select_register(self):
# Start on 1 to consider R0 # Start on 1 to consider R0
max_num_register = 1 max_num_register = 0
# registers_list.popleft() # registers_list.popleft()
registers_list = cf.execute_command(gdb=gdb, to_execute="info registers") registers_list = cf.execute_command(gdb=gdb, to_execute="info registers")
for line in registers_list: for line in registers_list:
m = re.match(r".*R.*0x([0-9a-fA-F]+).*", line) m = re.match(r".*R.*0x([0-9a-fA-F]+).*", line)
if m and m.group(1) != '0': if m and m.group(1) != '0':
#self.__logging.info ("LIne salida:{}".format(m.group(1))
max_num_register += 1 max_num_register += 1
#self.__logging.info("LIne entrada {}--max{}".format(line,max_num_register))
self.__register = "R{}".format(random.randint(0, max_num_register)) self.__register = "R{}".format(random.randint(0, max_num_register-1))
self.__logging.info("MAX_NUM_REGISTER:{}".format(max_num_register))
""" """
Instruction injector Instruction injector
""" """
......
...@@ -17,8 +17,7 @@ faultModel = 0 ...@@ -17,8 +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 = RF injectionSite = INST_OUT
# 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
...@@ -26,10 +25,10 @@ maxWaitTimes = 5 ...@@ -26,10 +25,10 @@ maxWaitTimes = 5
# binary file of the application # binary file of the application
# Must be full path # Must be full path
benchmarkBinary = /home/badia/carol-fi-carol-fi_cuda-parallel/codes/mmElem/matrixMul benchmarkBinary = /home/badia/mycarol-fi/codes/mmElem/matrixMul
# Commands to set the session inside GDB environment # Commands to set the session inside GDB environment
benchmarkArgs = -device=1 -wA=16384 -hA=16384 -hB=16384 -wB=16384 benchmarkArgs = -wA=8192 -hA=8192 -hB=8192 -wB=8192
# CSV output file. It will be overwrite at each injection # CSV output file. It will be overwrite at each injection
csvFile = codes/mmElem/fi_matrix_mul_single_bit.csv csvFile = codes/mmElem/fi_matrix_mul_single_bit.csv
...@@ -42,5 +41,7 @@ seqSignals = 20 ...@@ -42,5 +41,7 @@ seqSignals = 20
# Initial sleep time in seconds before start sending signals # Initial sleep time in seconds before start sending signals
# Generally the memory setup time # Generally the memory setup time
initSleep = 2.3 initSleep = 2.1
#kernel = matrixMulCUDA
kernel = matrixMul.cu:205
kernel_end = matrixMul.cu:217
...@@ -17,8 +17,7 @@ faultModel = 0 ...@@ -17,8 +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 = RF, 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
...@@ -32,10 +31,10 @@ benchmarkBinary = /home/badia/mycarol-fi/codes/mmElem/matrixMul ...@@ -32,10 +31,10 @@ benchmarkBinary = /home/badia/mycarol-fi/codes/mmElem/matrixMul
benchmarkArgs = -wA=16384 -hA=16384 -hB=16384 -wB=16384 benchmarkArgs = -wA=16384 -hA=16384 -hB=16384 -wB=16384
# CSV output file. It will be overwrite at each injection # CSV output file. It will be overwrite at each injection
csvFile = codes/matrixMul/fi_matrix_mul_single_bit.csv csvFile = codes/mmElem/fi_matrix_mul_single_bit.csv
# You should create a script on the benchmark source folder to verify GOLD_OUTPUT x INJ_OUTPUT # You should create a script on the benchmark source folder to verify GOLD_OUTPUT x INJ_OUTPUT
goldenCheckScript = codes/matrixMul/sdc_check.sh goldenCheckScript = codes/mmElem/sdc_check.sh
# Number of signals that will be sent to the application # Number of signals that will be sent to the application
seqSignals = 20 seqSignals = 20
...@@ -44,5 +43,5 @@ seqSignals = 20 ...@@ -44,5 +43,5 @@ seqSignals = 20
# Generally the memory setup time # Generally the memory setup time
initSleep = 2.1 initSleep = 2.1
#kernel = matrixMulCUDA #kernel = matrixMulCUDA
kernel = matrixMul.cu:208 kernel = matrixMul.cu:205
kernel_end = matrixMul.cu:216 kernel_end = matrixMul.cu:217
...@@ -61,10 +61,10 @@ def signal_handler(sig, frame): ...@@ -61,10 +61,10 @@ def signal_handler(sig, frame):
for cmd in kill_strings.split(";"): for cmd in kill_strings.split(";"):
os.system(cmd + " > /dev/null 2>&1") os.system(cmd + " > /dev/null 2>&1")
# os.system("rm -f {}/bin/*".format(current_path)) os.system("rm -f {}/bin/*".format(current_path))
# for th in gpus_threads: for th in gpus_threads:
# th.join() th.join()
# sys.exit(0) sys.exit(0)
""" """
...@@ -593,7 +593,6 @@ def fault_injection_by_signal(**kwargs): ...@@ -593,7 +593,6 @@ def fault_injection_by_signal(**kwargs):
Main function Main function
""" """
def main(): def main():
global kill_strings, current_path, gpus_threads, lock, syncro, wait_finish global kill_strings, current_path, gpus_threads, lock, syncro, wait_finish
......
...@@ -30,7 +30,7 @@ signal ...@@ -30,7 +30,7 @@ signal
def set_event(event): def set_event(event):
# Accessing global vars # Accessing global vars
global global_logging, was_hit, bit_lip,bp,t global global_logging, was_hit, bit_flip,bp,t
if (isinstance(event, gdb.BreakpointEvent)): if (isinstance(event, gdb.BreakpointEvent)):
global_logging.info("Before breakpoint"+ str(time.clock()-t)) global_logging.info("Before breakpoint"+ str(time.clock()-t))
global_logging.info ("Enviado senal a "+ str(pid)) global_logging.info ("Enviado senal a "+ str(pid))
...@@ -56,7 +56,7 @@ Main function ...@@ -56,7 +56,7 @@ Main function
def main(): def main():
global global_logging, register, injection_site, bits_to_flip, fault_model, was_hit, bit_flip, arg0 global global_logging, register, injection_site, bits_to_flip, fault_model, was_hit, bit_flip, arg0,t,kernel,pid,bp
was_hit = False was_hit = False
......
...@@ -25,13 +25,16 @@ def set_event(event): ...@@ -25,13 +25,16 @@ def set_event(event):
print ("Es mi primera vez"+ str(primera)+" "+str(ocurrencias)) print ("Es mi primera vez"+ str(primera)+" "+str(ocurrencias))
if (isinstance(event, gdb.BreakpointEvent)): if (isinstance(event, gdb.BreakpointEvent)):
if (primera): if (primera):
t=time.clock()
t=time.time()
print ("Tomo tiempo " + str (t))
ocurrencias=ocurrencias+1 ocurrencias=ocurrencias+1
else: else:
trun=(time.clock()-t) print ("Para tiempo " + str (time.time()))
trun=(time.time()-t)
primera=not primera primera=not primera
else: # else:
trun=(time.clock()-t) # trun=(time.clock()-t)
""" """
Main function Main function
""" """
......
...@@ -8,7 +8,7 @@ set -e ...@@ -8,7 +8,7 @@ set -e
FAULTS=1000 FAULTS=1000
#CONFFILE=codes/matrixMul/matrixmul_16K.conf #CONFFILE=codes/matrixMul/matrixmul_16K.conf
CONFFILE=codes/mmElem/matrixmul_16K.conf CONFFILE=codes/mmElem/matrixmul.conf
#CONFFILE=codes/lavaMD/lavaMD.conf #CONFFILE=codes/lavaMD/lavaMD.conf
echo "Step 1 - Profiling the application for fault injection" echo "Step 1 - Profiling the application for fault injection"
./app_profiler.py -c ${CONFFILE} $* ./app_profiler.py -c ${CONFFILE} $*
......
...@@ -6,7 +6,7 @@ set -e ...@@ -6,7 +6,7 @@ set -e
#set -x #set -x
FAULTS=1000 FAULTS=1000
CONFFILE=codes/matrixMul/matrixmul_16K.conf CONFFILE=codes/matrixMul/matrixmul.conf
#CONFFILE=codes/mmElem/matrixmul_16K.conf #CONFFILE=codes/mmElem/matrixmul_16K.conf
#CONFFILE=codes/lavaMD/lavaMD.conf #CONFFILE=codes/lavaMD/lavaMD.conf
......
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