Skip to content

Commit

Permalink
Update capabilities detection
Browse files Browse the repository at this point in the history
Capability definition moved to pmix_version.h.
Remove example usage and replace it with a simple
check to exercise the code.

Signed-off-by: Ralph Castain <[email protected]>
  • Loading branch information
rhc54 committed Dec 13, 2023
1 parent 6f6e6f7 commit 8d5060a
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions config/prte_setup_pmix.m4
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ AC_DEFUN([PRTE_CHECK_PMIX_CAP],[
prte_cpp_save=$CPP
CPP="$PMIXCC_PATH -E"
AC_PREPROC_IFELSE(
[AC_LANG_PROGRAM([#include <pmix.h>],
[AC_LANG_PROGRAM([#include <pmix_version.h>],
[#if !defined(PMIX_CAPABILITIES)
#error This PMIx does not have any capability flags
#endif
Expand Down Expand Up @@ -176,27 +176,20 @@ AC_DEFUN([PRTE_CHECK_PMIX],[
# then it definitely does not have the capability flags we're
# looking for.
# We must have this capability. If we don't, abort.
PRTE_CHECK_PMIX_CAP([202311CLI], [],
[AC_MSG_WARN([Your PMIx version is too old.])
AC_MSG_WARN([This PRRTE needs a PMIx with the PMIX_CAP_202311CLI capability flag])
AC_MSG_ERROR([Cannot continue])])
# We'd like to have this capability, but we can handle it if we
# don't.
PRTE_SAD_BECAUSE_PMIX_DOES_NOT_HAVE_CAP_SOMETHING_ELSE=0
PRTE_CHECK_PMIX_CAP([SOMETHING_ELSE], [],
[AC_MSG_WARN([Your PMIx version does not have PMIX_CAP_SOMETHING_ELSE])
AC_MSG_WARN([PRRTE will function, but in a degraded state])
PRTE_SAD_BECAUSE_PMIX_DOES_NOT_HAVE_CAP_SOMETHING_ELSE=1])
AC_DEFINE_UNQUOTED([PRTE_SAD_BECAUSE_PMIX_DOES_NOT_HAVE_CAP_SOMETHING_ELSE],
[$RESULT],
[PRTE is sad because the PMIx we are compiling against does not have PMIX_CAP_SOMETHING_ELSE])
# Test for a capability that we know does not exist, just to make
# sure that CHECK_PMIX_CAP correctly handles it.
PRTE_CHECK_PMIX_CAP([BOGUS], [],
[AC_MSG_WARN([Your PMIx version does not have PMIX_CAP_BOGUS])])
# For now, we just check for the "base" capability to exercise
# this feature - essentially retaining this as an example for
# future times when we actually need to check capabilities
PRTE_CHECK_PMIX_CAP([BASE],
[PRTE_PMIX_BASE_CAPABILITY=1],
[AC_MSG_WARN([Your PMIx version is either does not])
AC_MSG_WARN([the capabilities feature or does not])
AC_MSG_WARN([include the PMIX_CAP_BASE capability flag])
AC_MSG_WARN([Ignoring this for now])
PRTE_PMIX_BASE_CAPABILITY=0])
AC_DEFINE_UNQUOTED([PRTE_PMIX_BASE_CAPABILITY],
[$PRTE_PMIX_BASE_CAPABILITY],
[Whether or not PMIx has the BASE capability flag set])
PRTE_SUMMARY_ADD([Required Packages], [PMIx], [], [$prte_pmix_SUMMARY])
Expand Down

0 comments on commit 8d5060a

Please sign in to comment.