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
f4173eff
Commit
f4173eff
authored
Dec 14, 2020
by
German Leon
Browse files
Version en funcionamiento
parent
1bc72d3b
Changes
14
Show whitespace changes
Inline
Side-by-side
app_profiler.py
View file @
f4173eff
...
@@ -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
)
...
...
classes/BitFlip.py
View file @
f4173eff
...
@@ -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
"""
"""
...
...
classes/__pycache__/Logging.cpython-37.pyc
View file @
f4173eff
No preview for this file type
classes/__pycache__/RunGDB.cpython-37.pyc
View file @
f4173eff
No preview for this file type
classes/__pycache__/SignalApp.cpython-37.pyc
View file @
f4173eff
No preview for this file type
classes/__pycache__/SummaryFile.cpython-37.pyc
View file @
f4173eff
No preview for this file type
classes/__pycache__/__init__.cpython-37.pyc
View file @
f4173eff
No preview for this file type
codes/mmElem/matrixmul.conf
View file @
f4173eff
...
@@ -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
/
my
carol
-
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
codes/mmElem/matrixmul_16K.conf
View file @
f4173eff
...
@@ -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
/
m
atrixMul
/
fi_matrix_mul_single_bit
.
csv
csvFile
=
codes
/
m
mElem
/
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
/
m
atrixMul
/
sdc_check
.
sh
goldenCheckScript
=
codes
/
m
mElem
/
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
:
20
8
kernel
=
matrixMul
.
cu
:
20
5
kernel_end
=
matrixMul
.
cu
:
21
6
kernel_end
=
matrixMul
.
cu
:
21
7
fault_injector.py
View file @
f4173eff
...
@@ -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
...
...
flip_value.py
View file @
f4173eff
...
@@ -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_
f
lip
,
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
...
...
profiler_new.py
View file @
f4173eff
...
@@ -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
"""
"""
...
...
test_mult.sh
View file @
f4173eff
...
@@ -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
}
$*
...
...
test_mult_mBlock.sh
View file @
f4173eff
...
@@ -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
...
...
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