Skip to content

Commit

Permalink
Honor recent MPI command simplifications in upstream Khiops binary pa…
Browse files Browse the repository at this point in the history
…ckages

Thusly, functional parity is kept with the `khiops-env` script which is
part of the native Khiops binary packages.

closes #192
  • Loading branch information
popescu-v committed Jun 20, 2024
1 parent 5e1315f commit 8d1eb3d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions khiops/core/internals/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,13 +1155,13 @@ def _initialize_mpi_command_args(self):
break
if mpiexec_path is not None:
self._set_mpi_command_args_with_mpiexec(
mpiexec_path
mpiexec_path, installation_method
)
break

# If MPI is found, then set the path to mpiexec accordingly
if mpiexec_path is not None:
self._set_mpi_command_args_with_mpiexec(mpiexec_path)
self._set_mpi_command_args_with_mpiexec(mpiexec_path, installation_method)
# If MPI is still not found, then do not use MPI and warn the user
else:
self.mpi_command_args = []
Expand All @@ -1171,7 +1171,7 @@ def _initialize_mpi_command_args(self):
"Go to https://khiops.org for more information."
)

def _set_mpi_command_args_with_mpiexec(self, mpiexec_path):
def _set_mpi_command_args_with_mpiexec(self, mpiexec_path, installation_method):
assert mpiexec_path is not None
# User-specified MPI command args take precendence over automatic setting
if "KHIOPS_MPI_COMMAND_ARGS" in os.environ:
Expand Down Expand Up @@ -1199,11 +1199,10 @@ def _set_mpi_command_args_with_mpiexec(self, mpiexec_path):
"1",
]
elif platform.system() == "Linux":
# OpenMPI
if installation_method == "binary+pip":
self.mpi_command_args.append("--quiet")
self.mpi_command_args += [
"-bind-to",
"hwthread",
"-map-by",
"core",
"-n",
str(self.max_cores),
]
Expand Down

0 comments on commit 8d1eb3d

Please sign in to comment.