Skip to content

Provide relative workdir#1672

Merged
shuds13 merged 2 commits intodevelopfrom
feature/container_support
Feb 6, 2026
Merged

Provide relative workdir#1672
shuds13 merged 2 commits intodevelopfrom
feature/container_support

Conversation

@shuds13
Copy link
Member

@shuds13 shuds13 commented Feb 6, 2026

Re: #1671

Replaces %LIBENSEMBLE_SIM_DIR% with relative simulation dir in run line.

Adds environment variable LIBENSEMBLE_SIM_DIR set to this relative dir.

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.31%. Comparing base (4294a4d) to head (1de8c05).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1672      +/-   ##
===========================================
+ Coverage    78.30%   78.31%   +0.01%     
===========================================
  Files           76       76              
  Lines         7582     7591       +9     
  Branches      1120     1120              
===========================================
+ Hits          5937     5945       +8     
  Misses        1460     1460              
- Partials       185      186       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ax3l
Copy link
Collaborator

ax3l commented Feb 6, 2026

Thank you, @shuds13 ! I am trying it now 🚀 ✨

Will report back in a bit!

@ax3l
Copy link
Collaborator

ax3l commented Feb 6, 2026

@shuds13 just checking: is LIBENSEMBLE_SIM_DIR suffixed with a / or plain last dir name? (does not matter a lot, just to know for maximum cleanliness)

@shuds13 shuds13 force-pushed the feature/container_support branch from 1508d18 to 1de8c05 Compare February 6, 2026 23:21
@shuds13
Copy link
Member Author

shuds13 commented Feb 6, 2026

@shuds13 just checking: is LIBENSEMBLE_SIM_DIR suffixed with a / or plain last dir name? (does not matter a lot, just to know for maximum cleanliness)

Just plain last dir name.

@shuds13 shuds13 merged commit 140baf4 into develop Feb 6, 2026
16 checks passed
@ax3l
Copy link
Collaborator

ax3l commented Feb 7, 2026

Awesome, thanks!

"""
sim_dir = os.path.relpath(task.workdir, self.base_dir)
task._add_to_env("LIBENSEMBLE_SIM_DIR", sim_dir)
return [arg.replace(LIBE_SIM_DIR_PLACEHOLDER, sim_dir) for arg in run_cmd]
Copy link
Collaborator

@ax3l ax3l Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if it is applied to late or early or not at all, but my test using commit 140baf4 with

ev_main = TemplateEvaluator(
    sim_template="templates/warpx_input_script",
    analysis_func=analysis_func_main,
    executable="/templates/warpx",
    precedent="podman-hpc exec --workdir /data/%LIBENSEMBLE_SIM_DIR% warpx /opt/entrypoint.sh",
    n_gpus=1,  # GPUs per individual evaluation
    env_mpi="srun",
)

fails to replace it for the run line:

$ pip install -U \
  git+https://github.com/ax3l/optimas.git@fix-app-check-container-bp-0.8.1  \
  git+https://github.com/Libensemble/libensemble.git@140baf438ed55714fffa9660b1a391e935014966

  Running command git clone --filter=blob:none --quiet https://github.com/ax3l/optimas.git /tmp/pip-req-build-idhfo1de
  Running command git checkout -b fix-app-check-container-bp-0.8.1 --track origin/fix-app-check-container-bp-0.8.1
  Switched to a new branch 'fix-app-check-container-bp-0.8.1'
  branch 'fix-app-check-container-bp-0.8.1' set up to track 'origin/fix-app-check-container-bp-0.8.1'.
  Running command git clone --filter=blob:none --quiet https://github.com/Libensemble/libensemble.git /tmp/pip-req-build-cdcrxjz4
  Running command git rev-parse -q --verify 'sha^140baf438ed55714fffa9660b1a391e935014966'
  Running command git fetch -q https://github.com/Libensemble/libensemble.git 140baf438ed55714fffa9660b1a391e935014966
  Running command git checkout -q 140baf438ed55714fffa9660b1a391e935014966
[0]  2026-02-06 16:22:33,455 libensemble.libE (INFO): Logger initializing: [workerID] precedes each line. [0] = Manager
[0]  2026-02-06 16:22:33,456 libensemble.libE (INFO): libE version v1.5.0+dev
[0]  2026-02-06 16:22:33,460 libensemble.manager (INFO): Manager exit_criteria: {'sim_max': 1}
[1]  2026-02-06 16:22:40,313 libensemble.executors.mpi_executor (INFO): Launching task libe_task_sim_0_worker1_0: srun -w nid001508 --ntasks 1 --nodes 1 --ntasks-per-node 1 --exact podman-hpc exec --workdir /data/%LIBENSEMBLE_SIM_DIR%/ warpx /opt/entrypoint.sh prepare_simulation.py
...

->

Error: crun: chdir to `/data/%LIBENSEMBLE_SIM_DIR%/`: No such file or directory: OCI runtime attempted to invoke a command that was not found

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will need to look more next week, maybe wrong place. But in the submit function, I can do this (just adding a precendent) in Optimas test_template_evaluator.py.

        print(f'runline 1: {runline}')
        runline = self._set_sim_dir_env(task, runline)
        task.runline = " ".join(runline)

        print(f'runline 2: {runline}')

Output:

runline 1: ['mpirun', '-hosts', 'shuds', '-np', '1', '--ppn', '1', 'podman-hpc', 'exec', '--workdir', '/data/%LIBENSEMBLE_SIM_DIR%', 'warpx', '/opt/entrypoint.sh', 'template_simulation_script.py']
runline 2: ['mpirun', '-hosts', 'shuds', '-np', '1', '--ppn', '1', 'podman-hpc', 'exec', '--workdir', '/data/tests_output/test_template_evaluator/evaluations/sim0005', 'warpx', '/opt/entrypoint.sh', 'template_simulation_script.py']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants