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
Irradiar
Commits
8b3090e8
Commit
8b3090e8
authored
Mar 30, 2022
by
German Leon
Browse files
Primera desde jn2
parent
f9aab839
Changes
14
Hide whitespace changes
Inline
Side-by-side
bin/iamalive
View file @
8b3090e8
No preview for this file type
bin/iamalive_ini
View file @
8b3090e8
No preview for this file type
bin/refresh_watchdog
View file @
8b3090e8
No preview for this file type
irradiacion/tools/iamalive.cpp
View file @
8b3090e8
...
@@ -14,13 +14,16 @@ int main(int argc, char*argv[]) {
...
@@ -14,13 +14,16 @@ int main(int argc, char*argv[]) {
int
valor
,
millamperes
;
int
valor
,
millamperes
;
char
buffer
[
100
];
char
buffer
[
100
];
char
name
[
50
];
char
name
[
50
];
char
*
nom
;
int
i
;
int
i
;
struct
watchdog_info
ident
;
struct
watchdog_info
ident
;
int
fd
,
ret
;
int
fd
,
ret
;
int
timeout
=
0
;
int
timeout
=
0
;
int
timeslice
=
10
;
int
timeslice
=
10
;
int
retfinal
;
int
retfinal
;
printf
(
"Entrado en iamlive....
\r\n
"
);
nom
=
getenv
(
"HOSTNAME"
);
printf
(
"Entrado en iamlive...%s.
\r\n
"
,
nom
);
while
(
1
)
{
while
(
1
)
{
sleep
(
timeslice
);
sleep
(
timeslice
);
...
@@ -28,7 +31,7 @@ int main(int argc, char*argv[]) {
...
@@ -28,7 +31,7 @@ int main(int argc, char*argv[]) {
time_t
t
=
time
(
NULL
);
time_t
t
=
time
(
NULL
);
struct
tm
tm
=
*
localtime
(
&
t
);
struct
tm
tm
=
*
localtime
(
&
t
);
fprintf
(
stdout
,
"alive: %d-%02d-%02d %02d:%02d:%02d Temp:"
,
fprintf
(
stdout
,
"alive
(%s)
: %d-%02d-%02d %02d:%02d:%02d Temp:"
,
getenv
(
"HOSTNAME"
),
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
for
(
i
=
0
;
i
<
6
;
i
++
)
{
for
(
i
=
0
;
i
<
6
;
i
++
)
{
...
...
irradiacion/tools/iamalive_ini.cpp
View file @
8b3090e8
...
@@ -15,6 +15,7 @@ int main(int argc, char*argv[]) {
...
@@ -15,6 +15,7 @@ int main(int argc, char*argv[]) {
int
valor
,
millamperes
;
int
valor
,
millamperes
;
char
buffer
[
100
];
char
buffer
[
100
];
char
name
[
50
];
char
name
[
50
];
char
*
nom
;
int
i
;
int
i
;
struct
watchdog_info
ident
;
struct
watchdog_info
ident
;
int
fd
,
ret
,
fw
;
int
fd
,
ret
,
fw
;
...
@@ -22,7 +23,6 @@ int main(int argc, char*argv[]) {
...
@@ -22,7 +23,6 @@ int main(int argc, char*argv[]) {
int
timeslice
=
10
;
int
timeslice
=
10
;
int
retfinal
;
int
retfinal
;
char
*
nom
;
/* open WDT0 device (WDT0 enables itself automatically) */
/* open WDT0 device (WDT0 enables itself automatically) */
fd
=
open
(
"/dev/watchdog0"
,
O_RDWR
);
fd
=
open
(
"/dev/watchdog0"
,
O_RDWR
);
if
(
fd
<
0
)
{
if
(
fd
<
0
)
{
...
@@ -87,6 +87,7 @@ int main(int argc, char*argv[]) {
...
@@ -87,6 +87,7 @@ int main(int argc, char*argv[]) {
if
(
(
fdl
=
fopen
(
buffer
,
"a"
)
)
==
NULL
)
{
if
(
(
fdl
=
fopen
(
buffer
,
"a"
)
)
==
NULL
)
{
printf
(
"Error! opening watchog.log file
\n
"
);
printf
(
"Error! opening watchog.log file
\n
"
);
}
}
nom
=
getenv
(
"HOSTNAME"
);
while
(
1
)
{
while
(
1
)
{
sleep
(
timeslice
);
sleep
(
timeslice
);
...
@@ -99,10 +100,10 @@ int main(int argc, char*argv[]) {
...
@@ -99,10 +100,10 @@ int main(int argc, char*argv[]) {
time_t
t
=
time
(
NULL
);
time_t
t
=
time
(
NULL
);
struct
tm
tm
=
*
localtime
(
&
t
);
struct
tm
tm
=
*
localtime
(
&
t
);
fprintf
(
stdout
,
"alive: %d-%02d-%02d %02d:%02d:%02d Temperaturas:"
,
fprintf
(
stdout
,
"alive
(%s)
: %d-%02d-%02d %02d:%02d:%02d Temperaturas:"
,
nom
,
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
fprintf
(
fdl
,
"alive: %d-%02d-%02d %02d:%02d:%02d
\n
"
,
fprintf
(
fdl
,
"alive
i(%s)
: %d-%02d-%02d %02d:%02d:%02d
\n
"
,
nom
,
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
fflush
(
fdl
);
fflush
(
fdl
);
for
(
i
=
0
;
i
<
6
;
i
++
)
{
for
(
i
=
0
;
i
<
6
;
i
++
)
{
...
...
irradiacion/tools/refresh_watchdog.cpp
View file @
8b3090e8
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
int
fd
,
ret
;
int
fd
,
ret
;
struct
watchdog_info
info
;
/* open WDT0 device (WDT0 enables itself automatically) */
/* open WDT0 device (WDT0 enables itself automatically) */
fd
=
open
(
"/dev/watchdog0"
,
O_RDWR
);
fd
=
open
(
"/dev/watchdog0"
,
O_RDWR
);
if
(
fd
<
0
)
{
if
(
fd
<
0
)
{
...
@@ -20,7 +20,7 @@ return -1;
...
@@ -20,7 +20,7 @@ return -1;
}
}
ret
=
ioctl
(
fd
,
WDIOC_KEEPALIVE
,
0
);
ret
=
ioctl
(
fd
,
WDIOC_KEEPALIVE
,
&
info
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Kick watchdog failed!
\r\n
"
);
fprintf
(
stderr
,
"Kick watchdog failed!
\r\n
"
);
return
-
1
;
return
-
1
;
...
...
microbench/config.py
View file @
8b3090e8
configs
/
glb_32_64
.
py
configs
/
glb_1_32
.
py
\ No newline at end of file
\ No newline at end of file
microbench/configs/glb_1_32.py
View file @
8b3090e8
#############################################################################
#############################################################################
scale
=
"nit"
scale
=
"nit"
totalFiNumber
=
50
0
totalFiNumber
=
50
bench
=
"glb"
bench
=
"glb"
grid
=
"1"
grid
=
"1"
blk
=
"1"
blk
=
"1"
...
...
microbench/configs/reg_1_1024.py
View file @
8b3090e8
#############################################################################
#############################################################################
scale
=
"nit"
scale
=
"nit"
totalFiNumber
=
50
0
totalFiNumber
=
50
bench
=
"
glb
"
bench
=
"
reg
"
grid
=
"1"
grid
=
"1"
blk
=
"1"
blk
=
"1
024
"
duration
=
"10000"
duration
=
"10000
00
"
outputExeFile
=
"micro"
outputExeFile
=
"micro"
bmName
=
outputExeFile
+
"_g_"
+
grid
+
"_b_"
+
blk
bmName
=
outputExeFile
+
"_g_"
+
grid
+
"_b_"
+
blk
inputParameters
=
" -bench="
+
bench
+
" -grid="
+
grid
+
" -blk="
+
blk
+
" -"
+
scale
+
"="
+
duration
inputParameters
=
" -bench="
+
bench
+
" -grid="
+
grid
+
" -blk="
+
blk
+
" -"
+
scale
+
"="
+
duration
...
@@ -12,6 +12,6 @@ timeout = 5
...
@@ -12,6 +12,6 @@ timeout = 5
inject
=
False
inject
=
False
verbose
=
True
verbose
=
True
log
=
True
log
=
True
cpufreq
=
-
1
cpufreq
=
1
479000
gpufreq
=
8520
00
gpufreq
=
9216
00
#############################################################################
#############################################################################
microbench/test.py
View file @
8b3090e8
...
@@ -5,13 +5,14 @@ import os.path
...
@@ -5,13 +5,14 @@ import os.path
from
os
import
path
from
os
import
path
import
fnmatch
import
fnmatch
import
serial
import
serial
import
watchdog
import
config
import
config
from
config
import
*
from
config
import
*
if
inject
:
if
inject
:
from
config_inject
import
*
from
config_inject
import
*
global
w
def
configurate_serie
():
def
configurate_serie
():
#os.system("sudo stop ttyS0")
#os.system("sudo stop ttyS0")
Puerto
=
0
Puerto
=
0
...
@@ -27,11 +28,12 @@ def configurate_serie():
...
@@ -27,11 +28,12 @@ def configurate_serie():
#mantener vivos los watdog softwre y hardware
#mantener vivos los watdog softwre y hardware
def
KeepWatchdog
():
def
KeepWatchdog
():
cab
=
os
.
environ
.
get
(
"MYHOME"
)
#cab=os.environ.get("MYHOME")
if
(
cab
==
None
):
#if (cab==None):
cab
=
os
.
environ
.
get
(
"HOME"
)
# cab=os.environ.get("HOME")
os
.
system
(
cab
+
"/bin/refresh_watchdog > watchsoft.test"
)
w
.
keepalive
()
os
.
system
(
"touch watchsoft.test"
)
#os.system(cab+"/bin/refresh_watchdog > watchsoft.test")
#os.system("touch watchsoft.test")
# Comprime los ficheros con extension .tar
# Comprime los ficheros con extension .tar
def
gzipFiles
():
def
gzipFiles
():
...
@@ -60,7 +62,7 @@ def writeOutput(serie, output, elapsedTime, outputFileName, fileName):
...
@@ -60,7 +62,7 @@ def writeOutput(serie, output, elapsedTime, outputFileName, fileName):
def
runBenchmark
(
fiIni
,
fileName
,
tIni
):
def
runBenchmark
(
fiIni
,
fileName
,
tIni
):
serie
=
configurate_serie
()
serie
=
configurate_serie
()
w
=
watchdog
.
watchdog
()
numTimeouts
=
0
numTimeouts
=
0
if
(
totalFiNumber
==
-
1
):
# bucle infinito
if
(
totalFiNumber
==
-
1
):
# bucle infinito
...
@@ -76,7 +78,8 @@ def runBenchmark(fiIni, fileName, tIni):
...
@@ -76,7 +78,8 @@ def runBenchmark(fiIni, fileName, tIni):
fiNumber
=
fiNumber
+
1
fiNumber
=
fiNumber
+
1
KeepWatchdog
()
# KeepWatchdog()
w
.
keepalive
()
# if (fiNumber > 100):
# if (fiNumber > 100):
# tout = 90
# tout = 90
...
@@ -110,11 +113,11 @@ def runBenchmark(fiIni, fileName, tIni):
...
@@ -110,11 +113,11 @@ def runBenchmark(fiIni, fileName, tIni):
if
(
p
.
exitstatus
==
0
):
if
(
p
.
exitstatus
==
0
):
if
verbose
:
if
verbose
:
print
(
"(%d) %s; PASS in %.2f ms."
%
(
fiNumber
,
ti
,
elapsedTime
)
)
print
(
"(%d) %s; PASS in %.2f ms."
%
(
fiNumber
,
ti
,
elapsedTime
)
)
#
print(p.before)
print
(
p
.
before
)
sys
.
stdout
.
flush
()
sys
.
stdout
.
flush
()
if
log
:
if
log
:
stdLogFile
.
write
(
"(%d) %s; PASS in %.2f ms.
\n
"
%
(
fiNumber
,
ti
,
elapsedTime
)
)
stdLogFile
.
write
(
"(%d) %s; PASS in %.2f ms.
\n
"
%
(
fiNumber
,
ti
,
elapsedTime
)
)
#
stdLogFile.write("%s\n" % (p.before) )
stdLogFile
.
write
(
"%s
\n
"
%
(
p
.
before
)
)
stdLogFile
.
flush
()
stdLogFile
.
flush
()
# serie.write("(%d) %s; PASS in %.2f ms.\n\r" % (fiNumber, ti, elapsedTime) )
# serie.write("(%d) %s; PASS in %.2f ms.\n\r" % (fiNumber, ti, elapsedTime) )
# serie.write("%s\n" % (p.before) )
# serie.write("%s\n" % (p.before) )
...
@@ -125,7 +128,7 @@ def runBenchmark(fiIni, fileName, tIni):
...
@@ -125,7 +128,7 @@ def runBenchmark(fiIni, fileName, tIni):
sys
.
stdout
.
flush
()
sys
.
stdout
.
flush
()
if
log
:
if
log
:
stdLogFile
.
write
(
"(%d) %s; CRASH in %.2f ms.; %s
\n
"
%
(
fiNumber
,
ti
,
elapsedTime
,
outputFileName
)
)
stdLogFile
.
write
(
"(%d) %s; CRASH in %.2f ms.; %s
\n
"
%
(
fiNumber
,
ti
,
elapsedTime
,
outputFileName
)
)
#
stdLogFile.write("%s\n" % (p.before) )
stdLogFile
.
write
(
"%s
\n
"
%
(
p
.
before
)
)
stdLogFile
.
flush
()
stdLogFile
.
flush
()
# serie.write("(%d) %s; CRASH in %.2f ms.; %s\n\r" % (fiNumber, ti, elapsedTime, outputFileName) )
# serie.write("(%d) %s; CRASH in %.2f ms.; %s\n\r" % (fiNumber, ti, elapsedTime, outputFileName) )
# serie.flush()
# serie.flush()
...
@@ -134,11 +137,11 @@ def runBenchmark(fiIni, fileName, tIni):
...
@@ -134,11 +137,11 @@ def runBenchmark(fiIni, fileName, tIni):
elif
(
p
.
exitstatus
==
1
):
elif
(
p
.
exitstatus
==
1
):
if
verbose
:
if
verbose
:
print
(
"(%d) %s; SDC in %.2f ms."
%
(
fiNumber
,
ti
,
elapsedTime
)
)
print
(
"(%d) %s; SDC in %.2f ms."
%
(
fiNumber
,
ti
,
elapsedTime
)
)
#
print(p.before)
print
(
p
.
before
)
sys
.
stdout
.
flush
()
sys
.
stdout
.
flush
()
if
log
:
if
log
:
stdLogFile
.
write
(
"(%d) %s; SDC in %.2f ms.; %s
\n
"
%
(
fiNumber
,
ti
,
elapsedTime
,
outputFileName
)
)
stdLogFile
.
write
(
"(%d) %s; SDC in %.2f ms.; %s
\n
"
%
(
fiNumber
,
ti
,
elapsedTime
,
outputFileName
)
)
#
stdLogFile.write("%s\n" % (p.before) )
stdLogFile
.
write
(
"%s
\n
"
%
(
p
.
before
)
)
stdLogFile
.
flush
()
stdLogFile
.
flush
()
# serie.write("(%d) %s; SDC in %.2f ms.; %s\n\r" % (fiNumber, ti, elapsedTime, outputFileName) )
# serie.write("(%d) %s; SDC in %.2f ms.; %s\n\r" % (fiNumber, ti, elapsedTime, outputFileName) )
# serie.flush()
# serie.flush()
...
@@ -150,7 +153,7 @@ def runBenchmark(fiIni, fileName, tIni):
...
@@ -150,7 +153,7 @@ def runBenchmark(fiIni, fileName, tIni):
sys
.
stdout
.
flush
()
sys
.
stdout
.
flush
()
if
log
:
if
log
:
stdLogFile
.
write
(
"(%d) %s; Exit status: %d in %.2f ms.
\n
"
%
(
fiNumber
,
ti
,
p
.
exitstatus
,
elapsedTime
)
)
stdLogFile
.
write
(
"(%d) %s; Exit status: %d in %.2f ms.
\n
"
%
(
fiNumber
,
ti
,
p
.
exitstatus
,
elapsedTime
)
)
#
stdLogFile.write("%s\n" % (p.before) )
stdLogFile
.
write
(
"%s
\n
"
%
(
p
.
before
)
)
stdLogFile
.
flush
()
stdLogFile
.
flush
()
# serie.write("(%d) %s; Exit status: %d in %.2f ms.\n\r" % (fiNumber, ti, p.exitstatus, elapsedTime) )
# serie.write("(%d) %s; Exit status: %d in %.2f ms.\n\r" % (fiNumber, ti, p.exitstatus, elapsedTime) )
# serie.flush()
# serie.flush()
...
@@ -230,7 +233,7 @@ def main(argv):
...
@@ -230,7 +233,7 @@ def main(argv):
fileName
=
sys
.
argv
[
1
]
fileName
=
sys
.
argv
[
1
]
fiIni
=
int
(
sys
.
argv
[
2
]
)
fiIni
=
int
(
sys
.
argv
[
2
]
)
tIni
=
sys
.
argv
[
3
]
tIni
=
sys
.
argv
[
3
]
# w=watchdog.watchdog()
# if ( os.path.exists('lastFiNumber') ):
# if ( os.path.exists('lastFiNumber') ):
# lastFile = open("lastFiNumber", "r")
# lastFile = open("lastFiNumber", "r")
# fiIni = int( lastFile.read() ) + 1
# fiIni = int( lastFile.read() ) + 1
...
...
microbench/test.sh
View file @
8b3090e8
...
@@ -62,6 +62,7 @@ fi
...
@@ -62,6 +62,7 @@ fi
sudo
killall iamalive_ini
sudo
killall iamalive_ini
${
MYHOME
}
/bin/iamalive.sh
# > /dev/ttyS0 &
${
MYHOME
}
/bin/iamalive.sh
# > /dev/ttyS0 &
echo
"<========="
$totalFiNumber
"=============>"
if
[
$totalFiNumber
-eq
-1
]
if
[
$totalFiNumber
-eq
-1
]
then
then
forever
=
1
forever
=
1
...
@@ -91,7 +92,7 @@ do
...
@@ -91,7 +92,7 @@ do
sufix
=
""
sufix
=
""
else
else
g
=
`
${
MYHOME
}
/bin/gpufreq-info
`
g
=
`
${
MYHOME
}
/bin/gpufreq-info
`
sufix
=
"_"
${
g
%
"000
000
"
}
sufix
=
${
g
%
"000"
}
fi
fi
fileName
=
${
bench
}
"_"
${
grid
}
"_b"
${
blk
}
"_"
${
sufix
}
fileName
=
${
bench
}
"_"
${
grid
}
"_b"
${
blk
}
"_"
${
sufix
}
...
...
startup_script.sh
View file @
8b3090e8
#!/bin/bash
#!/bin/bash
# start the four cores
#/home/ubuntu/bin/startcores
export
MYHOME
=
$(
echo
$0
|cut
-d
'/'
-f1-3
)
export
MYHOME
=
$(
echo
$0
|cut
-d
'/'
-f1-3
)
cd
$MYHOME
cd
$MYHOME
#chmod a+rw /dev/watchdog0
#chmod 0666 /dev/ttyS0
date
>>
reboot.log
export
LD_LIBRARY_PATH
=
/usr/local/cuda/lib64
# Nos vamos al directorio donde estan los test
# Nos vamos al directorio donde estan los test
cd
`
grep
-v
\#
dir_test
`
cd
`
grep
-v
\#
dir_test
`
#tools/serie.py
echo
"Solo lo mantenemos vivo..."
#$MYHOME/bin/serie.py
#/home/happy/bin/serie.py
if
test
-f
"deleteindex.flag"
;
then
if
test
-f
"deleteindex.flag"
;
then
rm
lastFiNumber deleteindex.flag
rm
lastFiNumber deleteindex.flag
fi
fi
$MYHOME
/bin/id.sh
$MYHOME
/bin/iamalive
#/bin/bash
$MYHOME
/bin/iamalive_ini 20 10 &
./test.sh
startup_script_noactivo.sh
View file @
8b3090e8
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
# start the four cores
# start the four cores
#/home/ubuntu/bin/startcores
#/home/ubuntu/bin/startcores
export
MYHOME
=
$(
echo
$0
|cut
-d
'/'
-f1-3
)
export
MYHOME
=
$(
echo
$0
|cut
-d
'/'
-f1-3
)
export
HOSTNAME
cd
$MYHOME
cd
$MYHOME
#chmod a+rw /dev/watchdog0
#chmod a+rw /dev/watchdog0
...
@@ -20,5 +21,5 @@ fi
...
@@ -20,5 +21,5 @@ fi
#/bin/bash
#/bin/bash
$MYHOME
/bin/iamalive_ini 20 10 &
$MYHOME
/bin/iamalive_ini 20 10 &
$MYHOME
/bin/id.sh
./test.sh
./test.sh
&
startup_script_stop.sh
View file @
8b3090e8
...
@@ -13,6 +13,6 @@ echo "Solo lo mantenemos vivo..."
...
@@ -13,6 +13,6 @@ echo "Solo lo mantenemos vivo..."
if
test
-f
"deleteindex.flag"
;
then
if
test
-f
"deleteindex.flag"
;
then
rm
lastFiNumber deleteindex.flag
rm
lastFiNumber deleteindex.flag
fi
fi
$MYHOME
/bin/id.sh
$MYHOME
/bin/iamalive
$MYHOME
/bin/iamalive
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