Skip to content

Commit

Permalink
Merge pull request #7246 from sonjahapp/pr-issue-7243-pmix-header
Browse files Browse the repository at this point in the history
pmi: avoid name clash of pmix.h with external pmix lib

Approved-by: Ken Raffenetti
  • Loading branch information
hzhou authored Jan 3, 2025
2 parents 11bdde0 + 612cebb commit 5483482
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 13 deletions.
8 changes: 6 additions & 2 deletions src/include/mpir_pmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
#endif

#ifdef ENABLE_PMIX
#ifdef PMI_FROM_3RD_PARTY
#include <pmix.h>
#else
#include <pmix/pmix.h>
#endif
#endif

/* Domain options for init-time collectives */
Expand Down Expand Up @@ -111,10 +115,10 @@ int MPIR_pmi_build_nodemap_fallback(int sz, int myrank, int *out_nodemap);
/* A fallback for PMIx_Load_topology. */
typedef struct MPIR_pmi_topology {
const char *source;
void *topology; /* assume hwloc_topology_t is a pointer */
void *topology; /* assume hwloc_topology_t is a pointer */
} MPIR_pmi_topology_t;

int MPIR_pmi_load_hwloc_topology(MPIR_pmi_topology_t *topo);
int MPIR_pmi_load_hwloc_topology(MPIR_pmi_topology_t * topo);
#endif

#endif /* MPIR_PMI_H_INCLUDED */
28 changes: 22 additions & 6 deletions src/pmi/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,24 @@ if EMBEDDED_MODE
noinst_LTLIBRARIES += libpmi.la

else

if DISABLE_PMIX
include_HEADERS = \
include/pmi.h \
include/pmi2.h

else

include_HEADERS = \
include/pmi.h \
include/pmi2.h \
include/pmix.h \
include/pmix_abi_support.h \
include/pmix_abi_support_bottom.h \
include/pmix_fns.h \
include/pmix_macros.h \
include/pmix_types.h
include/pmix/pmix.h \
include/pmix/pmix_abi_support.h \
include/pmix/pmix_abi_support_bottom.h \
include/pmix/pmix_fns.h \
include/pmix/pmix_macros.h \
include/pmix/pmix_types.h
endif

lib_LTLIBRARIES = libpmi.la
endif
Expand All @@ -36,7 +45,14 @@ AM_CPPFLAGS += @mpl_includedir@

libpmi_la_LIBADD = @mpl_lib@ libpmiutil.la

if DISABLE_PMIX
libpmi_la_SOURCES = \
src/pmi_v1.c \
src/pmi_v2.c
else

libpmi_la_SOURCES = \
src/pmi_v1.c \
src/pmi_v2.c \
src/pmix.c
endif
12 changes: 8 additions & 4 deletions src/pmi/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,27 @@ AH_BOTTOM([
])

AC_ARG_ENABLE([pmi1],
AS_HELP_STRING([--disable-pmi1], [disable PMI-v1 protocol])
AS_HELP_STRING([--disable-pmi1], [disable PMI-v1 protocol]),
[if test "$enableval" = "no" ; then
AC_DEFINE(DISABLE_PMI1, 1, [Disable PMI-v1 protocol])
fi
])
AC_ARG_ENABLE([pmi2],
AS_HELP_STRING([--disable-pmi2], [disable PMI2 protocol])
AS_HELP_STRING([--disable-pmi2], [disable PMI2 protocol]),
[if test "$enableval" = "no" ; then
AC_DEFINE(DISABLE_PMI2, 1, [Disable PMI2 protocol])
fi
])
AC_ARG_ENABLE([pmix],
AS_HELP_STRING([--disable-pmix], [disable PMIx protocol])
AS_HELP_STRING([--disable-pmix], [disable PMIx protocol]),
[if test "$enableval" = "no" ; then
AC_DEFINE(DISABLE_PMIX, 1, [Disable PMIx protocol])
enable_pmix=false
else
enable_pmix=true
fi
])
], [enable_pmix=true])
AM_CONDITIONAL([DISABLE_PMIX], [test "x$enable_pmix" = "xfalse"])

AC_ARG_WITH([thread-package],
AS_HELP_STRING([--with-thread-package], [whether to enable threads]))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pmi/src/pmix.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "pmi_config.h"

#include "pmix.h"
#include "pmix/pmix.h"
#include "pmi_util.h"
#include "pmi_wire.h"
#include "pmi_msg.h"
Expand Down
2 changes: 2 additions & 0 deletions test/mpi/util/run_mpitests.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ int main(int argc, char **argv)
MPI_Reduce(&ret, &toterrs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
if (wrank == 0) {
fprintf(test_out, "%s: %d\n", name, toterrs);
fflush(test_out);
}
} else {
if (wrank == 0) {
fprintf(test_out, "%s: not found\n", name);
fflush(test_out);
}
}
}
Expand Down

0 comments on commit 5483482

Please sign in to comment.