Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make LearningTestTool Able to Use khiops_env if Requested #406

Open
popescu-v opened this issue Oct 11, 2024 · 3 comments
Open

Make LearningTestTool Able to Use khiops_env if Requested #406

popescu-v opened this issue Oct 11, 2024 · 3 comments
Labels
Priority/1 To do after P0 Size/Hours very short

Comments

@popescu-v
Copy link
Collaborator

Description

Currently, kht_test.py in LearningTestTool/py does not use the settings in khiops_env.
This entails that, in order to make sure that LearningTestTool tests Khiops in (real) user-like conditions, LearningTestTool needs to replicate khiops_env settings.

For example, to match the export MPICH__INTERFACE_HOSTNAME=localhost command in khiops_env on MacOS, kht_test.py needs to detect the "Darwin" platform and replicate khiops_env behavior by adding the -host localhost options to mpiexec, which achieve the same effect (related issue on this point: #401).

The goal of this issue is to make LearningTestTool launchable in two modes:

  1. a "dev" mode, which keeps the current behavior; usable:
    • by Khiops core developers, and
    • in the standard CI tests which use the MODL* binaries directly
  2. a "package" / "release" mode, which executes khiops_env --env to read the MPI command (and other settings); usable:
    • in the packaging CI tests (for all platforms)
    • in the LearningTest full tests.

Context

  • Khiops version: >= 10.2.3
  • Scenario file (use khiops -o scenario._kh): Any
  • OS description (use khiops -s): All supported
@lucaurelien lucaurelien added Priority/1 To do after P0 Size/Hours very short Size/Days Some days of work and removed Size/Hours very short Size/Days Some days of work labels Oct 17, 2024
@popescu-v
Copy link
Collaborator Author

It suffices to add a --environment option that gives the path to the desired khiops_env.

@marcboulle
Copy link
Collaborator

Alternative simple: réutiliser le paramètre existant binaries pour y cherche le khiops_env en priorité, et si non trouvé se rabattre sur la recherche des binaires comme actuellement

@popescu-v
Copy link
Collaborator Author

popescu-v commented Oct 31, 2024

Alternative simple: réutiliser le paramètre existant binaries pour y cherche le khiops_env en priorité, et si non trouvé se rabattre sur la recherche des binaires comme actuellement

Indeed, we can reuse this parameter as follows:

  • if khiops_env is found in the binaries directory, then the paths to the Khiops MODL_* and MODL_Coclustering binaries can be updated according to the values of the KHIOPS_PATH and KHIOPS_COCLUSTERING_PATH environment variables, respectively;
  • otherwise, the current behavior is kept.

Concretely, the changes would need to be done in the kht_test.py / build_tool_exe_path function, in the form of an if / else test on the existence of khiops_env in the tool_binaries_dir directory:

  • if khiops_env is found inside tool_binaries_dir, then:
    • if tool_name equals KHIOPS, then assign tool_exe_path the value of KHIOPS_PATH;
    • else, if tool_name equals COCLUSTERING, then assign tool_exe_path the value of KHIOPS_COCLUSTERING_PATH;
      accessorily:
    • check whether these paths actually exist and update error_message accordingly if at least one of them does not;
    • update os.environ according to the output of tool_binaries_dir/khiops_env --env;
      • then, the os.environ["KHIOPS_MPI_COMMAND"]" would need to be used in the kht_test.py / evaluate_tool_on_test_dir function in order to update khiops_params; also, the other updates of os.environ with the various MPI-specific variables could be removed;
  • else, keep the current behavior unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority/1 To do after P0 Size/Hours very short
Projects
None yet
Development

No branches or pull requests

3 participants