Tung Dang
Tung Dang

Reputation: 21

How to mix Coarray and MPI code in Fortran

I would like to combine Fortran coarray with MPI inside my code. I plan to use third party softwave(HYPRE), which used MPI, for linear system solvers. For the rest of my work, I want to use the Fortran coarray (OpenCoarrays). I've already searched for a solution on Internet. But there isn't any clues about how to make it work. I wonder is that possible to mix Fortran coarray and MPI. If yes, should I use the OpenCoarrays or MPI wrapper compilers

Upvotes: 2

Views: 268

Answers (1)

Jeff Hammond
Jeff Hammond

Reputation: 5652

OpenCoarrays sits on top of MPI-3 RMA (at least by default; I don’t recall the latest status of the GASNet port) so this should work, even if neither standard guarantees this. You’ll be using process-parallel execution and they should interoperate fine.

Intel Fortran also uses MPI for coarrays. Cray Fortran coarrays use DMAPP, which is compatible with MPI. Thus, the interoperability you want should cover all the widely available implementations.

In all cases, there may be some implementation quirks, particularly with respect to initialization and termination. You may find that you can’t finalize MPI until all your coarrays are deallocated, for example.

I’m sure the developers of OpenCoarrays would appreciate big reports on this topic if you have problems.

Upvotes: 2

Related Questions