provide support for multi-model runs in thorn MPI

Create issue
Issue #1884 closed
Roland Haas created an issue

The attached patch adds a very thin layer of code to ExternalLibraries/MPI to provide access to two communicators MPI_Comm_World and MPI_Comm_Universe which can be used for multi-model runs (or runs started via MPI_Comm_Spawn).

The code does not itself split a communicator, it only provides routines to get and set the communicators.

It supports C and F90 calls (and C++ calls through external C and call from F77 files since Cactus compiles those with at a F90 compiler).

Documentation is provided in the tex file and in the grdoc comments.

Keyword: MPI

Comments (5)

  1. Erik Schnetter
    • removed comment

    Carpet currently provides aliased functions for this. Presumably, all drivers that support multi-model runs could provide such an aliased function. What is the advantage of an explicit function definition in thorn MPI?

  2. Roland Haas reporter
    • removed comment

    I am no longer sure.

    For C, the functionality is the identical between this and Carpet I think. The code would only collect the functionality on one spot rather than in each driver.

    I think for Fortran, however, Carpet's aliased functions won't work since there is no way to dereference the returned CCTK_POINTER_TO_CONST. The returned pointer is a pointer to the C MPI communicator struct, which (as far as I know) does not have to be bit-identical to Fortran's MPI_Communicator type (which is INT).

    Having said all of this, the original usage case I had for this no longer exists (I think it had to do with running PUGH under LoadLeveler or something similar, I have PUGH/Carpet patches that would make user of this code to provide the aliased functions). The implementation of the Reset functions is also somewhat ugly.

  3. Roland Haas reporter
    • changed status to resolved
    • removed comment

    Come to think of it, unless there is need for it, I'd keep the complex code out the ET.

  4. Log in to comment