Skip to content

Commit 64715a7

Browse files
authored
Merge pull request #11440 from awlauria/v5.0.x_updated2
v5.0.x updates
2 parents 523a170 + 8970843 commit 64715a7

File tree

11 files changed

+145
-126
lines changed

11 files changed

+145
-126
lines changed

Makefile.am

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Copyright (c) 2006-2022 Cisco Systems, Inc. All rights reserved.
1313
# Copyright (c) 2012-2015 Los Alamos National Security, Inc. All rights reserved.
1414
# Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
15-
# Copyright (c) 2017-2021 Amazon.com, Inc. or its affiliates.
15+
# Copyright (c) 2017-2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
1616
# All Rights reserved.
1717
# Copyright (c) 2020 IBM Corporation. All rights reserved.
1818
# $COPYRIGHT$
@@ -22,6 +22,9 @@
2222
# $HEADER$
2323
#
2424

25+
# There is an assumption in config/Makefile.am that config is the first
26+
# subdirectory in the DIST_SUBDIRS list. If that changes, work may
27+
# be required.
2528
SUBDIRS = config contrib 3rd-party $(MCA_PROJECT_SUBDIRS) test docs
2629
DIST_SUBDIRS = config contrib 3rd-party $(MCA_PROJECT_DIST_SUBDIRS) test docs
2730
EXTRA_DIST = README.md VERSION Doxyfile LICENSE autogen.pl AUTHORS
@@ -34,14 +37,6 @@ dist-hook:
3437
echo "AUTHORS file is empty; aborting distribution"; \
3538
exit 1; \
3639
fi
37-
@if test -n "$(OPAL_MAKEDIST_DISABLE)" ; then \
38-
echo "#########################################################################"; \
39-
echo "#"; \
40-
echo "# make dist is disabled due to the following packages: $(OPAL_MAKEDIST_DISABLE)"; \
41-
echo "#"; \
42-
echo "#########################################################################"; \
43-
exit 1; \
44-
fi
4540

4641
# Check for common symbols. Use a "-hook" to increase the odds that a
4742
# developer will see it at the end of their installation process.

config/Makefile.am

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,27 @@
1515
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
1616
# Copyright (c) 2016 Research Organization for Information Science
1717
# and Technology (RIST). All rights reserved.
18+
# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
1819
# $COPYRIGHT$
1920
#
2021
# Additional copyrights may follow
2122
#
2223
# $HEADER$
2324
#
2425

26+
# This is a weird place for this, but config/ is the first directory that
27+
# is entered, and the dist-hook runs at the end of the current directory,
28+
# so this is the earliest we can run this test.
29+
dist-hook:
30+
@if test -n "$(OPAL_MAKEDIST_DISABLE)" ; then \
31+
echo "#########################################################################"; \
32+
echo "#"; \
33+
echo "# make dist is disabled due to the following packages: $(OPAL_MAKEDIST_DISABLE)"; \
34+
echo "#"; \
35+
echo "#########################################################################"; \
36+
exit 1; \
37+
fi
38+
2539
EXTRA_DIST = \
2640
distscript.sh \
2741
opal_get_version.m4sh \

