llnl / llnl/Quicksilver

MPI-5 ABI fix for MPI_THREAD_* constants (noncontiguous)

Open Beginner friendly
#71 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
47
Forks
37
PR merge metrics
No merged PRs in 30d

Description

MPI never required the thread constants to be a contiguous set, although that happened to be true in MPICH and Open MPI. With the MPI-5 ABI, they will not be contiguous, so the following patch is required to fix Quicksilver.

```patch
diff --git a/src/utilsMpi.cc b/src/utilsMpi.cc
index 811d892..d0e51de 100644
--- a/src/utilsMpi.cc
+++ b/src/utilsMpi.cc
@@ -11,13 +11,21 @@

#ifdef HAVE_MPI

+static const char* mpiThreadLevelName(int level)
+{
+ if (level == MPI_THREAD_SINGLE) return "MPI_THREAD_SINGLE";
+ if (level == MPI_THREAD_FUNNELED) return "MPI_THREAD_FUNNELED";
+ if (level == MPI_THREAD_SERIALIZED) return "MPI_THREAD_SERIALIZED";
+ if (level == MPI_THREAD_MULTIPLE) return "MPI_THREAD_MULTIPLE";
+
+ return "unknown MPI thread level";
+}
+
void mpiInit( int *argc, char ***argv)
{

#ifdef HAVE_OPENMP
{ // limit scope
- char const* const provided_string[4] = \
- {"MPI_THREAD_SINGLE","MPI_THREAD_FUNNELED","MPI_THREAD_SERIALIZED","MPI_THREAD_MULTIPLE"};
int provided, required = MPI_THREAD_FUNNELED;

int err = MPI_Init_thread(argc, argv, required, &provided);
@@ -26,12 +34,12 @@ void mpiInit( int *argc, char ***argv)
int rank = -1;
mpiComm_rank(MPI_COMM_WORLD, &rank);
if (rank == 0)
- fprintf(stdout,"MPI Initialized : %s\n", provided_string[provided]);
+ fprintf(stdout,"MPI Initialized : %s\n", mpiThreadLevelName(provided));

if ((required > MPI_THREAD_SINGLE) && (required > provided))
{
printf("MPI-OpenMP Error.\n\tCode requires %s thread support. MPI library provides %s support.\n",
- provided_string[required],provided_string[provided]);
+ mpiThreadLevelName(required), mpiThreadLevelName(provided));
qs_assert(false);
}
} // limit scope

```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/utilsMpi.cc, focusing on mpiInit and the MPI thread-level reporting around MPI_Init_thread. Replace the contiguous-index lookup with explicit handling for MPI_THREAD_SINGLE, MPI_THREAD_FUNNELED, MPI_THREAD_SERIALIZED, and MPI_THREAD_MULTIPLE as shown in the issue. Done means Quicksilver reports and validates thread levels correctly when MPI-5 constants are noncontiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
distributed-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
86/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.