Question about Legion interoperation MPI

31 views
Skip to first unread message

Регина Евгеньевна Капралова

unread,
Apr 10, 2023, 4:00:55 AM4/10/23
to Legion Users
Good afternoon dear community.

I am very interested in the Legion and especially the issue of interoperability with a MPI. Unfortunately, I couldn't find the information I needed. Could you explain how to call a Legion-program from a MPI-program? What is happening in this case? How to transfer control from one program to another? How to transfer data?

I will be grateful for any answer, even if it is one sentence per question. This is very important for my work, so I kindly ask you to help.

#include <mpi.h>
int main(int argc, char** argv) {
     MPI_Init(args , argv);
//Calling Legion program 
//??????????????????????
     MPI_Finalize();
}

Thank you.

Michael Bauer

unread,
Apr 10, 2023, 5:31:18 AM4/10/23
to Регина Евгеньевна Капралова, Legion Users
You can inter-operate Legion with MPI, but we recommend you only do it only at a coarse granularity, switching between "MPI phases" and "Legion phases" of your program and performing large chunks of computation in each phase. This is both for performance and correctness reasons. The cost of switching between phases can be expensive, and you can also encounter deadlocks if you try to mix the phases (see the MPI Interoperability Section in the GASNet README, everything that applies to GASNet also applies to Legion programs running on GASNet). If you are going to try to interoperate Legion with MPI then we recommend following the template examples for MPI interoperability: either without or with control replication. You can also consider using MPI calls inside of concurrent index space tasks to do things like MPI/NCCL all-to-all calls, but if you find yourself writing lots of point-to-point communication ask yourself if you wouldn't be better served letting Legion handle that kind of communication for you between finer-grained tasks.

--
You received this message because you are subscribed to the Google Groups "Legion Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to legionusers...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/legionusers/d6a56187-435d-49b4-abff-e27f64b5f043n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages