Dear OpenMPI Pros
These questions may have appeared before.
Anyway, I am somewhat confused about self-messaging
in MPI and OpenMPI.
*1) Can a process send a message to itself?*
The book "MPI: The complete reference, Vol. 1, 2nd Ed.", by Snir et al.,
page 42, section 2.9.9 (Comments on Receive) says:
"Therefore, it is unsafe and non-portable to send self-messages with the
standard mode, blocking send and receive operations described so far,
since this may lead to deadlock."
*2) Would it be safe and portable to send messages to self, if one uses
non-blocking send and recv (MPI_Isend, MPI_Irecv), or with persistent
communication (MPI_Init_[Send/Recv], MPI_Startall, MPI_Waitall) ?*
On the other hand, the OpenMPI FAQ seems to say something different,
i.e., that self-messaging is OK, as long as the
"self" BTL is turned on:
*3) Is this a particular feature or extension provided by OpenMPI,
beyond the MPI standard?*
In other words:
*4) If I write a program with self-messaging, will it
be portable and run safely when compiled with other MPI implementations?*
Of course, I can use an "if" conditional to copy the data to
the output buffer, instead of sending the message to self,
although this makes the code somewhat ugly.
This brings up yet another question:
*5) Which one is better/faster: sending messages to self,
or copying the data to the output buffer?*
(I would guess with the "sm" btl this would make no difference,
but who knows ...)