Skip to content

Commit

Permalink
Add KHIOPS_MPI_VERBOSE in khiops_env (UNIXes only)
Browse files Browse the repository at this point in the history
Add the variable KHIOPS_MPI_VERBOSE to disable the flag "--quiet" in the mpirun command.
Its default value is false and the mpirun is quiet. if it svalue is different from 'true',
'--quiet' is added to the command line.

The environment variable 'OMPI_MCA_orte_execute_quiet' is used instead of the --quiet flag to have a simpler code.
  • Loading branch information
bruno-at-orange committed Oct 14, 2024
1 parent 552beef commit 87358bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packaging/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ if(UNIX)

# replace MPIEXEC MPIEXEC_NUMPROC_FLAG and MPI_IMPL KHIOPS_MPI_EXTRA_FLAG ADDITIONAL_ENV_VAR
if("${MPI_IMPL}" STREQUAL "openmpi")
set(KHIOPS_MPI_EXTRA_FLAG "--allow-run-as-root --quiet")
set(KHIOPS_MPI_EXTRA_FLAG "--allow-run-as-root")
set(KHIOPS_MPI_QUIET "export OMPI_MCA_orte_execute_quiet=true")
set(ADDITIONAL_ENV_VAR "export OMPI_MCA_btl_vader_single_copy_mechanism=none # issue on docker")
if(IS_FEDORA_LIKE)
set(ADDITIONAL_ENV_VAR "${ADDITIONAL_ENV_VAR}\nexport PSM3_DEVICES=self # issue on rocky linux")
Expand Down
11 changes: 11 additions & 0 deletions packaging/linux/common/khiops_env/khiops_env.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ help() {
echo " . set to 'false' to allow local file name selection only with a file selection dialog"
echo "KHIOPS_MPI_HOST_FILE: provide hostfile to mpi."
echo
echo "KHIOPS_MPI_VERBOSE: true or false (default), print messages from mpi (OpenMPI only)."
echo "In case of configuration problems, the variables KHIOPS_JAVA_ERROR and KHIOPS_MPI_ERROR contain error messages."

}
Expand All @@ -64,6 +65,15 @@ get_script_dir() {
@IS_CONDA_VAR@
@SET_KHIOPS_DRIVERS_PATH@

if [ -z "$KHIOPS_MPI_VERBOSE" ]; then
KHIOPS_MPI_VERBOSE="false"
fi

if [ ! "$KHIOPS_MPI_VERBOSE" == "true" ]; then
# Mute mpi by adding flags (OpenMPI only)
@KHIOPS_MPI_QUIET@
fi

# Setting up mpi for multiple machines
if [[ -n $KHIOPS_MPI_HOST_FILE ]]; then
MPI_EXTRA_FLAGS="@MPIEXEC_HOSTFILE_FLAG@ $KHIOPS_MPI_HOST_FILE"
Expand Down Expand Up @@ -106,4 +116,5 @@ if [ "$1" = "--env" ]; then
echo KHIOPS_DRIVERS_PATH "$KHIOPS_DRIVERS_PATH"
echo KHIOPS_JAVA_ERROR "$KHIOPS_JAVA_ERROR"
echo KHIOPS_MPI_ERROR "$KHIOPS_MPI_ERROR"
echo KHIOPS_MPI_VERBOSE "$KHIOPS_MPI_VERBOSE"
fi

0 comments on commit 87358bf

Please sign in to comment.