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

Allow launching simulations in a different environment #108

Merged
merged 17 commits into from
Oct 9, 2023

Conversation

AngelFP
Copy link
Member

@AngelFP AngelFP commented Aug 3, 2023

Some simulation codes might have to be installed (and therefore executed) in a different environment than optimas (e.g., due to different dependencies, MPI version, etc). This PR allows the TemplateEvaluator to launch simulations in their own environments if an env_script is provided (a new feature in libEnsemble 0.10). This is a shell script that loads the required environment.

If the environment of the simulation uses a different MPI than optimas, this should be specified by indicating a env_mpi.

As an example, this would be the template evaluator for running simulations with a version of HiPACE that requires a different environment and which uses openpmi.

ev = TemplateEvaluator(
    sim_template='template_simulation_script',
    analysis_func=analyze_simulation,
    executable='/path/to/build/bin/hipace',
    n_gpus=2,
    env_script='/path/to/profile.hipace',
    env_mpi='openmpi'
)

The PR also adds a HiPACE example that exposes these options if needed.

@AngelFP AngelFP force-pushed the support_evaluator_env branch from 9ec2fe9 to b56ebf4 Compare September 14, 2023 21:48
@AngelFP AngelFP added the enhancement New feature or request label Sep 27, 2023
@RemiLehe RemiLehe merged commit 7bfcd89 into main Oct 9, 2023
8 checks passed
@AngelFP AngelFP deleted the support_evaluator_env branch October 10, 2023 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants