mpi-forum / mpi-forum-historic

Migration of old MPI Forum Trac Tickets to GitHub. New issues belong on mpi-forum/mpi-issues.
http://www.mpi-forum.org
2 stars 3 forks source link

Fortran extra_state parameter in attribute callback functions #159

Open mpiforumbot opened 8 years ago

mpiforumbot commented 8 years ago

Originally by jsquyres on 2009-05-14 13:48:38 -0500


It is unclear in the text as to whether the EXTRA_STATE parameter passed to attribute callback functions is passed by value or by reference.

Here's the discussion on the mpi-22 mailing list:

This ambiguity has existed all the way back to MPI-1.

Proposed Solution

It was decided that the MPI implementation should not pass a reference to the original value passed in to the keyval constructor (if nothing else, the clincher argument is that the original value may actually be an expression, and may therefore go out of scope as soon as the keyval constructor completes).

However, there is still an open question at the moment about whether MPI will guarantee that all callbacks on this keyval get exactly the same extra_state value (e.g., what happens if one of the callbacks modifies the value). This ticket is a placeholder to get some feedback (from the list or otherwise) and then eventually turn this into a real MPI-3.0 ticket.

MPI-2.1 References:

Implementations that are currently passing a reference to the original EXTRA_STATE will need to be fixed.

Impact on Applications / Users

Applications that rely on a single, global instance of the EXTRA_STATE (e.g., at least some versions of the Intel MPI test MPI_KEYVAL1_F) will need to be fixed.

Alternative Solutions

None.

Entry for the Change Log

TBD.

mpiforumbot commented 8 years ago

Originally by rlgraham on 2009-07-29 10:37:37 -0500


Straw vote: Option 1: Pass a reference to internal MPI storage Option 2: Pass a reference to a copy of the internal MPI stored value

Option 1: 2 Option 2: 5 Abstain: Vast majority

mpiforumbot commented 8 years ago

Originally by jsquyres on 2009-07-29 10:40:26 -0500


Further discussion in the room: