Commit cb048c77 authored by iker_martin's avatar iker_martin
Browse files

Added scripts for Costum runs where Slurm is not needed. Refactor of some Exec scripts.

parent c0ec4dab
......@@ -180,7 +180,8 @@ do
#3 - Launch execution
echo "Run$run lacks $diff repetitions"
echo "sbatch -N $node_qty $dir$execDir./singleRun.sh config$run.ini $run $diff"
use_extrae=0
sbatch -N $node_qty $dir$execDir./generalRun.sh $dir $config_file $use_extrae $run $diff
fi
else
echo "File R${run}_Global.out does not exist -- Could it be it must still be executed?"
......
......@@ -4,6 +4,8 @@
#SBATCH --exclude=c02,c01,c00
#SBATCH -p P1
codeDir="/Codes/build"
execDir="/Exec"
ResultsDir="/Results"
echo "START TEST"
......@@ -20,36 +22,52 @@ then
exit -1
fi
#READ PARAMETERS AND ENSURE CORRECTNESS
dir=$1
configFile=$2
use_extrae=$3
outFileIndex=$4
qty=1
if [ $# -ge 5 ]
if [ $# -ge 6 ]
then
qty=$5
fi
nodelist=$SLURM_JOB_NODELIST
nodes=$SLURM_JOB_NUM_NODES
if [ -z "$nodelist" ];
then
echo "Internal ERROR in generalRun.sh - Nodelist not provided"
exit -1
fi
if [ -z "$nodes" ];
then
nodes=1
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)
echo "Nodes=$SLURM_JOB_NODELIST"
#EXECUTE RUN
echo "Nodes=$nodelist"
if [ $use_extrae -ne 1 ]
then
for ((i=0; i<qty; i++))
do
mpirun -np $numP $dir$codeDir/a.out $configFile $outFileIndex $SLURM_JOB_NODELIST $SLURM_JOB_NUM_NODES
mpirun -np $numP $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes
done
else
cp $dir$execDir/Extrae/extrae.xml .
cp $dir$execDir/Extrae/trace.sh .
cp $dir$execDir/Extrae/trace_worker.sh .
for ((i=0; i<qty; i++))
do
srun -n$numP --mpi=pmi2 ./trace.sh $dir$codeDir/a.out $configFile $outFileIndex $SLURM_JOB_NODELIST $SLURM_JOB_NUM_NODES
srun -n$numP --mpi=pmi2 ./trace.sh $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes
done
fi
echo "END TEST"
sed -i 's/application called MPI_Abort(MPI_COMM_WORLD, -100) - process/shrink cleaning/g' slurm-$SLURM_JOB_ID.out
sed -i 's/Abort(-100)/shrink cleaning/g' slurm-$SLURM_JOB_ID.out
#!/bin/bash
#This script should only be called by others scripts, do not call it directly
codeDir="/Codes/build"
echo "START TEST"
#$1 == baseDir
#$2 == configFile
#$3 == use_extrae
#$4 == outFileIndex
#$5 == qty
echo $@
if [ $# -lt 3 ]
then
echo "Internal ERROR generalRun.sh - Not enough arguments were given"
exit -1
fi
#READ PARAMETERS AND ENSURE CORRECTNESS
dir=$1
configFile=$2
use_extrae=0
outFileIndex=0
qty=1
if [ $# -ge 4 ]
then
use_extrae=$3
fi
if [ $# -ge 5 ]
then
outFileIndex=$4
fi
if [ $# -ge 6 ]
then
qty=$5
fi
nodelist=$SLURM_JOB_NODELIST
nodes=$SLURM_JOB_NUM_NODES
if [ -z "$nodelist" ];
then
nodelist="localhost"
fi
if [ -z "$nodes" ];
then
nodes=1
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
echo "Nodes=$nodelist"
if [ $use_extrae -ne 1 ]
then
for ((i=0; i<qty; i++))
do
mpirun -np $numP $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes
done
else
cp $dir$execDir/Extrae/extrae.xml .
cp $dir$execDir/Extrae/trace.sh .
cp $dir$execDir/Extrae/trace_worker.sh .
for ((i=0; i<qty; i++))
do
mpirun -np $numP ./trace.sh $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes
done
fi
echo "END TEST"
File mode changed from 100644 to 100755
dir="/home/martini/malleability_benchmark"
partition="P1"
exclude="c00,c01,c02"
procs=(2 10 20 40 80 120 160)
cores=20
#====== Do not modify these values =======
codeDir="/Codes/build"
execDir="/Exec"
ResultsDir="/Results"
use_extrae=1
#Extrae config
qty=1
outFileIndex=$2
if [ $# -ge 1 ]
then
qty=$1
fi
for proc in "${procs[@]}"
do
echo "------------------------------------------run np=$proc"
node_qty=$(($proc / $cores))
if [ $node_qty -eq 0 ]
then
node_qty=1
fi
config_file="test$proc"".ini"
upper_dir="Proc$proc"
mkdir $upper_dir
cd $upper_dir
for ((i=0; i<qty; i++))
do
# Move data to new directory
lower_dir="Run$i"
mkdir $lower_dir
cd $lower_dir
cp $dir$execDir/Extrae/extrae.xml .
cp $dir$execDir/Extrae/trace.sh .
cp ../../$config_file .
#Execute test
sbatch -p $partition --exclude=$exclude -N $node_qty $dir$execDir/generalRun.sh $dir $config_file $use_extrae $outFileIndex
cd ..
done
cd ..
done
echo "End"
#!/bin/bash
#SBATCH --exclude=c02,c01,c00
#SBATCH -p P1
dir="/home/martini/malleability_benchmark"
codeDir="/Codes/build"
partition="P1"
exclude="c00,c01,c02"
cores=20
# Executes a given configuration file with the aid of
# the RMS Slurm.
# Parameter 1: Configuration file name for the emulation.
# Parameter 2(Optional): Index to use for the output files. Must be a positive integer.
# Parameter 3(Optional): Number of repetitions to perform. Must be a positive integer.
# Parameter 4(Optional): Use Extrae(1) or not(0).
# Parameter 5(Optional): Path where the output files should be saved.
#====== Do not modify these values =======
nodelist=$SLURM_JOB_NODELIST
nodes=$SLURM_JOB_NUM_NODES
codeDir="/Codes/build"
execDir="/Exec"
ResultsDir="/Results"
if [ $# -lt 1 ]
if [ $# -lt 2 ]
then
echo "Not enough arguments. Usage:"
echo "singleRun.sh config.ini [outFileIndex] [Qty] [Output path]"
echo "bash singleRun.sh config.ini [outFileIndex] [Qty] [Use extrae] [Output path]"
exit 1
fi
echo "START TEST"
#$1 == configFile
#$2 == outFileIndex
#$3 == Qty of repetitions
#$4 == Output path
#$4 == Use extrae NO(0) YES(1)
#$5 == Output path
configFile=$1
outFileIndex=$2
config_file=$1
outFileIndex=0
qty=1
use_extrae=0
if [ $# -gt 2 ]
then
outFileIndex=$2
fi
if [ $# -gt 3 ]
then
qty=$3
if [ $# -gt 3 ]
then
output=$4
fi
fi
if [ $# -gt 4 ]
then
use_extrae=$4
fi
if [ $# -gt 5 ]
then
output=$5
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)
echo "Nodes=$SLURM_JOB_NODELIST"
for ((i=0; i<qty; i++))
#1 - Obtain maximum number of processes for the run
max_numP=-1
total_groups=$(grep Total_Resizes config2.ini | cut -d '=' -f2)
for ((j=0; j<total_groups; j++));
do
echo "Iter $i -- numP=$numP"
mpirun -np $numP $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes
resize_info=$(grep "\[resize$j\]" -n $config_file | cut -d ":" -f1)
first_line=$(echo $resize_info | cut -d " " -f1)
last_line=$(echo $resize_info | cut -d " " -f2)
range_lines=$(( last_line - first_line ))
numP=$(head -$last_line $config_file | tail -$range_lines | cut -d ';' -f1 | grep Procs | cut -d '=' -f2)
if [ "$numP" -gt "$max_numP" ];
then
max_numP=$numP
fi
done
echo "END TEST"
sed -i 's/application called MPI_Abort(MPI_COMM_WORLD, -100) - process/shrink cleaning/g' slurm-$SLURM_JOB_ID.out
sed -i 's/Abort(-100)/shrink cleaning/g' slurm-$SLURM_JOB_ID.out
#2 - Obtain needed nodes for the number of processes
node_qty=$(($max_numP / $cores))
if [ "$node_qty" -eq "0" ];
then
node_qty=1
fi
if [ $# -gt 3 ]
#3 - Run with the expected amount of nodes
sbatch -p $partition --exclude=$exclude -N $node_qty $dir$execDir/generalRun.sh $dir $config_file $use_extrae $outFileIndex $qty
if ! [ -z "$output" ]
then
mkdir -p $output
echo "Moving data to $output\nMoved files:"
ls R${outFileIndex}_G*
mv R${outFileIndex}_G* $output
if [ "$use_extrae" -eq 1 ]
then
mv a.out.* $output
mv TRACE* $output
mv set-0/ $output
fi
fi
#!/bin/bash
dir="/home/martini/malleability_benchmark"
# Executes a given configuration file
# Parameter 1: Configuration file name for the emulation.
# Parameter 2(Optional): Index to use for the output files. Must be a positive integer.
# Parameter 3(Optional): Number of repetitions to perform. Must be a positive integer.
# Parameter 4(Optional): Use Extrae(1) or not(0).
# Parameter 5(Optional): Path where the output files should be saved.
#====== Do not modify these values =======
codeDir="/Codes/build"
execDir="/Exec"
ResultsDir="/Results"
if [ $# -lt 2 ]
then
echo "Not enough arguments. Usage:"
echo "singleRunCostum.sh config.ini [outFileIndex] [Qty] [Use Extrae] [Output path]"
exit 1
fi
echo "START TEST"
#$1 == configFile
#$2 == outFileIndex
#$3 == Qty of repetitions
#$4 == Use extrae NO(0) YES(1)
#$5 == Output path
config_file=$1
outFileIndex=0
qty=1
use_extrae=0
if [ $# -gt 2 ]
then
outFileIndex=$2
fi
if [ $# -gt 3 ]
then
qty=$3
fi
if [ $# -gt 4 ]
then
use_extrae=$4
fi
if [ $# -gt 5 ]
then
output=$5
fi
bash $dir$execDir/generalRunCostum.sh $dir $config_file $use_extrae $outFileIndex $qty
if ! [ -z "$output" ]
then
mkdir -p $output
echo "Moving data to $output\nMoved files:"
ls R${outFileIndex}_G*
mv R${outFileIndex}_G* $output
if [ "$use_extrae" -eq 1 ]
then
mv a.out.* $output
mv TRACE* $output
mv set-0/ $output
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