Skip to content

Robust Handle Conversions for MPI_T Event information

Marc-Andre Hermanns edited this page Sep 8, 2022 · 3 revisions

This page is meant for background information and discussion of solutions for https://github.com/mpi-forum/mpi-issues/issues/579

Example usage

void(
my_mpit_event_handler(
   MPI_T_event_instance event_instance,
   MPI_T_event_registration event_registration,
   MPI_T_cb_safety cb_safety,
   void *user_data)
{
 // query other elements
 // Query communicator id (contained in event)
 uint64_t commid = 0;
 int commsize = 0;
 MPI_T_event_read(event_instance, 2, &commid);
 // use this as a real MPI handle
 MPI_Comm_size((MPI_Comm)commid, &commsize); // <- May cause program abort
 // safer way
 MPI_Comm mycomm = MPI_COMM_NULL;
 // call handle conversion: int MPI_T_event_cast_comm(void* buf, MPI_Datatype type, MPI_Comm* comm);
 int err = MPI_T_event_cast_comm(commid, element[2].type, &mycomm);
 // handle potential error
}

Related work

tbd.

Proposed solutions

tbd.

Clone this wiki locally