blt
blt copied to clipboard
need better support for setting command line flags for mpi tests
Ran into a fun issue in a docker container, openmpi won't let mpiexec run if you are root:
debug/tests/blt_mpi_smoke"
3: Test timeout computed to be: 1500
3: --------------------------------------------------------------------------
3: mpiexec has detected an attempt to run as root.
3:
3: Running as root is *strongly* discouraged as any mistake (e.g., in
3: defining TMPDIR) or bug can result in catastrophic damage to the OS
3: file system, leaving your system in an unusable state.
3:
3: We strongly suggest that you run mpiexec as a non-root user.
3:
3: You can override this protection by adding the --allow-run-as-root
3: option to your command line. However, we reiterate our strong advice
3: against doing so - please do so at your own risk.
3: --------------------------------------------------------------------------
1/1 Test #3: blt_mpi_smoke ....................***Failed 0.00 sec
I tried to insert some extra args into my mpi tests via MPIEXE MPIEXEC_NUM_PROCS_FLAGS, etc but b/c of how we are constructing the test command in blt all attempts failed.
# Handle mpi
if ( ${arg_NUM_MPI_TASKS} )
set(test_command ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${arg_NUM_MPI_TASKS} ${test_command} )
endif()
I think since all of those are discrete args, any injection of spaces undermines us.
CMake's FindMPI also provides:
MPIEXEC_PREFLAGS
MPIEXEC_POSTFLAGS
We should consider using them.