Skip to content

Simulation hanging before entering main loop #433

Answered by c-white
gaturpin asked this question in Q&A
Discussion options

You must be logged in to vote

Adding new MPI commands is somewhat dangerous. In this case, there may well be a problem with the fact that Athena++ has

1 MPI rank <-> 1 Mesh <-> 1 or more MeshBlocks

ProblemGenerator() is called by each MeshBlock on the Mesh in turn. So if you have more MeshBlocks than ranks, the global communication is almost certainly not doing what you expect. If different Meshes have different numbers of MeshBlocks, then this code will hang, as different ranks will call the MPI routines different numbers of times.

The code might work correctly if you have exactly 1 MeshBlock per rank. Otherwise, the communication pattern needs to be

  1. Have each MeshBlock set itself up.
  2. Have the Mesh aggregate results…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by gaturpin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants