[Mpi-forum] Question about MPI_Info set on communicators

Schulz Martin schulzm at llnl.gov
Wed Feb 17 16:42:13 CST 2016

Another case of email eaten by the server (and I was wondering why you
ignored me :) - old email attached below - new comments inline.


Martin Schulz, schulzm at llnl.gov, http://scalability.llnl.gov/
CASC @ Lawrence Livermore National Laboratory, Livermore, USA

On 2/16/16, 12:49 PM, "mpi-forum on behalf of Jeff Squyres (jsquyres)"
<mpi-forum-bounces at lists.mpi-forum.org on behalf of jsquyres at cisco.com>

>-----Original Message-----
>From: Jeff Hammond <jeff.science at gmail.com>
>Reply: Main MPI Forum mailing list <mpi-forum at lists.mpi-forum.org>
>Date: February 16, 2016 at 2:37:57 PM
>To: Main MPI Forum mailing list <mpi-forum at lists.mpi-forum.org>
>Subject:  Re: [Mpi-forum] Question about MPI_Info set on communicators
>> > - "yes" because the user asked for it (i.e., that's the hint,
>> > of what the implementation dos with it.
>> This answer contradicts the most reasonable interpretation of "hints
>> actually used by the system"
>See my reply to Jim: if we're supposed to provide the value of *the
>hint*, that to me sounds like the *user's input* (as opposed to what the
>system chose to do with that hint).

I agree, hints are given by the user to express what an application does.
Those should never be changed by the MPI library (or no are no longer
(user) hints).

>> > - "no" because the implementation could not provide it
>> > - no "foo" key at all because the implementation did not use the hint
>> I think these are equivalent from a user perspective. In both cases, the
>> user is not getting the "magical_powers"="yes" they requested.
>> However, my reading of MPI 3.1 6.4.4 p250 says that the keys should be
>> defined, but set to "no".

I don¹t read this into the text - it just says that any hint used by the
system is returned, those are not used are not. In this case, I would
argue that the MPI library does not use the hint and hence it should not
be returned. In any case, an MPI library can¹t change a hint - it is not
changing what the application wants to tell the library.

>> In any case, we need to improve the standard text unless Bill swoops in
>> tell us we are all idiots and points out text that makes the
>> unambiguous :-)
>I agree it needs to be clarified.  It would be nice if we could clarify
>it in a way that is compatible with the 3.0 and 3.1 text (so that we
>don't have to have apps distinguish between 3.0/3.1 behavior and
>beyond-3.1 behavior).

I think it¹s a bit strange (I.e., get and set info are not pairs), but
it's expressed in the text. I don¹t think we say anywhere in the text (at
least I couldn¹t find it) that MPI is supposed to change user defined

Back to the old example (that¹s the missing old email):

I don¹t think that these two sequences should result in the same behavior.

>> MPI_Comm_get_info(comm, myinfo_returned);
>> MPI_Comm_dup_with_info(comm, &newcomm, myinfo_returned);
>> and
>> MPI_Comm_dup(comm, &newcomm);

MPI_Comm_get_info states that a new info object is returned that only
contains the hints that are actually used by the communicator. Which hints
given by the user are used is, I assume, up to the implementation, but the
set can be smaller and not the same with the hints given by the user. When
I duplicate a communicator, as a user, I would expect all hints that I
gave to be copied as well (I.e., the ones that are set on the
communicator), not just the used ones.

Back to Jeff¹s example ­ I think the critical part is actually the use of

MPI_Info_set(myinfo, "use_shared_memory", "yes");
MPI_Comm_set_info(comm, myinfo);
MPI_Comm_get_info(comm, myinfo_returned);
// Assume here that there was not enough shared memory available to use
shared-memory for 
// communication on this comm, so MPI_Info_get() tells us that
use_shared_memory is "no².

This should not return ³no² for ³use_shared_memory² (MPI should never
change a user defined hint ­ why would this be the case, they are user set
properties), instead ³use_shared_memory² should simply not be present in
the returned info object. Nevertheless, the hint is still set on the
communicator (why would I, as a user, expect that MPI removes a hint) and
so, if you dup the communicator, it should get duplicated as well. If the
hint now becomes active (as at the end in Jeff¹s example)
MPI_Comm_get_info should include it in the returned info object.

>Jeff Squyres
>jsquyres at cisco.com
>For corporate legal information go to:
>mpi-forum mailing list
>mpi-forum at lists.mpi-forum.org

More information about the mpi-forum mailing list