Using the multi-model mechanism in Carpet

From Einstein Toolkit Documentation
Revision as of 13:53, 4 April 2018 by Rhaas (talk | contribs) (fix subject of reference email given)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

This text was originally extracted from multi-model code in Carpet to Cactus developers mailing list.

To use the multi-model mechanism in Carpet:

  1. Arrange for mpirun to start the Cactus run with different parameter files for different MPI ranks. All MPI implementations I know of have a mechanism for this. You may or may not want to use different executables as well.
  2. In the parameter files, set the parameter Carpet::model to different strings.
  3. Carpet will then group all MPI ranks by this parameter's value, create a communicator for each of these, and start independent runs for each.
  4. So far, all you've done is starting several completely unrelated and independent simulations with one mpirun call.
  5. Carpet offers an aliased function GetMPICommUniverse that returns the original MPI communicator that allows all processes to communicate. (Compare with GetMPICommWorld.) Note that there is no implicit or implied synchronization between the different worlds; this is your responsibility.
  6. Thorn CactusNumerical/Slab has a mechanism for passing an MPI communicator that it should use, allowing you to transfer hyperslabs between worlds. Other thorns may be extended similarly if necessary.