Skip to content

Commit

Permalink
add script for sweeping throught multiple problem sizes in parthenon …
Browse files Browse the repository at this point in the history
…strong scaling
  • Loading branch information
Galen M. Shipman authored and Galen M. Shipman committed Mar 17, 2024
1 parent 88c9d6e commit 8833512
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions utils/parthenon/do_strong_scaling_cpu_sweep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

set +x
set +e

FOOTPRINT=$1

#BEGIN Do not change the following for official benchmarking
NXB=16
NLIM=250
NLVL=3
#END

NXs=(64 128 160)

EXEC=./burgers-benchmark # executable
INP=../../../benchmarks/burgers/burgers.pin

# loop
for NX in ${NXs[@]}; do
i=0
IDEAL1=0
TIMING_FILE_NAME="cpu_${NX}.csv"
HEADER="No. Cores, Actual, Ideal"
echo "Saving timing to ${TIMING_FILE_NAME}"
echo "${HEADER}"
echo "${HEADER}" > ${TIMING_FILE_NAME}

for count in 8 32 56 88 112; do
echo "Core count = ${count}"
L=`echo "((${NX}^3)/(${NXB}^3)) >= ${count}" | bc -l`
if (($L == 0)); then
continue;
fi
outfile=$(printf "strong-scale-%d-%d.out" ${NX} ${count})
errfile=$(printf "strong-scale-%d-%d.err" ${NX} ${count})
echo "saving to output file ${outfile}"
ARGS="${EXEC} -i ${INP} parthenon/mesh/nx1=${NX} parthenon/mesh/nx2=${NX} parthenon/mesh/nx3=${NX} parthenon/meshblock/nx1=${NXB} parthenon/meshblock/nx2=${NXB} parthenon/meshblock/nx3=${NXB} parthenon/time/nlim=${NLIM} parthenon/mesh/numlevel=${NLVL}"
CMD="srun -n ${count} --hint=nomultithread -o ${outfile} -e ${errfile} ${ARGS}"
echo ${CMD}
${CMD}
wait
zc=$(grep 'zone-cycles/wallsecond = ' ${outfile} | cut -d '=' -f 2 | xargs)
echo ${zc}
if (( ${i} == 0 )); then
IDEAL1=$(echo "print(\"%.7e\" % (${zc}/${count}))" | python3)
fi
IDEAL=$(echo "print(\"%.7e\" % (${count}*${IDEAL1}))" | python3)
OUTSTR="${count}, ${zc}, ${IDEAL}"
echo "${OUTSTR}"
echo "${OUTSTR}" >> ${TIMING_FILE_NAME}
i=$((${i} + 1))
done
done

0 comments on commit 8833512

Please sign in to comment.