Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predefined handles before MPI_Init and constants in general, Enhancment Solution 2 #151

Closed
mpiforumbot opened this issue Jul 24, 2016 · 3 comments

Comments

@mpiforumbot
Copy link
Collaborator

mpiforumbot commented Jul 24, 2016

Originally by RolfRabenseifner on 2009-04-07 09:28:21 -0500


Description

Informations about handles:

  • 13:1-3 "In Fortran, the handle can be an index into a table of opaque objects in a system table; in C it can be such an index or a pointer to the object"
  • 13:18-20 "MPI provides certain predefined opaque objects and predefined, static handles to these objects. The user must not free such objects. In C++, this is enforced by declaring the handles to these predefined objects to be static const."
  • 14:40-43 "All named constants, with the exceptions noted below for Fortran, can be used in initialization expressions or assignments. These constants do not change values during execution. Opaque objects accessed by constant handles are defined and do not change value between MPI initialization (MPI_INIT) and MPI completion (MPI_FINALIZE)."

It is not clear, whether the handles to predefined opaque objects are

  • Choice 1: compile time constants that can be used already at compile time for initializations,
  • Choice 2: link time constants, that can be used in initializations, but not in case/switch statements,
  • Choice 3: whether these handles may be integer variables or pointer variables that may change the value at MPI_Init.

For C++, the answer "static const" should imply the choice 1 or 2.
For Fortran, it is not clear for me, whether all three choice are valid.

The answer at MPI-3-Forum meeting, Dec. 2009 was:
Choice 2 (link-time constants) is intended with the current wording.
For some constants, the proposed usage in MPI-2.1 requires Choice 1
(compile-time constants), e.g.,

  • MPI_MAX_PROCESSOR_NAME, MPI_MAX_ERROR_STRING,
    MPI_MAX_DATAREP_STRING, MPI_MAX_INFO_KEY, MPI_MAX_INFO_VAL,
    MPI_MAX_OBJECT_NAME, MPI_MAX_PORT_NAME,
  • MPI_STATUS_SIZE,
  • MPI_ADDRESS_KIND, MPI_INTEGER_KIND,
    MPI_OFFSET_KIND

Solution 1 clarifies the current status.
[[BR]]
Solution 2 extends the number of compile-time constants.

In Case of choosing Solution 2, the the following tickets
are related: #5, #59, #76, #107.

History

This was split off from ticket #65.[[BR]]
Solution 1 (clarification) is done in ticket #65, and solution 2 (the enhancment) is done here.

Proposed Solution 2

-If the forum decides to pass this ticket #151, i.e., the enhancement-solution 2, then this solution supersedes the clarification-solution in ticket #65.*

At end of line p14:43, add:

The handles themselves are constants and can be also used in
initialization expressions or assignments.
All named constants, except the predefined named constant handles
and the constants listed below for Fortran, are compile-time
constants in all languages, and are also allowed as labels
in switch (C/C++) or select/case (Fortran) statements or
as sizes in array declarations.

Add after p15:15, add:

-Advice to users.*
Constants that are not compile-time constants, are at least
link-time constants. (End of advice to users.)

Impact on Implementations

MPI libraries

  • that are not using compile-time constants for MPI named constants
    (except the constants listed MPI-2.1 p14:47 - p15.6),
    and
  • that are not using at least link-time constants for MPI the
    named constants listed MPI-2.1 p14:47 - p15.6 and
    for predefined named constant handles
    must be fixed.

Impact on Applications / Users

None on existing applications.

Implementations

Both, mpich2 and OpenMPI fulfill this stronger Proposed Solution 2:

  • mpich2 uses integer constants for MPI constants
    and MPI predefined handles.
  • OpenMPI uses integer constants or enumerations for all
    MPI constants (except predefined handles).
    For named predefined handles, OpenMPI uses
    • in C, pointers to external structures
      (i.e. link-time constants)
      • in Fortran, integer constants.
  • Exception in both mpich2 and OpenMPI:
    The seven special constants from MPI-2.1 p14.47 - p15.5
    are implemented
    • in C, they are constant pointers;
    • in Fortran, they are located in named Fortran common blocks.

Entry for the Change Log

Section 2.5.4 on page 14.[[BR]]
It is now guaranteed that predefined named constant handles (as other constants) can be used in initialization expressions or assignments, i.e., also before the call to MPI_INIT, and that all constants (except predefined handles and those listed in Section 2.5.4) are now compile-time constants.

Amendment Proposal

Substitute "compile-time constant(s)" by "integer constant(s)".

@mpiforumbot
Copy link
Collaborator Author

Originally by RolfRabenseifner on 2009-04-07 10:02:02 -0500


If solution 2 (enhancement) passes, then it supersedes this solution 1 (clarification).

@mpiforumbot
Copy link
Collaborator Author

Originally by rsthakur on 2009-06-09 12:13:07 -0500


Votes: 0 yes, 12 no, 5 abstain, 1 missed

@mpiforumbot
Copy link
Collaborator Author

Originally by jsquyres on 2009-06-10 08:55:14 -0500


Three notes on this ticket:

  1. This ticket was rejected from 2.2 because it has ABI implications.
  2. Many in the Forum think that this ticket should return for 3.0.
  3. I changed the implementation status to "completed" since both Open MPI and MPICH2 satisfy the implementation requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant