Skip to content

Conversation

ggouaillardet
Copy link

A requirement is that all the ranks of a given MPI window share the same id (so it can be passed to an other rank). There is no such thing mandated by the MPI standard, this is absolutely not the case with Open MPI (and its derivatives) and though it seems to work with MPICH (and its derivatives) this is not something guaranted by the implementation.

A reliable mechanism must be implemented for this to work with any MPI library.

This patch is a proof of concept that introduces two subroutines:

  • MPI_Win CAF_idx2win(int idx)
  • int CAF_win2idx(MPI_Win win) that do the conversion between a MPI_Win opaque handler and and index that meet the Coarrays requirements.

These subroutines are implemented with MPI_Win_f2c() and MPI_Win_c2f().

THIS IS NOT A CORRECT IMPLEMENTATIONi
since the MPI Standard offer no guarantee
that the Fortran ID meet the requirements for Coarrays.

OpenCoarrays have been lucky so far with MPICH, and it may be equally lucky with Open MPI too, but that CANNOT be taken for granted.

Refs #793

coverage on master
Codecov branch

Summary of changes

Summarize what you changed

Rationale for changes

Why did you make these changes?

Additional info and certifications

This pull request (PR) is a:

  • Bug fix
  • Feature addition
  • Other, Please describe:

I certify that

  • I certify that:
    • I have reviewed and followed the contributing guidelines
    • I will wait at least 24 hours before self-approving the PR to give another
      OpenCoarrays developer a chance to review my proposed code
    • I have not introduced errant white space (no trailing white space or white space errors may
      be introduced)
    • I have added an explanation of what these changes do and why they should be included
    • I have checked to ensure there aren't other open Pull Requests for the same change
    • I have you written new tests for these changes
    • I have successfully tested these changes locally
    • I have commented any non-trivial, non-obvious code changes
    • The commits are logically atomic, self consistent and coherent
    • The commit messages follow best practices
    • Test coverage is maintained or increased after this is merged

Code coverage data

coverage on master

A requirement is that all the ranks of a given MPI window share the same id
(so it can be passed to an other rank). There is no such thing mandated by
the MPI standard, this is absolutely not the case with Open MPI (and its derivatives)
and though it seems to work with MPICH (and its derivatives) this is not something
guaranted by the implementation.

A reliable mechanism must be implemented for this to work with any MPI library.

This patch is a proof of concept that introduces two subroutines:
 - `MPI_Win CAF_idx2win(int idx)`
 - `int CAF_win2idx(MPI_Win win)`
that do the conversion between a MPI_Win opaque handler and and index that meet
the Coarrays requirements.

These subroutines are implemented with `MPI_Win_f2c()` and `MPI_Win_c2f()`.

THIS IS NOT A CORRECT IMPLEMENTATIONi
since the MPI Standard offer no guarantee
that the Fortran ID meet the requirements for Coarrays.

OpenCoarrays have been lucky so far with MPICH, and it may be equally lucky
with Open MPI too, but that CANNOT be taken for granted.

Refs sourceryinstitute#793

Signed-off-by: Gilles Gouaillardet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant