#!/bin/bash dir="/home/martini/malleability_benchmark/" codeDir="Codes/" execDir="Exec/" ResultsDir="Results/" ResultsDirName=$1 maxIndex=$2 cantidadGrupos=$3 #Contando a los padres if [ $# -lt 3 ] then echo "Faltan argumentos" echo "Uso -> bash CheckRun NombreDirectorio IndiceMaximo Grupos" exit -1 fi cd $dir$ResultsDir if [ ! -d $ResultsDirName ] then echo "La carpeta de resultados $ResultsDirName no existe. Abortando" exit -1 fi cd $ResultsDirName #Comprobar si hay errores #Si los hay, salir grep -i -e fatal -e error -e abort -e == */slurm* > errores2.txt qty=$(wc -l errores2.txt | cut -d ' ' -f1) if [ $qty -gt 0 ] then echo "Se han encontrado errores de ejecución graves. Abortando" echo "Revisar archivo errores2.txt en el directorio $ResultsDirName" exit -2 fi rm errores2.txt qtyG=$(ls R*/R*_Global.out | wc -l) qtyG=$(($qtyG * 2)) qtyL=$(ls R*/R*_G?N*.out | wc -l) if [ $qtyG == $qtyL ] then echo "El numero de ficheros G($qtyG) y L($qtyL) coincide" else # TODO Expandir indicando cuales echo "Faltan ejecuciones Locales o globales" exit -1 fi #Comprobar si hay runs con tiempo negativos #Si los hay, reejecutar e informar de cuales son grep - */R* | grep Tex > errores.txt qty=$(wc -l errores.txt | cut -d ' ' -f1) if [ $qty -gt 0 ] then echo "Se han encontrado errores de ejecución leves. Volviendo a ejecutar" while IFS="" read -r lineRun || [ -n "$lineRun" ] do #Obtener datos de una ejecución erronea run=$(echo $lineRun | cut -d 'R' -f3 | cut -d '_' -f1) if [ $run -gt $maxIndex ] then #Indice de ejecuciones posteriores realRun=$(($run - $maxIndex)) index=$run else # Indice de las primeras ejecuciones realRun=$run index=$(($run + $maxIndex)) fi echo "Run $run" cd Run$realRun #Arreglar ejecuccion #1 - Borrar lineas erroneas qty=$(grep -n - R* | grep Tex | wc -l) for ((i=0; i