From 56e454647e7f2d8437b0f135cab447b9bbe79c87 Mon Sep 17 00:00:00 2001 From: edoapra Date: Tue, 15 Oct 2024 11:42:19 -0700 Subject: [PATCH] restored PMI_Get_nid since gethostid does not work on ANL Polaris --- CMakeLists.txt | 4 ++++ cmx/src-mpi-pr/groups.c | 10 ++++++++++ comex/cmake/config.h.in | 1 + comex/src-mpi-mt/groups.c | 11 +++++++++++ comex/src-mpi-pr/groups.c | 11 +++++++++++ comex/src-mpi-pt/groups.c | 11 +++++++++++ 6 files changed, 48 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62c5084a4..46ae1f921 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -205,6 +205,10 @@ set (USE_MALLOC 0) if(ENABLE_PROFILING) set (GA_PROFILING 1) endif() +if(USE_CRAYSHASTA) + set(__CRAYXE 1) + # list(APPEND GA_EXTRA_LIBS pmi2) +endif() # hardwire ARMCI configuration options set (HAVE_ARMCI_GROUP_COMM 1) diff --git a/cmx/src-mpi-pr/groups.c b/cmx/src-mpi-pr/groups.c index f0b6ac84a..1e3fb68a5 100644 --- a/cmx/src-mpi-pr/groups.c +++ b/cmx/src-mpi-pr/groups.c @@ -6,6 +6,10 @@ #include +#if defined(__CRAYXE) +# include +#endif + #include "cmx.h" #include "cmx_impl.h" #include "groups.h" @@ -589,6 +593,12 @@ void cmx_group_finalize() static long xgethostid() { +#if defined(__CRAYXE) +#warning CRAY + int nodeid; + PMI_Get_nid(g_state.rank, &nodeid); +#else long nodeid = gethostid(); +#endif return nodeid; } diff --git a/comex/cmake/config.h.in b/comex/cmake/config.h.in index 17027da37..65b84665f 100644 --- a/comex/cmake/config.h.in +++ b/comex/cmake/config.h.in @@ -33,6 +33,7 @@ #cmakedefine01 HAVE_SYS_WEAK_ALIAS_PRAGMA #cmakedefine NDEBUG +#cmakedefine __CRAYXE #cmakedefine01 ENABLE_SYSV diff --git a/comex/src-mpi-mt/groups.c b/comex/src-mpi-mt/groups.c index aafe6ee16..c8d43f7f8 100644 --- a/comex/src-mpi-mt/groups.c +++ b/comex/src-mpi-mt/groups.c @@ -9,6 +9,10 @@ #include +#if defined(__CRAYXE) +# include +#endif + #include "comex.h" #include "comex_impl.h" #include "groups.h" @@ -462,6 +466,13 @@ void comex_group_finalize() static long xgethostid() { +#if defined(__CRAYXE) +#warning CRAY + int nodeid; + PMI_Get_nid(g_state.rank, &nodeid); +#else long nodeid = gethostid(); +#endif + return nodeid; } diff --git a/comex/src-mpi-pr/groups.c b/comex/src-mpi-pr/groups.c index 236422193..aa49233cc 100644 --- a/comex/src-mpi-pr/groups.c +++ b/comex/src-mpi-pr/groups.c @@ -10,6 +10,10 @@ #include +#if defined(__CRAYXE) +# include +#endif + #include "comex.h" #include "comex_impl.h" #include "groups.h" @@ -613,6 +617,13 @@ void comex_group_finalize() static long xgethostid() { +#if defined(__CRAYXE) +#warning CRAY + int nodeid; + PMI_Get_nid(g_state.rank, &nodeid); +#else long nodeid = gethostid(); +#endif + return nodeid; } diff --git a/comex/src-mpi-pt/groups.c b/comex/src-mpi-pt/groups.c index 37bb6ed7f..2fa3f8979 100644 --- a/comex/src-mpi-pt/groups.c +++ b/comex/src-mpi-pt/groups.c @@ -9,6 +9,10 @@ #include +#if defined(__CRAYXE) +# include +#endif + #include "comex.h" #include "comex_impl.h" #include "groups.h" @@ -498,6 +502,13 @@ void comex_group_finalize() static long xgethostid() { +#if defined(__CRAYXE) +#warning CRAY + int nodeid; + PMI_Get_nid(g_state.rank, &nodeid); +#else long nodeid = gethostid(); +#endif + return nodeid; }