116 lines
3.5 KiB
Bash
Executable File
116 lines
3.5 KiB
Bash
Executable File
#! /bin/bash
|
|
|
|
set -u
|
|
|
|
LC_ALL=C
|
|
|
|
# Files and directories
|
|
binDir="bin"
|
|
calcDir="calculation"
|
|
|
|
# Param
|
|
binList="$(ls -1 "${binDir}"| sed '$!s/$/ /' | tr -d '\n')"
|
|
nbNodesList="2" # Nombre de noeuds chainés dans le pipeline
|
|
typeProdList="none useless_loop line matrice" # Methode pour produire les valeurs
|
|
typeCacheList="L2 Memory" # Niveau de cache partage
|
|
perfOpt="stat -B -r 10 -e cycles -e L1-dcache-loads -e L1-dcache-stores -e L1-dcache-load-misses -e L1-dcache-store-misses -e L1-dcache-prefetch-misses"
|
|
|
|
# Const
|
|
nbIter="500000768" # Nb de lignes produites (doit être un multiple de BUF_SIZE)
|
|
sizeBuf="1" # En nombre de lignes de cache
|
|
|
|
# Nom generique des fichiers de log
|
|
logFileName="\$perfDirName/cache_\$typeCache-nbNodes_\$nbNodes-typeProd_\$typeProd-argTypeProd_\$argTypeProd-nbIter_\$nbIter-\$bin.log"
|
|
expDirName="logs"
|
|
perfDirName="$expDirName/perfCommMulti-`date +'%F-%Hh%Mm%S'`"
|
|
|
|
perfOpt="$perfOpt -o $logFileName.perf"
|
|
|
|
export LD_LIBRARY_PATH
|
|
|
|
[ -d "$expDirName" ] || mkdir "$expDirName"
|
|
[ -d "$perfDirName" ] || mkdir "$perfDirName"
|
|
|
|
function_run () {
|
|
case $typeProd in
|
|
"none" ) optTypeProd="" ;;
|
|
"line" ) optTypeProd="-c lib/${calcDir}/libcalc_line.so ${argTypeProd}" ;;
|
|
"matrice" ) optTypeProd="-c lib/${calcDir}/libcalc_mat.so ${argTypeProd}" ;;
|
|
"useless_loop" ) optTypeProd="-c lib/${calcDir}/libcalc_useless_loop.so ${argTypeProd}" ;;
|
|
* ) exit 1 ;;
|
|
esac
|
|
case $typeCache in
|
|
"Memory" ) optTypeCache="" ;;
|
|
"L2" ) optTypeCache="-s" ;;
|
|
* ) exit 1 ;;
|
|
esac
|
|
nbNodes=$((nbNodes))
|
|
case $nbNodes in
|
|
"") exit 1 ;;
|
|
0|1 ) exit 1 ;;
|
|
2 ) optNbNodes="" ;;
|
|
[0-9]* ) optNbNodes="-l $nbNodes" ;;
|
|
*) exit 1 ;;
|
|
esac
|
|
|
|
make $binDir/$bin
|
|
cmdLineRun="eval perf $perfOpt $binDir/$bin $optTypeCache $optTypeProd $optNbNodes -n $nbIter"
|
|
echo "On lance : \"$cmdLineRun\""
|
|
beginingDate=`date +%s`
|
|
|
|
( $cmdLineRun 2>&1 || echo "echec experience" ) | eval tee $logFileName
|
|
logFileNameVal="$(eval echo $logFileName)"
|
|
cat $logFileNameVal.perf >> $logFileNameVal
|
|
rm $logFileNameVal.perf
|
|
endDate=`date +%s`
|
|
duration_sec=`expr \( $endDate - $beginingDate \) % 60`
|
|
duration_min=`expr \( $endDate - $beginingDate \) / 60`
|
|
duration_hrs=`expr $duration_min / 60`
|
|
duration_min=`expr $duration_min % 60`
|
|
|
|
echo "Fin de l'experience : `date +'%H:%M:%S (%d/%m/%y)'`"
|
|
echo "La duree est de : ${duration_hrs}hrs ${duration_min}min ${duration_sec}sec"
|
|
echo ""
|
|
}
|
|
|
|
eval echo \"# Describe what this experiment is about: \\\"what are the parameters evaluated?\\\"\" > "$perfDirName/description"
|
|
eval vim "$perfDirName/description"
|
|
|
|
echo -e "On commence les perfs\n"
|
|
globalBeginingDate=`date +%s`
|
|
|
|
for nbNodes in $nbNodesList ; do
|
|
for typeProd in $typeProdList; do
|
|
for typeCache in $typeCacheList ; do
|
|
for bin in $binList ; do
|
|
case $typeProd in
|
|
"useless_loop" )
|
|
for argTypeProd in 1 `seq 5 5 50` ; do
|
|
function_run ;
|
|
done ;;
|
|
"line" )
|
|
for argTypeProd in 1 2 4 8 16 32 64 ; do
|
|
function_run ;
|
|
done ;;
|
|
"matrice" )
|
|
argTypeProd=16 ;
|
|
function_run ;;
|
|
* )
|
|
argTypeProd=1 ;
|
|
function_run ;;
|
|
esac
|
|
done
|
|
done
|
|
done
|
|
done
|
|
|
|
globalEndDate=`date +%s`
|
|
globalDuration_sec=`expr \( $globalEndDate - $globalBeginingDate \) % 60`
|
|
globalDuration_min=`expr \( $globalEndDate - $globalBeginingDate \) / 60`
|
|
globalDuration_hrs=`expr $globalDuration_min / 60`
|
|
globalDuration_min=`expr $globalDuration_min % 60`
|
|
|
|
echo "Fin de la serie d'experience : `date +'%H:%M:%S (%d/%m/%y)'`"
|
|
echo "La duree totale est de : ${globalDuration_hrs}hrs ${globalDuration_min}min ${globalDuration_sec}sec"
|
|
|