Commit 8b3090e8 authored by German Leon's avatar German Leon
Browse files

Primera desde jn2

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