Skip to content

CMake scripts for the MPI dataplane of SST don't work #4297

Open
@franzpoeschel

Description

@franzpoeschel

Describe the bug
The MPI dataplane is not correctly propagated from cmake/DetectOptions.cmake to source/adios2/toolkit/sst/CMakeLists.txt. There are three separate issues:

  1. The availability of the dataplane is not correctly inferred upon configuring (at least on Frontier). A workaround for this is to replace if (ADIOS2_HAVE_MPI_CLIENT_SERVER) in cmake/DetectOptions.cmake with if (TRUE).
  2. cmake/DetectOptions.cmake sets ADIOS2_HAVE_MPI_DP, but source/adios2/toolkit/sst/CMakeLists.txt tries reading ADIOS2_SST_HAVE_MPI (without _DP). Adding a line set(ADIOS2_SST_HAVE_MPI TRUE) in cmake/DetectOptions.cmake works around that.
  3. source/adios2/toolkit/sst/CMakeLists.txt tries reading a variable ADIOS2_SST_BUILD_MPI_DP that is never set.

For building on Frontier with the MPI DP, I currently use:

diff --git a/cmake/DetectOptions.cmake b/cmake/DetectOptions.cmake
index 24e8470b4..a08910a54 100644
--- a/cmake/DetectOptions.cmake
+++ b/cmake/DetectOptions.cmake
@@ -491,8 +491,9 @@ if(ADIOS2_USE_SST AND NOT WIN32)
         }]=]
     ADIOS2_HAVE_MPI_CLIENT_SERVER)
     unset(CMAKE_REQUIRED_LIBRARIES)
-    if (ADIOS2_HAVE_MPI_CLIENT_SERVER)
+    if (TRUE)
       set(ADIOS2_SST_HAVE_MPI_DP TRUE)
+      set(ADIOS2_SST_HAVE_MPI TRUE)
     else()
       if ("${ADIOS2_SST_EXPECT_MPI_DP}") 
           message(FATAL_ERROR "Expected MPI to support Client-server connection model, but test failed.")
diff --git a/source/adios2/toolkit/sst/CMakeLists.txt b/source/adios2/toolkit/sst/CMakeLists.txt
index 4a8252eee..0c13ecc5d 100644
--- a/source/adios2/toolkit/sst/CMakeLists.txt
+++ b/source/adios2/toolkit/sst/CMakeLists.txt
@@ -45,7 +45,7 @@ if(ADIOS2_HAVE_ZFP)
   target_link_libraries(sst PRIVATE zfp::zfp)
 endif()
 
-if(ADIOS2_SST_BUILD_MPI_DP)
+if(TRUE)
   target_sources(sst PRIVATE dp/mpi_dp.c)
   target_link_libraries(sst PRIVATE MPI::MPI_C)
 endif()

To Reproduce
Try a default build on Frontier. I tried building the branch from #3964 which is currently based upon 51128a1. The current master branch (e524dce) looks like it's also affected.

Expected behavior
Correct propagation of the MPI DP, ideally correct automatic recognition, but that's more difficult and system-dependent.

Desktop (please complete the following information):

  • OS/Platform: Frontier
  • Build: /opt/rocm-5.4.3/bin/hipcc, cmake version 3.22.2

Following up
Was the issue fixed? Please report back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions