Skip to content

[Documentation] Add notebook to explain the HPC setup#1008

Merged
jan-janssen merged 4 commits into
mainfrom
slurmdoc
Jun 10, 2026
Merged

[Documentation] Add notebook to explain the HPC setup#1008
jan-janssen merged 4 commits into
mainfrom
slurmdoc

Conversation

@jan-janssen

@jan-janssen jan-janssen commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Documentation
    • Enhanced HPC cluster guide with comprehensive SLURM sections including workflows, key directives, and MPI-parallel examples; expanded SlurmClusterExecutor usage patterns; detailed Flux resource assignment scenarios; combined executor strategies; and cache management best practices.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1f0a33b4-4eba-4601-a514-2b19ceebd44b

📥 Commits

Reviewing files that changed from the base of the PR and between 6912822 and a76b1c7.

📒 Files selected for processing (1)
  • notebooks/2-hpc-cluster.ipynb

📝 Walkthrough

Walkthrough

The HPC cluster executor notebook is substantially expanded and refreshed. It now includes complete SLURM background sections with MPI examples, SlurmClusterExecutor configuration documentation, enhanced Flux resource assignment and GPU examples, combined executor workflows, and cache management guidance, with updated execution outputs reflecting current behavior.

Changes

HPC Cluster Documentation

Layer / File(s) Summary
HPC cluster executors notebook refresh
notebooks/2-hpc-cluster.ipynb
Notebook expands SLURM coverage (background, directives, MPI example), documents SlurmClusterExecutor and FluxClusterExecutor configuration, demonstrates resource assignment and GPU usage, combines multiple executor types, and provides cache cleanup examples. Execution metadata and outputs are updated to reflect current executor behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • pyiron/executorlib#610: Overwrites notebooks/2-hpc-cluster.ipynb with FluxClusterExecutor changes and updated outputs; this PR further expands it to include SLURM content and additional executor combinations.
  • pyiron/executorlib#784: Modifies SLURM cluster section examples and outputs in the same notebook; overlaps in SlurmClusterExecutor demonstration content.

Poem

🐰 A notebook now blooms with HPC delight,
SLURM workflows and Flux burn so bright,
MPI tasks dance in parallel grace,
Executors combined run the race,
Cached clusters cleaned up just right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a new documentation notebook explaining HPC setup, particularly focusing on schedulers and executorlib integration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch slurmdoc

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Ruff (0.15.15)
notebooks/2-hpc-cluster.ipynb

Unexpected end of JSON input


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jan-janssen
jan-janssen marked this pull request as draft June 10, 2026 08:51
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.19%. Comparing base (4396b94) to head (a76b1c7).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1008   +/-   ##
=======================================
  Coverage   94.19%   94.19%           
=======================================
  Files          39       39           
  Lines        2103     2103           
=======================================
  Hits         1981     1981           
  Misses        122      122           

☔ View full report in Codecov by Harness.
📢 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
notebooks/0-hpc-schedulers.ipynb (1)

1-411: ⚖️ Poor tradeoff

Consider adding this notebook to the CI test suite.

The CI pipeline currently executes notebooks 1, 2, 3, and 5 via papermill but does not include 0-hpc-schedulers.ipynb. While this notebook is documentation-focused, adding it to the CI pipeline would help catch errors in the example code snippets (such as the missing pmi_mode parameter flagged above).

If you choose to add CI coverage, insert this line in .github/workflows/pipeline.yml after line 176:

papermill notebooks/0-hpc-schedulers.ipynb notebooks/0-hpc-schedulers-out.ipynb -k python3

