From 2d75ea171b00bcd9ff9ef149e50873122cddd0a9 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Mon, 22 May 2023 12:15:28 +0200 Subject: [PATCH 1/3] It looks like this test does not really use MPI (#942) --- regtest/multicolvar/rt-link/config | 1 - regtest/multicolvar/rt-link/main.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/regtest/multicolvar/rt-link/config b/regtest/multicolvar/rt-link/config index abdecb652a..df1f95bf3e 100644 --- a/regtest/multicolvar/rt-link/config +++ b/regtest/multicolvar/rt-link/config @@ -1,2 +1 @@ -mpiprocs=2 type=make diff --git a/regtest/multicolvar/rt-link/main.cpp b/regtest/multicolvar/rt-link/main.cpp index 15702c0f00..5e3a505eac 100644 --- a/regtest/multicolvar/rt-link/main.cpp +++ b/regtest/multicolvar/rt-link/main.cpp @@ -1,4 +1,3 @@ -#include "mpi.h" #include "plumed/tools/Communicator.h" #include "plumed/tools/Tools.h" #include "plumed/tools/Vector.h" From 92609aee6ed13880e095196987866dbf96a2bbcf Mon Sep 17 00:00:00 2001 From: Giovanni Bussi Date: Mon, 22 May 2023 12:28:48 +0200 Subject: [PATCH 2/3] Removed useless command I think this remained from previous versions. --- regtest/scripts/run | 1 - 1 file changed, 1 deletion(-) diff --git a/regtest/scripts/run b/regtest/scripts/run index 4d3915fef4..60bd0b91cb 100755 --- a/regtest/scripts/run +++ b/regtest/scripts/run @@ -194,7 +194,6 @@ case "$type" in $mpi $valgrind $plumed sum_hills $arg > out 2> err ;; (make) - $plumed info --configuration > Makefile.conf $plumed --is-installed || ln -s "$root/src" plumed if test "$plumed_language" = fortran || test "$plumed_language" = fortran08 || test "$plumed_language" = c ; then cat <($plumed info --configuration) "$root/src/lib/Plumed.inc.shared" ../../../scripts/exe.make > Makefile From 95cc6ebff9b668138dd352bb08e4b8959173ce8c Mon Sep 17 00:00:00 2001 From: Giovanni Bussi Date: Mon, 22 May 2023 14:09:13 +0200 Subject: [PATCH 3/3] Made plumed calls in regtests more robust The executable called to inspect the configuration should always be called with the --no-mpi option. This solves the rockylinux problems reported here: https://github.com/plumed/plumed2/pull/933#issuecomment-1556302511 --- regtest/scripts/run | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/regtest/scripts/run b/regtest/scripts/run index 60bd0b91cb..375438458d 100755 --- a/regtest/scripts/run +++ b/regtest/scripts/run @@ -58,9 +58,14 @@ echo "++ Arguments: $arg" echo "++ Processors: $mpiprocs" mpi=env + +# this is the executable used for running the tests: plumed="${PLUMED_PROGRAM_NAME:-plumed}" -root=$($plumed --no-mpi info --root) +# this is the executable used for getting the configuration: +plumed_nompi="$plumed --no-mpi" + +root=$($plumed_nompi info --root) if test -z "$root" ; then echo "FAILURE: plumed executable not available" @@ -76,16 +81,16 @@ cd - if ((mpiprocs>0)); then mpi="" -if $plumed --no-mpi config -q mpiexec +if $plumed_nompi config -q mpiexec then - mpi="$($plumed --no-mpi config mpiexec)" + mpi="$($plumed_nompi config mpiexec)" fi if test -z "$mpi" ; then mpi="${PLUMED_MPIRUN:-mpirun}" fi mpi="$mpi -np $mpiprocs" -if ! $plumed config -q has mpi +if ! $plumed_nompi config -q has mpi then if [ "$TRAVIS" = true ] || [ "$GITHUB_ACTIONS" = true ] ; then if [ -z "$PLUMED_ALLOW_SKIP_ON_TRAVIS" ] ; then @@ -122,7 +127,7 @@ fi for need in $plumed_needs do echo "Checking for $need" - if ! $plumed config -q has $need + if ! $plumed_nompi config -q has $need then if [ "$TRAVIS" = true ] || [ "$GITHUB_ACTIONS" = true ] ; then if [ -z "$PLUMED_ALLOW_SKIP_ON_TRAVIS" ] ; then @@ -140,7 +145,7 @@ done for module in $plumed_modules do echo "Checking for $module" - if ! $plumed config -q module $module + if ! $plumed_nompi config -q module $module then if [ "$TRAVIS" = true ] || [ "$GITHUB_ACTIONS" = true ] ; then if [ -z "$PLUMED_ALLOW_SKIP_ON_TRAVIS" ] ; then @@ -170,10 +175,10 @@ if type -t plumed_custom_skip 1>/dev/null ; then fi fi -if $plumed --is-installed ; then - export PLUMED_KERNEL="$root/../lib${PLUMED_PROGRAM_NAME:-plumed}Kernel.$($plumed info --soext)" +if $plumed_nompi --is-installed ; then + export PLUMED_KERNEL="$root/../lib${PLUMED_PROGRAM_NAME:-plumed}Kernel.$($plumed_nompi info --soext)" else - export PLUMED_KERNEL="$root/src/lib/libplumedKernel.$($plumed info --soext)" + export PLUMED_KERNEL="$root/src/lib/libplumedKernel.$($plumed_nompi info --soext)" fi if type -t plumed_regtest_before 1>/dev/null ; then plumed_regtest_before @@ -194,11 +199,11 @@ case "$type" in $mpi $valgrind $plumed sum_hills $arg > out 2> err ;; (make) - $plumed --is-installed || ln -s "$root/src" plumed + $plumed_nompi --is-installed || ln -s "$root/src" plumed if test "$plumed_language" = fortran || test "$plumed_language" = fortran08 || test "$plumed_language" = c ; then - cat <($plumed info --configuration) "$root/src/lib/Plumed.inc.shared" ../../../scripts/exe.make > Makefile + cat <($plumed_nompi info --configuration) "$root/src/lib/Plumed.inc.shared" ../../../scripts/exe.make > Makefile else - cat <($plumed info --configuration) "$root/src/lib/Plumed.inc.static" ../../../scripts/exe.make > Makefile + cat <($plumed_nompi info --configuration) "$root/src/lib/Plumed.inc.static" ../../../scripts/exe.make > Makefile fi if test "$plumed_language" = fortran || test "$plumed_language" = fortran08 ; then if make print-fortran | grep "FC=$" 1>/dev/null ; then @@ -270,7 +275,7 @@ EOF ;; (python) # make sure the right python module is in the path based on plumed root - PYTHONPATH="$root/python:$PYTHONPATH" $($plumed config python_bin) $arg > out 2> err + PYTHONPATH="$root/python:$PYTHONPATH" $($plumed_nompi config python_bin) $arg > out 2> err ;; (*) echo "FAILURE: unknown test type" ; exit 1 ;; esac