Skip to content

Commit

Permalink
S. Riette 26 Apr 2024: enable testprogs perf measurements with GPU on…
Browse files Browse the repository at this point in the history
… belenos
  • Loading branch information
SebastienRietteMTO committed Apr 26, 2024
1 parent c01cf7e commit afa84fe
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
2 changes: 2 additions & 0 deletions build/with_fcm/arch/arch-pgi_CPU_preGPU_MFflavour.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ if [ $(hostname | cut -c 1-7) == 'belenos' -o \
module load nvhpc-hpcx-cuda12/24.3
fi

NPOINTS_perf=20480 #5120*4

#stackMode can be AROME or MESONH
#if stackMode is AROME, we must use the -fcray-pointer compilation option with gfortran
# and the compilation key USE_STACK must be set in the .fcm file
Expand Down
10 changes: 5 additions & 5 deletions src/testprogs/testprogs_version.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"testing": {
"ice_adjust":"c175590",
"rain_ice":"c175590",
"rain_ice_old":"c175590",
"turb":"c175590",
"shallow":"c175590"
"ice_adjust":"c01cf7e",
"rain_ice":"c01cf7e",
"rain_ice_old":"c01cf7e",
"turb":"c01cf7e",
"shallow":"c01cf7e"
}
}
16 changes: 11 additions & 5 deletions tools/check_commit_testprogs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ i=$((i+1)); conf_extra_tag[$i]="_Z120_NPRO32_BLK256_TIMES4"
i=$((i+1)); conf_extra_tag[$i]="_Z120_NPRO32_BLK64_TIMES16"
conf_extra_opts[$i]="--nflevg 120 --nproma 32 --blocks 64 --times 16"
#The following case is the one used for performance evaluation, it must remains the 4th one
i=$((i+1)); conf_extra_tag[$i]='_Z120_NPRO${NPROMA}_BLK${NBLOCKS}'
conf_extra_opts[$i]='--nflevg 120 --nproma ${NPROMA} --blocks ${NBLOCKS}'
i=$((i+1)); conf_extra_tag[$i]='_Z120_NPRO${NPROMA}_BLK${NBLOCKS}_TIMES${NTIMES}'
conf_extra_opts[$i]='--nflevg 120 --nproma ${NPROMA} --blocks ${NBLOCKS} --times ${NTIMES}'


################################
Expand Down Expand Up @@ -514,14 +514,20 @@ if [ $run -ge 1 -a "$perffile" != "" ]; then

if [ $firstrun -eq 1 ]; then
firstrun=0
#Read prefered NPROMA for performance evaluation
#Read prefered NPROMA and maximum number of points for performance evaluation
. $TESTDIR/$name/build/with_fcm/arch_${archfile}/arch.env

#Experiement size
NPOINTS=100000
if [ ${NPOINTS_perf-${NPOINTS}} -lt ${NPOINTS} ]; then
NTIMES=$(python3 -c "print(round(${NPOINTS}/${NPOINTS_perf}))")
NPOINTS=${NPOINTS_perf}
else
NTIMES=1
fi
NPROMA=${NPROMA_perf-32}
NBLOCKS=$(($NPOINTS/$NPROMA/8*8)) #must be divisible by 8
perf_extrapolation_tag=$(NPROMA=$NPROMA; NBLOCKS=$NBLOCKS; eval echo ${conf_extra_tag[4]})
perf_extrapolation_tag=$(NPROMA=$NPROMA; NBLOCKS=$NBLOCKS; NTIMES=$NTIMES; eval echo ${conf_extra_tag[4]})

#Cleaning to suppress old results that may be confusing in case of a crash during the run
if [ $onlyIfNeeded -eq 0 ]; then
Expand All @@ -533,7 +539,7 @@ if [ $run -ge 1 -a "$perffile" != "" ]; then
fi
fi

NPROMA=$NPROMA NBLOCKS=$NBLOCKS OMP_NUM_THREADS=8 $0 -r -t $t -a ${archfile} --no-check -e 4 ${commit}
NPROMA=$NPROMA NBLOCKS=$NBLOCKS NTIMES=$NTIMES OMP_NUM_THREADS=8 $0 -r -t $t -a ${archfile} --no-check --no-perf -e 4 ${commit}
file=$TESTDIR/$name/tests/with_fcm/arch_${archfile}/${t}${perf_extrapolation_tag}/Output_run
if [ -f $file ]; then
ZTD=$(grep -m 1 "ZTD =" $file | awk '{print $4}')
Expand Down
18 changes: 8 additions & 10 deletions tools/testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function usage {
echo "Usage: $0 [-h] [--repo-user USER] [--repo-protocol PROTOCOL] [--repo-repo REPO] [--no-update] [--no-compil]"
echo " [--no-exec] [--no-comp] [--no-remove] [--force] [--commit SHA] [--ref REF]"
echo " [--only-model MODEL] [--no-enable-gh-pages] [--perf PERF] [--no-doc-gen]"
echo " [--hostname HOSTNAME] [MAIL]"
echo " [--hostname HOSTNAME] [--mail MAIL]"
echo "--repo-user USER"
echo " user hosting the PHYEX repository on github,"
echo " defaults to the env variable PHYEXREPOuser (=$PHYEXREPOuser)"
Expand All @@ -34,7 +34,9 @@ function usage {
echo "--hostname HOSTNAME"
echo " the context is built using the provided hostname instead of the real hostname"
echo " This can be usefull when running on a cluster node which can vary from run to run"
echo "MAIL comma-separated list of e-mail addresses (no spaces); if not provided, mail is not sent"
echo "--mail MAIL comma-separated list of e-mail addresses (no spaces); if not provided, mail is not sent"
echo ""
echo "Unrecognized options are given to the check_commit scripts."
echo ""
echo "This script provides functionality for automated tests."
echo "It can be run with cron to periodically test the last commit on the PHYEX repository"
Expand Down Expand Up @@ -72,6 +74,7 @@ enableghpages=1
perfopt=""
docgen=1
contextHostname=${HOSTNAME}
checkCommitOptions=""

allargs="$@"
while [ -n "$1" ]; do
Expand All @@ -93,13 +96,8 @@ while [ -n "$1" ]; do
'--perf') perfopt="--perf $2"; shift;;
'--no-doc-gen') docgen=0;;
'--hostname') contextHostname=$2; shift;;
#--) shift; break ;;
*) if [ -z "${MAIL-}" ]; then
MAIL="$1"
else
echo "Only one email address allowed"
exit 1
fi;;
'--mail') MAIL=$2; shift;;
*) checkCommitOptions="$checkCommitOptions $1";;
esac
shift
done
Expand Down Expand Up @@ -325,7 +323,7 @@ if [ ${force} -eq 1 -o $(get_statuses "${SHA}" | grep "${context}" | wc -l) -eq
fi

#Commande
cmd="check_commit_${model}.sh --repo-user ${PHYEXREPOuser} --repo-protocol ${PHYEXREPOprotocol} ${SHA}"
cmd="check_commit_${model}.sh --repo-user ${PHYEXREPOuser} --repo-protocol ${PHYEXREPOprotocol} ${checkCommitOptions} ${SHA}"

#Compilation
result=0
Expand Down

0 comments on commit afa84fe

Please sign in to comment.