Closed climbfuji closed 2 years ago
This is not a ecbuild issue per se. I usually solve it with https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html To do this:
echo 'srun -n 1 "$''@"' > serial_run
chmod 755 serial_run
Then configure (or reconfigure) with
cmake . -DCMAKE_CROSSCOMPILING_EMULATOR=${PWD}/serial_run -DMPIEXEC_EXECUTABLE="/usr/bin/srun" -DMPIEXEC_NUMPROC_FLAG="-n"
Now ctest
should work.
Following simpler approach will also work as of cmake 3.15:
cmake . -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/srun;-n;1 -DMPIEXEC_EXECUTABLE="/usr/bin/srun" -DMPIEXEC_NUMPROC_FLAG="-n"
Thanks @wdeconinck, I will try that and report back. I also asked the sysadmins on Gaea if they can change their system settings so that this won't be needed.
@wdeconinck Finally got around to test your suggestion, and it works fine. Closing this issue.
We've come across an unusual system where you can't run an executable that was compiled with an MPI wrapper without
srun
, even if you want to execute it as a non-MPI (serial, 1 process) application.For this, it would be nice to be able to launch serial jobs through a wrapper, similar to how MPI jobs are launched. I made the following changes for the latest ecbuild code in this repository:
https://github.com/ecmwf/ecbuild/compare/develop...climbfuji:feature/serexec
I then used
and it worked like a charm.
I am happy to issue a pull request and, if so desired, change the names of the new flags (e.g. one could use
-DSEREXEC_EXECUTABLE
and-DSEREXEC_NUMPROC_FLAG
or something else ifSEREXEC
sounds bad).If there is already a solution in place that I haven't seen (I read through the entire file
cmake/ecbuild_add_test.cmake
), then please let me know.