Note: The current examples would need to be wrapped in proper code cells (rather than markdown code blocks) for papermill execution.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@notebooks/0-hpc-schedulers.ipynb` around lines 1 - 411, The CI is not running
notebooks/0-hpc-schedulers.ipynb so example code (e.g. MPI usage with pmi_mode)
isn't validated; add the notebook to the pipeline and make its runnable examples
real code cells. Update the workflow by inserting a papermill step that runs
"notebooks/0-hpc-schedulers.ipynb" (producing
notebooks/0-hpc-schedulers-out.ipynb) into .github/workflows/pipeline.yml (after
the existing papermill calls), and edit notebooks/0-hpc-schedulers.ipynb to
convert the markdown fenced code blocks (examples like the SlurmClusterExecutor,
SlurmJobExecutor, FluxClusterExecutor usage and mpi_calc/mpi_calc snippets that
reference pmi_mode and cores) into executable code cells so papermill can
execute them during CI.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@notebooks/0-hpc-schedulers.ipynb`:
- Around line 372-376: The MPI example fails because FluxClusterExecutor is
missing the pmi_mode parameter; update the example to construct the executor
with pmi_mode="pmix" (i.e., use FluxClusterExecutor(cache_directory="./cache",
pmi_mode="pmix")) so that MPI is initialized for mpi_calc, and keep the
resource_dict with "cores": N as shown; modify the example where
FluxClusterExecutor and the call exe.submit(mpi_calc, ...) appear to include
this parameter.
- Around line 108-110: The sacct --format field uses the wrong case; replace the
incorrect "AllocCPUS" with SLURM's documented "alloccpus" in the sacct
invocation string (the snippet calling sacct -j 12345
--format=JobID,State,AllocCPUS,Elapsed). Edit that sacct line so it reads
--format=JobID,State,alloccpus,Elapsed to match SLURM's expected field name.

---

Nitpick comments:
In `@notebooks/0-hpc-schedulers.ipynb`:
- Around line 1-411: The CI is not running notebooks/0-hpc-schedulers.ipynb so
example code (e.g. MPI usage with pmi_mode) isn't validated; add the notebook to
the pipeline and make its runnable examples real code cells. Update the workflow
by inserting a papermill step that runs "notebooks/0-hpc-schedulers.ipynb"
(producing notebooks/0-hpc-schedulers-out.ipynb) into
.github/workflows/pipeline.yml (after the existing papermill calls), and edit
notebooks/0-hpc-schedulers.ipynb to convert the markdown fenced code blocks
(examples like the SlurmClusterExecutor, SlurmJobExecutor, FluxClusterExecutor
usage and mpi_calc/mpi_calc snippets that reference pmi_mode and cores) into
executable code cells so papermill can execute them during CI.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 99aebe2c-a56d-42e6-b098-60bff540d071

📥 Commits

Reviewing files that changed from the base of the PR and between 4396b94 and 6912822.

📒 Files selected for processing (2)
  • docs/_toc.yml
  • notebooks/0-hpc-schedulers.ipynb

Comment thread notebooks/0-hpc-schedulers.ipynb Outdated
Comment thread notebooks/0-hpc-schedulers.ipynb Outdated
Comment on lines +372 to +376
"```python\n",
"with FluxClusterExecutor(cache_directory=\"./cache\") as exe:\n",
" future = exe.submit(mpi_calc, 3, resource_dict={\"cores\": 2})\n",
" print(future.result())\n",
"```"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Missing pmi_mode parameter breaks the MPI example.

The FluxClusterExecutor MPI example is incomplete. According to the source code and your own summary table (line 391), MPI execution requires both pmi_mode="pmix" in the executor constructor and "cores": N in the resource_dict. This example only provides cores and will fail to properly initialize MPI for the mpi_calc function.

🐛 Proposed fix
-with FluxClusterExecutor(cache_directory="./cache") as exe:
+with FluxClusterExecutor(pmi_mode="pmix", cache_directory="./cache") as exe:
     future = exe.submit(mpi_calc, 3, resource_dict={"cores": 2})
     print(future.result())
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@notebooks/0-hpc-schedulers.ipynb` around lines 372 - 376, The MPI example
fails because FluxClusterExecutor is missing the pmi_mode parameter; update the
example to construct the executor with pmi_mode="pmix" (i.e., use
FluxClusterExecutor(cache_directory="./cache", pmi_mode="pmix")) so that MPI is
initialized for mpi_calc, and keep the resource_dict with "cores": N as shown;
modify the example where FluxClusterExecutor and the call exe.submit(mpi_calc,
...) appear to include this parameter.

@jan-janssen
jan-janssen marked this pull request as ready for review June 10, 2026 11:31
@jan-janssen
jan-janssen merged commit 19a0cce into main Jun 10, 2026
63 of 65 checks passed
@jan-janssen
jan-janssen deleted the slurmdoc branch June 10, 2026 11:31
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.

1 participant