FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Issue #1785 Add writing the HPC input file by verkaik · Pull Request #1790 · Deltares/imod-python · GitHub

Issue #1785 Add writing the HPC input file - #1790

Open
verkaik wants to merge 1 commit into
masterfrom
issue_#1785_hpc_filein
Open

Issue #1785 Add writing the HPC input file#1790
verkaik wants to merge 1 commit into
masterfrom
issue_#1785_hpc_filein

Conversation

verkaik commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #1785

Description

Support for writing the HPC input file as defined in the options block of the simulation name file. By enabling this option, the user can connect submodels to the MPI process ranks.

Checklist

  • Links to correct issue
  • Update changelog, if changes affect users
  • PR title starts with Issue #nr, e.g. Issue #737
  • Unit tests were added
  • If feature added: Added/extended example
  • If feature added: Added feature to API documentation
  • If pixi.lock was changed: Ran pixi run generate-sbom and committed changes

verkaik requested a review from JoerivanEngelen March 18, 2026 14:36
verkaik added the enhancement New feature or request label Mar 18, 2026

Copy link
Copy Markdown

Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

JoerivanEngelen 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Cool! Jinja templates and tests look good. I have some comments.

Furthermore: I'm not entirely sure about the API yet. For the UTL-ATS, we create a separate package (see: AdaptiveTimeStepping). I think we should do the same for UTL-HPC to keep things consistent, even though the UTL-HPC is such a trivial package to write.

This means a HighPerformanceComputing package, which has to be added to the simulation. The _write_hpc_package method can also be moved to this package. For user convenience, we can let the split method add this package to the generated simulation, so they don't have to worry less about not forgetting to add a HPC package themselves.

if mpi_rank < 0:
raise ValueError(f"Negative MPI rank of {mpi_rank} is not allowed.")
else:
mpi_rank = -1

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't really like sentinel values to indicate the mpi_rank is not set. It's more understandable for other developers to set mpi_rank to None here to indicate mpi_rank is not set.

class PartitionInfo(NamedTuple):
active_domain: GridDataArray
id: int
mpi_rank: int

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

See other comment on line R47 in this file

Suggested change
mpi_rank: int
mpi_rank: Optional[int]


for id, model_dict in self._partition_id_to_models.items():
mpi_rank = self.partition_info[id].mpi_rank
if mpi_rank > 0:

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

in the code in common.utilities.partitioninfo.py you assume -1 is an inactive mpi_rank, but here you assume mpi_rank==0 is inactive as well?

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Status: No status

Development

Successfully merging this pull request may close these issues.

Add HPC file support to simulation name file options for extended MODFLOW 6

2 participants


Back | FazBrowse Home | New Git URL