Skip to content

TTMETAD: make WALKERS_MPI work with more than one rank per walker (#1443) - #1486

Merged
carlocamilloni merged 1 commit into
plumed:masterfrom
aalhossary:ttmetad-walkers-dd
Oct 10, 2026
Merged

carlocamilloni merged 1 commit into
plumed:masterfrom
aalhossary:ttmetad-walkers-dd

Conversation

@aalhossary

@aalhossary aalhossary commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor
Description

Closes #1488.

Follow-up to #1443 for TTMETAD with WALKERS_MPI. multi_sim_comm is valid only on the first rank of each replica, but TTMETAD read the walker count and index from it, and communicated over it, on every rank. With more than one MPI rank per walker (domain decomposition), the other ranks of each walker believed they were walker 0 of 1, and the run hung.

  • Walker count and index come from getNumberOfReplicas() / getReplicaIndex() (Replica count and index on every rank of a replica (#1443, part C) #1481).
  • The walkers directory, the sketch count and the gathered hills go over multi_sim_comm on the first rank of each walker only, then are broadcast over comm.
  • The sketch seed is broadcast over comm. Without DETERMINISTIC it came from time(nullptr) on each rank, so the ranks of one walker could build different sketches.
  • Only one rank of the replica writes the sketch file, instead of all of them writing the same HDF5 file.

Single-walker runs and runs with one rank per walker behave as before: the existing ttsketch/rt-ttmetad and rt-ttmetad-2 pass unchanged.

Target release

I would like my code to appear in release master (v2.11)

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.

New ttsketch/rt-ttmetad-walkers-dd: 2 walkers with 2 ranks each under driver --debug-dd yes. Walker 1 reads the same frames in reverse order, and two sketches are built. COLVAR, HILLS and all four force dumps are byte-identical to the run with one rank per walker. Without the fix the run hangs. Tested locally with ITensor 3.2.0 built as in .ci/install.itensor.

multi_sim_comm is valid only on the first rank of each replica (plumed#1443).
With WALKERS_MPI and domain decomposition, TTMETAD read the walker index
and count from it and communicated over it on every rank, so the other
ranks of each walker believed they were walker 0 of 1 and the run hung.

- Take the walker count and index from getNumberOfReplicas() and
  getReplicaIndex().
- Use multi_sim_comm on the first rank of each walker only, then
  broadcast over comm: the walkers directory, the sketch count and the
  gathered hills.
- Broadcast the sketch seed over comm, so that all ranks of a walker
  build the same sketch when DETERMINISTIC is not set (it came from
  time(nullptr) on each rank).
- Write the sketch file from one rank of the replica only.

The regtest runs 2 walkers with 2 ranks each under driver --debug-dd;
COLVAR, HILLS and the forces match the run with one rank per walker.
Without the fix it hangs.
@carlocamilloni
carlocamilloni merged commit 2f64cb6 into plumed:master Oct 10, 2026
25 of 26 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.

TTMETAD: WALKERS_MPI with more than one rank per walker

2 participants