Commit a6e304bd authored by iker_martin's avatar iker_martin
Browse files

Added description to general run scripts. Also, they have been modified to use...

Added description to general run scripts. Also, they have been modified to use auxiliary scripts and now give mpirun an initial hostlist to use.
parent 50d0bb80
#!/bin/bash #!/bin/bash
#This script should only be called by others scripts, do not call it directly
#SBATCH --exclude=c02,c01,c00 #SBATCH --exclude=c02,c01,c00
#SBATCH -p P1 #SBATCH -p P1
# !!!!This script should only be called by others scripts, do not call it directly!!!
# Runs a given configuration file with the indicated parameters with the aid of the RMS Slurm.
# Parameter 1 - Base directory of the malleability benchmark
# Parameter 2 - Number of cores in a single machine
# Parameter 3 - Configuration file name for the emulation.
# Parameter 4 - Use Extrae(1) or not(0).
# Parameter 5 - Index to use for the output files. Must be a positive integer.
# Parameter 6 - Amount of executions per file. Must be a positive number.
#====== Do not modify these values =======
codeDir="/Codes/build" codeDir="/Codes/build"
execDir="/Exec" execDir="/Exec"
ResultsDir="/Results" ResultsDir="/Results"
...@@ -10,13 +20,14 @@ ResultsDir="/Results" ...@@ -10,13 +20,14 @@ ResultsDir="/Results"
echo "START TEST" echo "START TEST"
#$1 == baseDir #$1 == baseDir
#$2 == configFile #$1 == cores
#$3 == use_extrae #$3 == configFile
#$4 == outFileIndex #$4 == use_extrae
#$5 == qty #$5 == outFileIndex
#$6 == qty
echo $@ echo $@
if [ $# -lt 3 ] if [ $# -lt 4 ]
then then
echo "Internal ERROR generalRun.sh - Not enough arguments were given" echo "Internal ERROR generalRun.sh - Not enough arguments were given"
exit -1 exit -1
...@@ -24,13 +35,14 @@ fi ...@@ -24,13 +35,14 @@ fi
#READ PARAMETERS AND ENSURE CORRECTNESS #READ PARAMETERS AND ENSURE CORRECTNESS
dir=$1 dir=$1
configFile=$2 cores=$2
use_extrae=$3 configFile=$3
outFileIndex=$4 use_extrae=$4
outFileIndex=$5
qty=1 qty=1
if [ $# -ge 5 ] if [ $# -ge 5 ]
then then
qty=$5 qty=$6
fi fi
nodelist=$SLURM_JOB_NODELIST nodelist=$SLURM_JOB_NODELIST
...@@ -45,10 +57,8 @@ then ...@@ -45,10 +57,8 @@ then
nodes=1 nodes=1
fi fi
aux=$(grep "\[resize0\]" -n $configFile | cut -d ":" -f1) numP=$(bash $dir$execDir/BashScripts/getNumPNeeded.sh $configFile 0)
read -r ini fin <<<$(echo $aux) initial_nodelist=$(bash $dir$execDir/BashScripts/createInitialNodelist.sh $numP $cores $nodelist)
diff=$(( fin - ini ))
numP=$(head -$fin $configFile | tail -$diff | cut -d ';' -f1 | grep Procs | cut -d '=' -f2)
#EXECUTE RUN #EXECUTE RUN
echo "Nodes=$nodelist" echo "Nodes=$nodelist"
...@@ -56,7 +66,7 @@ if [ $use_extrae -ne 1 ] ...@@ -56,7 +66,7 @@ if [ $use_extrae -ne 1 ]
then then
for ((i=0; i<qty; i++)) for ((i=0; i<qty; i++))
do do
mpirun -np $numP $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes mpirun -hosts $initial_nodelist -np $numP $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes
done done
else else
cp $dir$execDir/Extrae/extrae.xml . cp $dir$execDir/Extrae/extrae.xml .
...@@ -64,6 +74,7 @@ else ...@@ -64,6 +74,7 @@ else
cp $dir$execDir/Extrae/trace_worker.sh . cp $dir$execDir/Extrae/trace_worker.sh .
for ((i=0; i<qty; i++)) for ((i=0; i<qty; i++))
do do
#FIXME Extrae not tested keeping in mind the initial nodelist - Could have some errors
srun -n$numP --mpi=pmi2 ./trace.sh $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes srun -n$numP --mpi=pmi2 ./trace.sh $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes
done done
fi fi
......
#!/bin/bash #!/bin/bash
#This script should only be called by others scripts, do not call it directly
# !!!!This script should only be called by others scripts, do not call it directly!!!
# Runs a given configuration file with the indicated parameters.
# Parameter 1 - Base directory of the malleability benchmark
# Parameter 2 - Number of cores in a single machine
# Parameter 3 - Configuration file name for the emulation.
# Parameter 4 - Use Extrae(1) or not(0).
# Parameter 5 - Index to use for the output files. Must be a positive integer.
# Parameter 6 - Amount of executions per file. Must be a positive number.
#====== Do not modify these values =======
codeDir="/Codes/build" codeDir="/Codes/build"
execDir="/Exec" execDir="/Exec"
ResultsDir="/Results" ResultsDir="/Results"
...@@ -7,63 +17,64 @@ ResultsDir="/Results" ...@@ -7,63 +17,64 @@ ResultsDir="/Results"
echo "START TEST" echo "START TEST"
#$1 == baseDir #$1 == baseDir
#$2 == configFile #$2 == cores
#$3 == use_extrae #$3 == configFile
#$4 == outFileIndex #$4 == use_extrae
#$5 == qty #$5 == outFileIndex
#$6 == qty
echo $@ echo $@
if [ $# -lt 3 ] if [ $# -lt 3 ]
then then
echo "Internal ERROR generalRun.sh - Not enough arguments were given" echo "Internal ERROR generalRunCostum.sh - Not enough arguments were given"
exit -1 exit -1
fi fi
#READ PARAMETERS AND ENSURE CORRECTNESS #READ PARAMETERS AND ENSURE CORRECTNESS
dir=$1 dir=$1
configFile=$2 cores=$2
configFile=$3
use_extrae=0 use_extrae=0
outFileIndex=0 outFileIndex=0
qty=1 qty=1
if [ $# -ge 3 ] if [ $# -ge 4 ]
then then
use_extrae=$3 use_extrae=$3
fi fi
if [ $# -ge 4 ] if [ $# -ge 5 ]
then then
outFileIndex=$4 outFileIndex=$4
fi fi
if [ $# -ge 5 ] if [ $# -ge 6 ]
then then
qty=$5 qty=$5
fi fi
numP=$(bash $dir$execDir/BashScripts/getNumPNeeded.sh $configFile 0)
nodelist=$SLURM_JOB_NODELIST nodelist=$SLURM_JOB_NODELIST
nodes=$SLURM_JOB_NUM_NODES nodes=$SLURM_JOB_NUM_NODES
if [ -z "$nodelist" ]; if [ -z "$nodelist" ];
then then
nodelist="localhost" nodelist="localhost"
initial_nodelist="localhost"
else
initial_nodelist=$(bash $dir$execDir/BashScripts/createInitialNodelist.sh $numP $cores $nodelist)
fi fi
if [ -z "$nodes" ]; if [ -z "$nodes" ];
then then
nodes=1 nodes=1
fi fi
aux=$(grep "\[resize0\]" -n $configFile | cut -d ":" -f1)
read -r ini fin <<<$(echo $aux)
diff=$(( fin - ini ))
numP=$(head -$fin $configFile | tail -$diff | cut -d ';' -f1 | grep Procs | cut -d '=' -f2)
#EXECUTE RUN #EXECUTE RUN
echo "Nodes=$nodelist" echo "Nodes=$nodelist"
if [ $use_extrae -ne 1 ] if [ $use_extrae -ne 1 ]
then then
for ((i=0; i<qty; i++)) for ((i=0; i<qty; i++))
do do
mpirun -np $numP $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes mpirun -hosts $initial_nodelist -np $numP $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes
done done
else else
cp $dir$execDir/Extrae/extrae.xml . cp $dir$execDir/Extrae/extrae.xml .
...@@ -71,7 +82,7 @@ else ...@@ -71,7 +82,7 @@ else
cp $dir$execDir/Extrae/trace_worker.sh . cp $dir$execDir/Extrae/trace_worker.sh .
for ((i=0; i<qty; i++)) for ((i=0; i<qty; i++))
do do
mpirun -np $numP ./trace.sh $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes mpirun -hosts $initial_nodelist -np $numP ./trace.sh $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes
done done
fi fi
......
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