Skip to content

Document comm and multi_sim_comm (#1443, part A) - #1482

Merged
carlocamilloni merged 2 commits into
plumed:v2.9from
aalhossary:issue1443-comm-docs
Oct 10, 2026
Merged

carlocamilloni merged 2 commits into
plumed:v2.9from
aalhossary:issue1443-comm-docs

Conversation

@aalhossary

@aalhossary aalhossary commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor
Description

Part A of #1443: document the replica communicators so their contract is visible to both action authors and MD-code authors. Documentation only; no code changes.

  • Action::comm: the ranks of this replica; valid on every rank.
  • Action::multi_sim_comm: one rank per replica, valid only on rank 0 of comm. Elsewhere it is MPI_COMM_SELF, which reports one replica and reaches no other replica. Includes the read-on-rank-0-and-broadcast pattern.
  • PlumedMain::comm / multi_sim_comm: a short note plus a pointer to the Action comments.
  • GREX::intracomm / intercomm: what each holds, and that setMPIIntercomm also sets PlumedMain::multi_sim_comm and is passed only on rank 0.
  • developer-doc/mdTemplate.md: new section Dealing with multiple replicas next to Dealing with parallelism. It shows which calls an MD code makes on which processes (taken from driver) and what each process then sees inside PLUMED. It is linked from Action::multi_sim_comm with \ref mpireplicas.

When this is merged into master, the comment can also point to getNumberOfReplicas() / getReplicaIndex() (#1481).

Target release

I would like my code to appear in release v2.9

Type of contribution
  • changes to code or doc authored by PLUMED developers, or additions of code in the core or within the default modules
  • changes to a module not authored by you
  • new module contribution or edit of a module authored by you
Copyright
  • I agree to transfer the copyright of the code I have written to the PLUMED developers or to the author of the code I am modifying.
Tests
  • I added a new regtest or modified an existing regtest to validate my changes.
  • I verified that all regtests are passed successfully on GitHub Actions.

multi_sim_comm is valid only on process 0 of comm; on the other processes
it is MPI_COMM_SELF, so it reports one replica and reaches no other
replica. Nothing in the headers said so. Add Doxygen comments to the
declarations in Action, PlumedMain and GREX, including the
read-on-process-0-and-broadcast pattern.

See plumed#1443.
Add a section to mdTemplate.md on how an MD code passes the replica
and inter-replica communicators, and what each process sees inside
PLUMED. Link it from Action::multi_sim_comm.

See plumed#1443.
@carlocamilloni
carlocamilloni merged commit 6c0f04c into plumed:v2.9 Oct 10, 2026
11 checks passed
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