Allow passing in non-petsc communiators to PetscShmCommGet

Design thoughts:

  • I always want to stash the shared memory communicators on petsc inner comms, so that when petsc is finalized, they will be destroyed.
  • Only on rare cases (the input comm in PetscShmCommGet() is neither a petsc inner comm, nor an outer comm with a linked inner comm), I need to dup the communicator. So I use a fixed-size static array to store these dupped communicators. Note PETSC_COMM_WORLD has an inner comm, so calling PetscShmCommGet() on PETSC_COMM_WORLD won't generate new comm.
Edited by Junchao Zhang

Merge request reports

Loading