From ae638c2b9cdff28ef137a2edf35f3e23e4e07e67 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 10 Mar 2025 11:01:49 +0100 Subject: [PATCH] CONFIG: improvements to mpirunDebug - the '-no-core' to limit coredumps to zero size - the '-quick' option, which changes valgrind --leak-check from "full" to "summary", and implies -no-core as well. - enforce tcp libfabrics provider under valgrind since valgrind does not otherwie work nicely with RMA --- bin/mpirunDebug | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/bin/mpirunDebug b/bin/mpirunDebug index 042edb013a..9d4197c0e1 100755 --- a/bin/mpirunDebug +++ b/bin/mpirunDebug @@ -43,6 +43,8 @@ options: -local Same as -spawn=1 -remote Same as -spawn=2 -clean Remove log and startup files + -no-core Restrict core dump to 0 size + -quick Valgrind with 'summary' (not 'full') and use -no-core -decompose-dict= Specific decomposeParDict name -help Print the usage @@ -108,8 +110,9 @@ Linux) esac unset appName appArgs nProcs -unset method spawn optClean optValue +unset method spawn optClean optValue opt_nocore optConfirm=true +opt_leakcheck=full decompDict="system/decomposeParDict" @@ -153,6 +156,15 @@ do : "${spawn:=local}" ;; + -quick) + opt_leakcheck="summary" + opt_nocore=true + ;; + + -no-core) + opt_nocore=true + ;; + -valgr*) method="valgrind" unset optConfirm @@ -338,12 +350,16 @@ fi case "$sourceFoam" in */bashrc) - sourceFoam=". $sourceFoam $FOAM_SETTINGS" + sourceFoam=". $sourceFoam $FOAM_SETTINGS || true" ;; esac echo "**sourceFoam: $sourceFoam" 1>&2 +# remove old files +rm -rf ./mpirun.files +rm -rf ./mpirun.log + mkdir -p ./mpirun.files mkdir -p ./mpirun.log @@ -375,6 +391,12 @@ $sourceFoam cd "${PWD}" || exit COMMANDS + if [ "$opt_nocore" = true ] + then + echo "# no coredump" >> "$procCmdFile" + echo "ulimit -c 0 2>/dev/null" >> "$procCmdFile" + fi + # Add to the mpirun.schema case "$method" in (*xterm*) echo "${node}${xterm} -e ${procCmdFile}" >> "$schema_file" ;; @@ -400,10 +422,16 @@ COMMANDS echo "read input" ;; (valgrind | valgrind-log) - echo "valgrind --leak-check=full --show-reachable=yes $exec $appArgs > $procLog 2>&1" + echo "# valgrind does not work nicely with RMA (libfabric)" + echo "export FI_PROVIDER=tcp" + echo + echo "valgrind --leak-check=$opt_leakcheck --show-reachable=yes $exec $appArgs > $procLog 2>&1" ;; (valgrind-xterm) - echo "valgrind --leak-check=full --show-reachable=yes $exec $appArgs 2>&1 | tee $procLog" + echo "# valgrind does not work nicely with RMA (libfabric)" + echo "export FI_PROVIDER=tcp" + echo + echo "valgrind --leak-check=$opt_leakcheck --show-reachable=yes $exec $appArgs 2>&1 | tee $procLog" echo "read input" ;; (gperf)