Skip to content

Commit

Permalink
Add HIP init before MPI init for MPI issue workaround on Frontier. (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel authored Oct 16, 2023
1 parent d3c1aa4 commit 8571889
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/exawind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ target_link_libraries(${EXAWIND_EXE_NAME} PRIVATE

target_include_directories(${EXAWIND_EXE_NAME} SYSTEM PRIVATE ${YAML_CPP_INCLUDE_DIR})

if(EXAWIND_ENABLE_ROCM)
target_compile_definitions(${EXAWIND_EXE_NAME} PRIVATE EXAWIND_ENABLE_ROCM)
endif()

if(CXX_FILESYSTEM_HAVE_FS)
target_compile_definitions(${EXAWIND_EXE_NAME} PRIVATE EXAWIND_HAS_STD_FILESYSTEM)
target_link_libraries(${EXAWIND_EXE_NAME} PRIVATE
Expand Down
9 changes: 9 additions & 0 deletions app/exawind/exawind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
#include "yaml-cpp/yaml.h"
#include "tioga.h"

// Workaround for MPI issue on OLCF Frontier machine
#ifdef EXAWIND_ENABLE_ROCM
#include <hip/hip_runtime.h>
#endif

static std::string usage(std::string name)
{
return "usage: " + name +
Expand All @@ -36,6 +41,10 @@ replace_extension(const std::string& filepath, const std::string& newExt)

int main(int argc, char** argv)
{
// Workaround for MPI issue on OLCF Frontier machine
#ifdef EXAWIND_ENABLE_ROCM
hipInit(0);
#endif
MPI_Init(&argc, &argv);
int psize, prank;
MPI_Comm_size(MPI_COMM_WORLD, &psize);
Expand Down

0 comments on commit 8571889

Please sign in to comment.