File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -994,8 +994,12 @@ def _initialize_khiops_environment(self):
994994 var_value = ""
995995 else :
996996 continue
997+
998+ if var_name == "KHIOPS_MPI_HOME" :
999+ # Override HOME for OpenMPI 5+
1000+ os .environ ["HOME" ] = var_value
9971001 # Set paths to Khiops binaries
998- if var_name == "KHIOPS_PATH" :
1002+ elif var_name == "KHIOPS_PATH" :
9991003 self .khiops_path = var_value
10001004 os .environ ["KHIOPS_PATH" ] = var_value
10011005 elif var_name == "KHIOPS_COCLUSTERING_PATH" :
Original file line number Diff line number Diff line change @@ -288,6 +288,12 @@ def test_runner_environment_initialization(self):
288288 .. note::
289289 To test a real initialization this test should be executed alone.
290290 """
291+
292+ # Unset HOME to test the automatic fix for OpenMPI 5+
293+ # when initializing the KhiopsLocalRunner environment
294+ if os .environ .get ("KHIOPS_MPI_HOME" ) is not None :
295+ del os .environ ["HOME" ]
296+
291297 # Obtain the current runner
292298 runner = kh .get_runner ()
293299
@@ -304,6 +310,9 @@ def test_runner_environment_initialization(self):
304310 self .assertTrue (os .path .isfile (mpiexec_path ))
305311 self .assertTrue (os .access (mpiexec_path , os .X_OK ))
306312
313+ # Check `HOME` is always set (required for OpenMPI 5+)
314+ self .assertIsNotNone (os .environ .get ("HOME" ))
315+
307316 # Check that runner creation sets `KHIOPS_API_MODE` to `true`
308317 # Store original KHIOPS_API_MODE if any, then delete it from the
309318 # environment if present
You can’t perform that action at this time.
0 commit comments