File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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,10 @@ 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+ del os .environ ["HOME" ]
294+
291295 # Obtain the current runner
292296 runner = kh .get_runner ()
293297
@@ -304,6 +308,9 @@ def test_runner_environment_initialization(self):
304308 self .assertTrue (os .path .isfile (mpiexec_path ))
305309 self .assertTrue (os .access (mpiexec_path , os .X_OK ))
306310
311+ # Check `HOME` is always set (required for OpenMPI 5+)
312+ self .assertIsNotNone (os .environ ["HOME" ])
313+
307314 # Check that runner creation sets `KHIOPS_API_MODE` to `true`
308315 # Store original KHIOPS_API_MODE if any, then delete it from the
309316 # environment if present
You can’t perform that action at this time.
0 commit comments