StanfordLegion/legion

Purpose of MPILegionHandshake

opensdh opened this issue · 1 comments

MPILegionHandshake's documentation is pretty negative:

This class is only here for legacy reasons. In general we encourage users to use the generic LegionHandshake

That could be interpreted as it being deprecated, but it could also be interpreted as it providing special additional features (at additional cost) that many users don't need. (For example, one might suppose that it performs appropriate barriers to support interleaving GASNet and MPI usage, especially given names like mpi_wait_on_legion.) Neither is true: it's not [[deprecated]], but it does the same thing as LegionHandshake.

It might be more useful to either really deprecate and (eventually) remove it or give it useful, stronger semantics for that use case. @lightsighter requested an issue to track this question.

Making a note for the future: today the LegionHandshake object provides a point-to-point handshake between a single Legion task and a single external thread. This is good for passing data back and forth between the two. If however you are trying to interoperate with MPI, then networks like GASNet place a much stronger constraint on interoperating with MPI: specifically that all GASNet work must be finished before switching to MPI and vice-versa. This suggests that the MPI handshake might need to be a global barrier across all the processes to ensure that all Legion work has finished before switching over to MPI.