Skip to content

Commit a55ecfa

Browse files
committed
mpi_dp: build always, heuristics determine priority
1 parent 67f771b commit a55ecfa

File tree

5 files changed

+35
-27
lines changed

5 files changed

+35
-27
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ if (ADIOS2_HAVE_SST)
462462
if (ADIOS2_SST_HAVE_UCX)
463463
set (HPCDataPlaneList "${HPCDataPlaneList} UCX")
464464
endif()
465-
if (ADIOS2_SST_HAVE_MPI_DP)
465+
if (ADIOS2_HAVE_MPI)
466466
set (HPCDataPlaneList "${HPCDataPlaneList} MPI")
467467
endif()
468468
endif()

cmake/DetectOptions.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,8 @@ if(ADIOS2_USE_SST AND NOT WIN32)
503503
MPI_Finalize();
504504
exit(EXIT_SUCCESS);
505505
}]=]
506-
ADIOS2_HAVE_MPI_CLIENT_SERVER)
506+
ADIOS2_SST_HAVE_MPI_DP_HEURISTICS_PASSED)
507507
unset(CMAKE_REQUIRED_LIBRARIES)
508-
509-
if (ADIOS2_HAVE_MPI_CLIENT_SERVER)
510-
set(ADIOS2_SST_HAVE_MPI_DP TRUE)
511-
endif()
512508
endif()
513509

514510
# UCX

source/adios2/toolkit/sst/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if(ADIOS2_HAVE_ZFP)
4545
target_link_libraries(sst PRIVATE zfp::zfp)
4646
endif()
4747

48-
if(ADIOS2_SST_HAVE_MPI_DP)
48+
if(ADIOS2_HAVE_MPI)
4949
target_sources(sst PRIVATE dp/mpi_dp.c)
5050
target_link_libraries(sst PRIVATE MPI::MPI_C)
5151
endif()
@@ -68,6 +68,7 @@ set(SST_CONFIG_OPTS
6868
CRAY_CXI
6969
NVStream
7070
MPI
71+
MPI_DP_HEURISTICS_PASSED
7172
)
7273
include(SSTFunctions)
7374
GenerateSSTHeaderConfig(${SST_CONFIG_OPTS})

source/adios2/toolkit/sst/dp/dp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ extern CP_DP_Interface LoadUcxDP();
2424
#ifdef SST_HAVE_DAOS
2525
extern CP_DP_Interface LoadDaosDP();
2626
#endif /* SST_HAVE_LIBFABRIC */
27-
#ifdef SST_HAVE_MPI_DP
27+
#ifdef ADIOS2_HAVE_MPI
2828
extern CP_DP_Interface LoadMpiDP();
29-
#endif /* SST_HAVE_MPI_DP */
29+
#endif /* ADIOS2_HAVE_MPI */
3030
extern CP_DP_Interface LoadEVpathDP();
3131

3232
typedef struct _DPElement
@@ -79,9 +79,9 @@ CP_DP_Interface SelectDP(CP_Services Svcs, void *CP_Stream, struct _SstParams *P
7979
List = AddDPPossibility(Svcs, CP_Stream, List, LoadDaosDP(), "daos", Params);
8080
#endif /* SST_HAVE_DAOS */
8181

82-
#ifdef SST_HAVE_MPI_DP
82+
#ifdef ADIOS2_HAVE_MPI
8383
List = AddDPPossibility(Svcs, CP_Stream, List, LoadMpiDP(), "mpi", Params);
84-
#endif /* SST_HAVE_MPI_DP */
84+
#endif /* ADIOS2_HAVE_MPI */
8585

8686
int SelectedDP = -1;
8787
int BestPriority = -1;

source/adios2/toolkit/sst/dp/mpi_dp.c

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -766,31 +766,42 @@ static void MpiReleaseTimeStep(CP_Services Svcs, DP_WS_Stream Stream_v, size_t T
766766
*/
767767
static int MpiGetPriority(CP_Services Svcs, void *CP_Stream, struct _SstParams *Params)
768768
{
769+
char *ReasonMsg = NULL;
770+
int ReturnValue = 10;
769771
int IsInitialized = 0;
770-
int provided = 0;
771-
int IsMPICH = 0;
772-
#if defined(MPICH)
773-
IsMPICH = 1;
774-
775772
MPI_Initialized(&IsInitialized);
776773
if (IsInitialized)
777774
{
778-
MPI_Query_thread(&provided);
779-
// Only enabled when MPI_THREAD_MULTIPLE and using MPICH
780-
if (provided == MPI_THREAD_MULTIPLE)
775+
int Provided = 0;
776+
MPI_Query_thread(&Provided);
777+
if (Provided == MPI_THREAD_MULTIPLE)
781778
{
782-
return 100;
779+
#if defined(ADIOS2_SST_HAVE_MPI_DP_HEURISTICS_PASSED)
780+
ReasonMsg = strdup("Heuristics determined good compatibility");
781+
ReturnValue = 10;
782+
#else
783+
ReasonMsg = strdup("Heuristics determined poor compatibility");
784+
ReturnValue = 0;
785+
#endif
786+
}
787+
else
788+
{
789+
ReasonMsg = strdup("MPI_THREAD_MULTIPLE not supported by MPI");
790+
ReturnValue = -1;
783791
}
784792
}
785-
#endif
793+
else
794+
{
795+
ReasonMsg = strdup("MPI_Initialized() failed");
796+
ReturnValue = -1;
797+
}
798+
799+
Svcs->verbose(CP_Stream, DPSummaryVerbose, "mpi_dp priority=%d since: %s.", ReturnValue,
800+
ReasonMsg);
786801

787-
Svcs->verbose(CP_Stream, DPTraceVerbose,
788-
"MPI DP disabled since the following predicate is false: "
789-
"(MPICH=%s AND MPI_initialized=%s AND MPI_THREAD_MULTIPLE=%s)",
790-
IsMPICH ? "true" : "false", IsInitialized ? "true" : "false",
791-
provided == MPI_THREAD_MULTIPLE ? "true" : "false");
802+
free(ReasonMsg);
792803

793-
return -100;
804+
return ReturnValue;
794805
}
795806

796807
/**

0 commit comments

Comments
 (0)