config/opal_check_ofi.m4

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,16 @@ AC_DEFUN([OPAL_CHECK_OFI],[
137137
AC_CHECK_DECLS([PMIX_PACKAGE_RANK],
138138
[],
139139
[],
140-
[#include <pmix.h>])])
140+
[#include <pmix.h>])
141+
142+
AC_CHECK_MEMBER([struct fi_mr_attr.iface],
143+
[opal_check_fi_mr_attr_iface=1],
144+
[opal_check_fi_mr_attr_iface=0],
145+
[[#include <rdma/fi_domain.h>]])
146+
147+
AC_DEFINE_UNQUOTED([OPAL_OFI_HAVE_FI_MR_IFACE],
148+
[${opal_check_fi_mr_attr_iface}],
149+
[check if iface avaiable in fi_mr_attr])])
141150
142151
CPPFLAGS=${opal_check_ofi_save_CPPFLAGS}
143152
LDFLAGS=${opal_check_ofi_save_LDFLAGS}

config/opal_functions.m4

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,69 @@ dnl #######################################################################
319319
dnl #######################################################################
320320
dnl #######################################################################
321321

322-
m4_copy([OAC_VAR_SCOPE_PUSH], [OPAL_VAR_SCOPE_PUSH])
323-
m4_copy([OAC_VAR_SCOPE_POP], [OPAL_VAR_SCOPE_POP])
322+
AC_DEFUN([OPAL_VAR_SCOPE_INIT],
323+
[opal_var_scope_push()
324+
{
325+
opal_var_scope_push_lineno=$[]1
326+
shift
327+
# First, check to see if any of these variables are already set.
328+
# This is a simple sanity check to ensure we're not already
329+
# overwriting pre-existing variables (that have a non-empty
330+
# value). It's not a perfect check, but at least it's something.
331+
for opal_var_scope_tmp_var in $[]@; do
332+
AS_VAR_SET_IF([$opal_var_scope_tmp_var],
333+
[AS_VAR_COPY([opal_var_scope_tmp_var_val], [$opal_var_scope_tmp_var])
334+
AC_MSG_WARN([Found configure shell variable clash at line $opal_var_scope_push_lineno!])
335+
AC_MSG_WARN([[OPAL_VAR_SCOPE_PUSH] called on "$opal_var_scope_tmp_var",])
336+
AC_MSG_WARN([but it is already defined with value "$opal_var_scope_tmp_var_val"])
337+
AC_MSG_WARN([This usually indicates an error in configure.])
338+
AC_MSG_ERROR([Cannot continue])])
339+
done
340+
AS_UNSET([opal_var_scope_push_lineno])
341+
AS_UNSET([opal_var_scope_tmp_var])
342+
AS_UNSET([opal_var_scope_tmp_var_val])
343+
}
344+
345+
opal_var_scope_pop()
346+
{
347+
# Iterate over all the variables and unset them all
348+
for opal_var_scope_tmp_var in $[]@; do
349+
AS_UNSET([$opal_var_scope_tmp_var])
350+
done
351+
AS_UNSET([opal_var_scope_tmp_var])
352+
}])
353+
354+
# OPAL_VAR_SCOPE_PUSH(vars list)
355+
# ------------------------------
356+
# Scope-check that the vars in the space-separated vars list are not already
357+
# in use. Generate a configure-time error if a conflict is found. Note that
358+
# the in use check is defined as "defined", so even if a var in vars list is
359+
# set outside of OPAL_VAR_SCOPE_PUSH, the check will still trip.
360+
AC_DEFUN([OPAL_VAR_SCOPE_PUSH],[
361+
AC_REQUIRE([OPAL_VAR_SCOPE_INIT])dnl
362+
m4_pushdef([opal_var_scope_stack], [$1])dnl
363+
m4_foreach_w([opal_var_scope_var], [$1],
364+
[m4_set_add([opal_var_scope_active_set], opal_var_scope_var,
365+
[], [m4_fatal([OPAL_VAR_SCOPE_PUSH found the variable ]opal_var_scope_var[
366+
active in a previous scope.])])])dnl
367+
opal_var_scope_push ${LINENO} $1
368+
])dnl
369+
370+
# OPAL_VAR_SCOPE_POP()
371+
# --------------------
372+
# Unset the last set of variables set in OPAL_VAR_SCOPE_POP. Every call to
373+
# OPAL_VAR_SCOPE_PUSH should have a matched call to this macro.
374+
AC_DEFUN([OPAL_VAR_SCOPE_POP],[
375+
AC_REQUIRE([OPAL_VAR_SCOPE_INIT])dnl
376+
m4_ifdef([opal_var_scope_stack], [],
377+
[m4_fatal([OPAL_VAR_SCOPE_POP was called without a defined
378+
variable stack. This usually means that OPAL_VAR_SCOPE_POP was called more
379+
times than OPAL_VAR_SCOPE_PUSH.])])dnl
380+
m4_foreach_w([opal_var_scope_var], opal_var_scope_stack,
381+
[m4_set_remove([opal_var_scope_active_set], opal_var_scope_var)])dnl
382+
opal_var_scope_pop opal_var_scope_stack
383+
m4_popdef([opal_var_scope_stack])dnl
384+
])dnl
324385

325386
dnl #######################################################################
326387
dnl #######################################################################

config/opal_mca.m4

Lines changed: 16 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -455,18 +455,6 @@ AC_DEFUN([MCA_CONFIGURE_FRAMEWORK],[
455455
[AS_IF([test $components_last_result -eq 1], [best_mca_component_priority=]OPAL_EVAL_ARG([MCA_$1_$2_]mca_component[_PRIORITY]))])
456456
])])
457457
458-
# configure components that provide their own configure script.
459-
# It would be really hard to run these for "find first that
460-
# works", so we don't :)
461-
m4_if(OPAL_EVAL_ARG([MCA_$1_]$2[_CONFIGURE_MODE]), [STOP_AT_FIRST], [],
462-
[m4_if(OPAL_EVAL_ARG([MCA_$1_]$2[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY], [],
463-
[m4_if(OPAL_EVAL_ARG([MCA_$1_]$2[_CONFIGURE_MODE]), [PRIORITY], [],
464-
[MCA_CHECK_IGNORED_PRIORITY($1, $2)
465-
AS_IF([test "$3" != "0"],
466-
[MCA_CONFIGURE_ALL_CONFIG_COMPONENTS($1, $2, [all_components],
467-
[static_components], [dso_components],
468-
[static_ltlibs])])])])])
469-
470458
AS_VAR_SET_IF([OPAL_EVAL_ARG([DIRECT_$2])], [
471459
AC_MSG_CHECKING([if direct-selection component exists for $2 framework])
472460
direct_component_happy=no
@@ -640,74 +628,6 @@ AC_DEFUN([MCA_CONFIGURE_M4_CONFIG_COMPONENT],[
640628
unset compile_mode
641629
])
642630

643-
644-
######################################################################
645-
#
646-
# MCA_CONFIGURE_ALL_CONFIG_COMPONENTS
647-
#
648-
# configure all components in the given framework that have configure
649-
# scripts and should be configured according to the usual rules...
650-
#
651-
# USAGE:
652-
# MCA_CONFIGURE_ALL_CONFIG_COMPONENTS(project_name,
653-
# framework_name,
654-
# all_components_variable,
655-
# static_components_variable,
656-
# dso_components_variable,
657-
# static_ltlibs_variable)
658-
#
659-
######################################################################
660-
AC_DEFUN([MCA_CONFIGURE_ALL_CONFIG_COMPONENTS],[
661-
for component_path in $srcdir/$1/mca/$2/* ; do
662-
component="`basename $component_path`"
663-
if test -d $component_path && test -x $component_path/configure ; then
664-
opal_show_subsubsubtitle "MCA component $2:$component (need to configure)"
665-
666-
opal_show_verbose "OPAL_MCA_ALL_CONFIG_COMPONENTS: before, should_build=$8"
667-
MCA_COMPONENT_BUILD_CHECK($1, $2, $component,
668-
[should_build=1], [should_build=0])
669-
MCA_COMPONENT_COMPILE_MODE($1, $2, $component, compile_mode)
670-
opal_show_verbose "OPAL_MCA_ALL_CONFIG_COMPONENTS: after, should_build=$should_build"
671-
672-
if test "$should_build" = "1" ; then
673-
OPAL_CONFIG_SUBDIR([$1/mca/$2/$component],
674-
[$opal_subdir_args],
675-
[should_build=1], [should_build=0])
676-
opal_show_verbose "OPAL_MCA_ALL_CONFIG_COMPONENTS: after subdir, should_build=$should_build"
677-
fi
678-
679-
if test "$should_build" = "1" ; then
680-
# do some extra work to pass flags back from the
681-
# top-level configure, the way a configure.m4
682-
# component would.
683-
infile="$srcdir/$1/mca/$2/$3/post_configure.sh"
684-
if test -f $infile; then
685-
686-
# First check for the ABORT tag
687-
line="`$GREP ABORT= $infile | cut -d= -f2-`"
688-
if test -n "$line" && test "$line" != "no"; then
689-
AC_MSG_WARN([MCA component configure script told me to abort])
690-
AC_MSG_ERROR([cannot continue])
691-
fi
692-
693-
m4_foreach(flags, [LDFLAGS, LIBS],
694-
[[line="`$GREP WRAPPER_EXTRA_]flags[= $infile | cut -d= -f2-`"]
695-
eval "line=$line"
696-
if test -n "$line"; then
697-
$2[_]$3[_WRAPPER_EXTRA_]flags[="$line"]
698-
fi
699-
])dnl
700-
fi
701-
702-
MCA_PROCESS_COMPONENT($1, $2, $component, $3, $4, $5, $6, $compile_mode)
703-
else
704-
MCA_PROCESS_DEAD_COMPONENT($1, $2, $component)
705-
fi
706-
fi
707-
done
708-
])
709-
710-
711631
# MCA_COMPONENT_COMPILE_MODE(project_name (1), framework_name (2),
712632
# component_name (3), compile_mode_variable (4))
713633
# -------------------------------------------------------------------------
@@ -716,17 +636,15 @@ AC_DEFUN([MCA_CONFIGURE_ALL_CONFIG_COMPONENTS],[
716636
# the cached value for subsequent tests. The string is not stored in a cache
717637
# variable (ie .*_cv_.*) because cache variables would not be invalidated
718638
# based on changes to --enable-mca-dso or --enable-mca-static.
719-
#
720-
# NOTE: component_name may not be determined until runtime....
721639
AC_DEFUN([MCA_COMPONENT_COMPILE_MODE],[
722640
OAC_ASSERT_LITERAL([$1], [1])dnl
723641
OAC_ASSERT_LITERAL([$2], [2])dnl
642+
OAC_ASSERT_LITERAL([$3], [3])dnl
724643
725644
AS_VAR_PUSHDEF([compile_mode_cv], [$1_$2_$3_compile_mode])dnl
726645
AS_VAR_SET_IF([compile_mode_cv],
727646
[],
728-
[AS_LITERAL_IF([$3],
729-
[m4_ifdef([MCA_$1_$2_$3_COMPILE_MODE],
647+
[m4_ifdef([MCA_$1_$2_$3_COMPILE_MODE],
730648
[dnl We introduced caching of this check after setting the compile
731649
dnl mode by the substitute macro was common, and there was not a
732650
dnl polymorphic variable assumption in all those macros, so we use
@@ -735,8 +653,7 @@ AC_DEFUN([MCA_COMPONENT_COMPILE_MODE],[
735653
MCA_$1_$2_$3_COMPILE_MODE([$1], [$2], [$3], [component_compile_mode_tmp])
736654
AS_VAR_COPY([compile_mode_cv], [$component_compile_mode_tmp])
737655
OPAL_VAR_SCOPE_POP],
738-
[MCA_COMPONENT_COMPILE_MODE_INTERNAL([$1], [$2], [$3], [compile_mode_cv])])],
739-
[MCA_COMPONENT_COMPILE_MODE_INTERNAL([$1], [$2], [$3], [compile_mode_cv])])])
656+
[MCA_COMPONENT_COMPILE_MODE_INTERNAL([$1], [$2], [$3], [compile_mode_cv])])])
740657
AS_VAR_COPY([$4], [compile_mode_cv])
741658
AS_VAR_POPDEF([compile_mode_cv])dnl
742659
])
@@ -758,10 +675,10 @@ AC_DEFUN([MCA_COMPONENT_COMPILE_MODE_INTERNAL], [
758675
OPAL_VAR_SCOPE_PUSH([compile_mode_internal_tmp SHARED_FRAMEWORK SHARED_COMPONENT STATIC_FRAMEWORK STATIC_COMPONENT])
759676
760677
SHARED_FRAMEWORK="$DSO_$2"
761-
AS_VAR_COPY([SHARED_COMPONENT], [DSO_$2_$3])
678+
SHARED_COMPONENT="$DSO_$2_$3"
762679
763680
STATIC_FRAMEWORK="$STATIC_$2"
764-
AS_VAR_COPY([STATIC_COMPONENT], [STATIC_$2_$3])
681+
STATIC_COMPONENT="$STATIC_$2_$3"
765682
766683
# Look for the most specific specifier between static/dso. If
767684
# there is a tie (either neither or both specified), prefer
@@ -819,8 +736,6 @@ AC_DEFUN([OPAL_MCA_STRIP_LAFILES], [
819736
#---------------------------------------------------------------------
820737
# Final setup work for a given component. It should be known before
821738
# calling that this component can build properly (and exists)
822-
#
823-
# NOTE: component_name may not be determined until runtime....
824739
AC_DEFUN([MCA_PROCESS_COMPONENT],[
825740
AC_REQUIRE([AC_PROG_GREP])
826741
@@ -893,13 +808,13 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
893808
# wishes all LDFLAGS and LIBS to be provided as wrapper flags.
894809
AS_IF([test "$8" = "static"],
895810
[AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_LDFLAGS],
896-
[AS_VAR_COPY([tmp_flags], [$2_$3_WRAPPER_EXTRA_LDFLAGS])],
897-
[AS_VAR_COPY([tmp_flags], [$2_$3_LDFLAGS])])
811+
[tmp_flags=${$2_$3_WRAPPER_EXTRA_LDFLAGS}],
812+
[tmp_flags=${$2_$3_LDFLAGS}])
898813
OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_ldflags], [$tmp_flags])
899814
900815
AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_LIBS],
901-
[AS_VAR_COPY([tmp_flags], [$2_$3_WRAPPER_EXTRA_LIBS])],
902-
[AS_VAR_COPY([tmp_all_flags], [$2_$3_LIBS])
816+
[tmp_flags=${$2_$3_WRAPPER_EXTRA_LIBS}],
817+
[tmp_all_flags=${$2_$3_LIBS}
903818
OPAL_MCA_STRIP_LAFILES([tmp_flags], [$tmp_all_flags])])
904819
OPAL_FLAGS_APPEND_MOVE([mca_wrapper_extra_libs], [$tmp_flags])])
905820
@@ -910,13 +825,12 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
910825
# Since a configure script component can never be used in a
911826
# STOP_AT_FIRST framework, we don't have to implement the else
912827
# clause in the literal check.
913-
AS_LITERAL_IF([$3],
914-
[AS_IF([test "$$2_$3_WRAPPER_EXTRA_CPPFLAGS" != ""],
915-
[m4_if(OPAL_EVAL_ARG([MCA_$1_$2_CONFIGURE_MODE]), [STOP_AT_FIRST], [stop_at_first=1], [stop_at_first=0])
916-
AS_IF([test "$8" = "static" && test "$stop_at_first" = "1"],
917-
[AS_IF([test "$with_devel_headers" = "yes"],
918-
[OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_cppflags], [$$2_$3_WRAPPER_EXTRA_CPPFLAGS])])],
919-
[AC_MSG_WARN([ignoring $2_$3_WRAPPER_EXTRA_CPPFLAGS ($$2_$3_WRAPPER_EXTRA_CPPFLAGS): component conditions not met])])])])
828+
AS_IF([test "$$2_$3_WRAPPER_EXTRA_CPPFLAGS" != ""],
829+
[m4_if(OPAL_EVAL_ARG([MCA_$1_$2_CONFIGURE_MODE]), [STOP_AT_FIRST], [stop_at_first=1], [stop_at_first=0])
830+
AS_IF([test "$8" = "static" && test "$stop_at_first" = "1"],
831+
[AS_IF([test "$with_devel_headers" = "yes"],
832+
[OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_cppflags], [$$2_$3_WRAPPER_EXTRA_CPPFLAGS])])],
833+
[AC_MSG_WARN([ignoring $2_$3_WRAPPER_EXTRA_CPPFLAGS ($$2_$3_WRAPPER_EXTRA_CPPFLAGS): component conditions not met])])])
920834
])
921835

922836

@@ -926,8 +840,6 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
926840
# Final setup work for a component that can not be built. Do the
927841
# last minute checks to make sure the user isn't doing something
928842
# stupid.
929-
#
930-
# NOTE: component_name may not be determined until runtime....
931843
AC_DEFUN([MCA_PROCESS_DEAD_COMPONENT],[
932844
AC_MSG_CHECKING([if MCA component $2:$3 can compile])
933845
AC_MSG_RESULT([no])
@@ -1004,7 +916,7 @@ AC_DEFUN([MCA_COMPONENT_BUILD_CHECK],[
1004916
1005917
# if we were explicitly disabled, don't build :)
1006918
AS_IF([test "$DISABLE_$2" = "1"], [want_component=0])
1007-
AS_VAR_IF([DISABLE_$2_$3], [1], [want_component=0])
919+
AS_IF([test "${DISABLE_$2_$3}" = "1"], [want_component=0])
1008920
1009921
AS_IF([test "$want_component" = "1"], [$4], [$5])
1010922
])

ompi/mca/mtl/ofi/mtl_ofi.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ int ompi_mtl_ofi_register_buffer(struct opal_convertor_t *convertor,
306306
return OMPI_SUCCESS;
307307
}
308308

309+
#if OPAL_OFI_HAVE_FI_MR_IFACE
310+
309311
if ((convertor->flags & CONVERTOR_ACCELERATOR) && ompi_mtl_ofi.hmem_needs_reg) {
310312
/* Register buffer */
311313
int ret;
@@ -343,6 +345,8 @@ int ompi_mtl_ofi_register_buffer(struct opal_convertor_t *convertor,
343345
}
344346
}
345347

348+
#endif
349+
346350
return OMPI_SUCCESS;
347351
}
348352

0 commit comments

Comments
 (0)