diff --git a/autogen.sh b/autogen.sh index ac1a29a2dbd..057c852158b 100755 --- a/autogen.sh +++ b/autogen.sh @@ -237,12 +237,23 @@ set_externals() { check_python3() { echo_n "Checking for Python 3... " PYTHON= - if test 3 = `python -c 'import sys; print(sys.version_info[0])' 2> /dev/null || echo "0"`; then - PYTHON=python - fi - if test -z "$PYTHON" -a 3 = `python3 -c 'import sys; print(sys.version_info[0])' 2> /dev/null || echo "0"`; then - PYTHON=python3 + python_one_liner="import sys; print(sys.version_info[0])" + PYTHON_PATH=`command -v python` + if test "x$PYTHON_PATH" != x ; then + version=`$PYTHON_PATH -c "$python_one_liner"` + if test "$version" = 3 ; then + PYTHON=$PYTHON_PATH + fi + fi + if test "x$PYTHON" = x ; then + PYTHON_PATH=`command -v python3` + if test "x$PYTHON_PATH" != x ; then + version=`$PYTHON_PATH -c "$python_one_liner"` + if test "$version" = 3 ; then + PYTHON=$PYTHON_PATH + fi + fi fi if test -z "$PYTHON" ; then diff --git a/confdb/aclocal_misc.m4 b/confdb/aclocal_misc.m4 index 417531cdf40..6e810b9c307 100644 --- a/confdb/aclocal_misc.m4 +++ b/confdb/aclocal_misc.m4 @@ -3,17 +3,33 @@ dnl AC_DEFUN([PAC_CHECK_PYTHON],[ AC_ARG_VAR([PYTHON], [set to Python 3]) if test -z "$PYTHON" ; then - AC_MSG_CHECKING([Python 3]) PYTHON= python_one_liner="import sys; print(sys.version_info[[0]])" - if test 3 = `python -c "$python_one_liner"`; then - PYTHON=python - elif test 3 = `python3 -c "$python_one_liner"`; then - PYTHON=python3 + + dnl check command 'python' + PYTHON_PATH= + AC_PATH_PROG(PYTHON_PATH, python) + if test "x$PYTHON_PATH" != x ; then + py_version=`$PYTHON_PATH -c "$python_one_liner"` + if test "x$py_version" = x3 ; then + PYTHON=$PYTHON_PATH + fi + fi + dnl PYTHON is still not set, check command 'python3' + if test "x$PYTHON" = x ; then + PYTHON3_PATH= + AC_PATH_PROG(PYTHON3_PATH, python3) + if test "x$PYTHON3_PATH" != x ; then + py3_version=`$PYTHON3_PATH -c "$python_one_liner"` + if test "x$py3_version" = x3 ; then + PYTHON=$PYTHON3_PATH + fi + fi fi - AC_MSG_RESULT($PYTHON) if test -z "$PYTHON" ; then - AC_MSG_WARN([Python 3 not found! Bindings need to be generated before configure.]) + AC_MSG_WARN([Python version 3 not found! Bindings need to be generated before configure.]) + else + AC_MSG_NOTICE([Python version 3 is $PYTHON]) fi fi ]) diff --git a/configure.ac b/configure.ac index 785d33d3a3a..2e0a6f409a4 100644 --- a/configure.ac +++ b/configure.ac @@ -626,7 +626,6 @@ AC_CANONICAL_TARGET # We also need to do this before the F77 and FC test to ensure that we # find the C preprocessor reliably. AC_PROG_CC -AC_PROG_CC_C99 AM_PROG_CC_C_O dnl needed for automake "silent-rules" PAC_PUSH_FLAG([CFLAGS]) AC_PROG_CPP diff --git a/maint/fcrosscompile/configure.ac b/maint/fcrosscompile/configure.ac index 15a729368c1..1a76c81d97e 100644 --- a/maint/fcrosscompile/configure.ac +++ b/maint/fcrosscompile/configure.ac @@ -12,7 +12,6 @@ AC_ARG_WITH(aint-size, AC_PROG_CPP AC_PROG_CC -AC_PROG_CC_C99 AC_CHECK_SIZEOF([char]) AC_CHECK_SIZEOF([short]) AC_CHECK_SIZEOF([int]) diff --git a/maint/local_python/binding_f08.py b/maint/local_python/binding_f08.py index 658dc7b06bc..d499fc97565 100644 --- a/maint/local_python/binding_f08.py +++ b/maint/local_python/binding_f08.py @@ -322,7 +322,12 @@ def process_index(p): if p['param_direction'] == 'in' or p['param_direction'] == 'inout': convert_list_pre.append("%s = %s - 1" % (arg, p['name'])) if p['param_direction'] == 'out' or p['param_direction'] == 'inout': - convert_list_post.append("%s = %s + 1" % (p['name'], arg)) + uses['MPI_UNDEFINED'] = 1 + convert_list_post.append("IF (%s == MPI_UNDEFINED) THEN" % arg) + convert_list_post.append(" %s = %s" % (p['name'], arg)) + convert_list_post.append("ELSE") + convert_list_post.append(" %s = %s + 1" % (p['name'], arg)) + convert_list_post.append("END IF") return (arg, arg) def process_string(p): diff --git a/src/mpi/romio/adio/common/flatten.c b/src/mpi/romio/adio/common/flatten.c index 12607d2ebec..9d233cd5764 100644 --- a/src/mpi/romio/adio/common/flatten.c +++ b/src/mpi/romio/adio/common/flatten.c @@ -182,6 +182,9 @@ static void flatlist_node_grow(ADIOI_Flatlist_node * flat, int idx) } } +static MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count * curr_index); +static void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node * flat, + ADIO_Offset st_offset, MPI_Count * curr_index); static void ADIOI_Optimize_flattened(ADIOI_Flatlist_node * flat_type); /* flatten datatype and add it to Flatlist */ static ADIOI_Flatlist_node *ADIOI_Flatten_datatype(MPI_Datatype datatype) diff --git a/src/mpi/romio/configure.ac b/src/mpi/romio/configure.ac index affb3bf4e11..7d4c338e631 100644 --- a/src/mpi/romio/configure.ac +++ b/src/mpi/romio/configure.ac @@ -31,7 +31,6 @@ AM_MAINTAINER_MODE([enable]) dnl must come before LT_INIT, which AC_REQUIREs AC_PROG_CC AC_PROG_CC -AC_PROG_CC_C99 AM_PROG_CC_C_O PAC_CHECK_VISIBILITY AC_SUBST(VISIBILITY_CFLAGS) diff --git a/src/mpid/ch4/netmod/ofi/init_settings.c b/src/mpid/ch4/netmod/ofi/init_settings.c index 497d254e7c6..a76757df240 100644 --- a/src/mpid/ch4/netmod/ofi/init_settings.c +++ b/src/mpid/ch4/netmod/ofi/init_settings.c @@ -187,7 +187,9 @@ int MPIDI_OFI_init_hints(struct fi_info *hints) } } hints->tx_attr->op_flags = FI_COMPLETION; + /* apply SAS hint to both tx and rx or else ordering may not be guaranteed */ hints->tx_attr->msg_order = FI_ORDER_SAS; + hints->rx_attr->msg_order = FI_ORDER_SAS; /* direct RMA operations supported only with delivery complete mode, * else (AM mode) delivery complete is not required */ if (MPIDI_OFI_ENABLE_RMA || MPIDI_OFI_ENABLE_ATOMICS) { diff --git a/src/mpid/ch4/netmod/ofi/ofi_nic.c b/src/mpid/ch4/netmod/ofi/ofi_nic.c index 8ab3ea5c1be..31c2baeb622 100644 --- a/src/mpid/ch4/netmod/ofi/ofi_nic.c +++ b/src/mpid/ch4/netmod/ofi/ofi_nic.c @@ -80,18 +80,22 @@ bool MPIDI_OFI_nic_already_used(const struct fi_info * prov, struct fi_info ** o /* Setup the multi-NIC data structures to use the fi_info structure given in prov */ static int setup_single_nic(void); +#ifdef HAVE_LIBFABRIC_NIC static int setup_multi_nic(int nic_count); +#endif int MPIDI_OFI_init_multi_nic(struct fi_info *prov) { int mpi_errno = MPI_SUCCESS; int nic_count = 0; - int max_nics = MPIR_CVAR_CH4_OFI_MAX_NICS; +#ifdef HAVE_LIBFABRIC_NIC + int max_nics = MPIR_CVAR_CH4_OFI_MAX_NICS; if (MPIR_CVAR_CH4_OFI_MAX_NICS == 0 || MPIR_CVAR_CH4_OFI_MAX_NICS <= -2) { /* Invalid values for the CVAR will default to single nic */ max_nics = 1; } +#endif /* Count the number of NICs */ struct fi_info *first_prov = NULL; diff --git a/src/mpid/ch4/src/mpidig_win.h b/src/mpid/ch4/src/mpidig_win.h index b346868bfb5..6353bf7def3 100644 --- a/src/mpid/ch4/src/mpidig_win.h +++ b/src/mpid/ch4/src/mpidig_win.h @@ -537,7 +537,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDIG_mpi_win_fence(int massert, MPIR_Win * win) MPL_STATIC_INLINE_PREFIX int MPIDIG_win_shared_query_self(MPIR_Win * win, int rank, MPI_Aint * size, int *disp_unit, void *baseptr) { - if (rank == win->comm_ptr->rank) { + if (rank == win->comm_ptr->rank || (rank == MPI_PROC_NULL && win->comm_ptr->local_size == 1)) { *size = win->size; *disp_unit = win->disp_unit; *((void **) baseptr) = win->base; diff --git a/src/mpl/configure.ac b/src/mpl/configure.ac index c14296be381..1d769aaa5bb 100644 --- a/src/mpl/configure.ac +++ b/src/mpl/configure.ac @@ -16,7 +16,6 @@ AM_INIT_AUTOMAKE([subdir-objects] [-Wall -Werror foreign 1.12.3]) dnl must come before LT_INIT, which AC_REQUIREs AC_PROG_CC AC_PROG_CC -AC_PROG_CC_C99 AM_PROG_CC_C_O AC_USE_SYSTEM_EXTENSIONS diff --git a/src/mpl/src/sock/mpl_host.c b/src/mpl/src/sock/mpl_host.c index 2be8956d002..e71463caf21 100644 --- a/src/mpl/src/sock/mpl_host.c +++ b/src/mpl/src/sock/mpl_host.c @@ -11,15 +11,24 @@ #define MAX_HOSTNAME_LEN MAXHOSTNAMELEN #endif +/* we use a static array here to avoid cleaning up (e.g. with uthash) */ #define MAX_LOCAL_HOSTNAMES (100) static char lhost[MAX_LOCAL_HOSTNAMES][MAX_HOSTNAME_LEN]; static int lhost_count = 0; static void append_lhost(const char *host) { - int i; + if (lhost_count == MAX_LOCAL_HOSTNAMES) { + /* For the rare case when there are more than 100 local IP + * addresses, we only check against the first 100. + * + * MPL_host_is_local is only used in Hydra, and it is not + * fatal to miss some localhost detections. + */ + return; + } - for (i = 0; i < lhost_count; i++) + for (int i = 0; i < lhost_count; i++) if (!strcmp(lhost[i], host)) return; diff --git a/src/pm/hydra/configure.ac b/src/pm/hydra/configure.ac index 695341c85d7..d626776d08e 100644 --- a/src/pm/hydra/configure.ac +++ b/src/pm/hydra/configure.ac @@ -21,7 +21,6 @@ AC_ARG_PROGRAM dnl must come before LT_INIT, which AC_REQUIREs AC_PROG_CC dnl must also come before AC_USE_SYSTEM_EXTENSIONS AC_PROG_CC -AC_PROG_CC_C99 AM_PROG_CC_C_O # also needed by hwloc in embedded mode, must also come early for expansion diff --git a/src/pm/hydra/lib/tools/bootstrap/external/ll.h b/src/pm/hydra/lib/tools/bootstrap/external/ll.h index 3bdd16c6664..7fe23a4dced 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/ll.h +++ b/src/pm/hydra/lib/tools/bootstrap/external/ll.h @@ -15,6 +15,6 @@ HYD_status HYDT_bscd_ll_launch_procs(char **args, struct HYD_proxy *proxy_list, HYD_status HYDT_bscd_ll_query_proxy_id(int *proxy_id); HYD_status HYDT_bscd_ll_query_native_int(int *ret); HYD_status HYDT_bscd_ll_query_node_list(struct HYD_node **node_list); -HYD_status HYDT_bscd_ll_query_env_inherit(const char *env_name, int *ret); +HYD_status HYDT_bscd_ll_query_env_inherit(const char *env_name, int *should_inherit); #endif /* LL_H_INCLUDED */ diff --git a/src/pm/hydra/lib/tools/bootstrap/external/ll_env.c b/src/pm/hydra/lib/tools/bootstrap/external/ll_env.c index 4997262bdc6..be0793443c8 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/ll_env.c +++ b/src/pm/hydra/lib/tools/bootstrap/external/ll_env.c @@ -7,7 +7,7 @@ #include "bsci.h" #include "common.h" -HYD_status HYDT_bscd_ll_query_env_inherit(const char *env_name, int *ret) +HYD_status HYDT_bscd_ll_query_env_inherit(const char *env_name, int *should_inherit) { const char *env_list[] = { "LOADL_STEP_CLASS", "LOADL_STEP_ARGS", "LOADL_STEP_ID", "LOADL_STARTD_PORT", @@ -49,7 +49,7 @@ HYD_status HYDT_bscd_ll_query_env_inherit(const char *env_name, int *ret) HYDU_FUNC_ENTER(); - *ret = !HYDTI_bscd_in_env_list(env_name, env_list); + *should_inherit = !HYDTI_bscd_in_env_list(env_name, env_list); HYDU_FUNC_EXIT(); diff --git a/src/pm/hydra/lib/tools/bootstrap/external/lsf.h b/src/pm/hydra/lib/tools/bootstrap/external/lsf.h index e955c79726f..a4115e07bd9 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/lsf.h +++ b/src/pm/hydra/lib/tools/bootstrap/external/lsf.h @@ -10,6 +10,6 @@ HYD_status HYDT_bscd_lsf_query_native_int(int *ret); HYD_status HYDT_bscd_lsf_query_node_list(struct HYD_node **node_list); -HYD_status HYDT_bscd_lsf_query_env_inherit(const char *env_name, int *ret); +HYD_status HYDT_bscd_lsf_query_env_inherit(const char *env_name, int *should_inherit); #endif /* LSF_H_INCLUDED */ diff --git a/src/pm/hydra/lib/tools/bootstrap/external/lsf_env.c b/src/pm/hydra/lib/tools/bootstrap/external/lsf_env.c index 5f9df2a64b9..c243b51c453 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/lsf_env.c +++ b/src/pm/hydra/lib/tools/bootstrap/external/lsf_env.c @@ -7,7 +7,7 @@ #include "bsci.h" #include "common.h" -HYD_status HYDT_bscd_lsf_query_env_inherit(const char *env_name, int *ret) +HYD_status HYDT_bscd_lsf_query_env_inherit(const char *env_name, int *should_inherit) { const char *env_list[] = { "DISPLAY", "EGO_SERVERDIR", "LSB_TRAPSIGS", "LSF_SERVERDIR", "HOSTTYPE", "LSB_HOSTS", @@ -30,7 +30,7 @@ HYD_status HYDT_bscd_lsf_query_env_inherit(const char *env_name, int *ret) HYDU_FUNC_ENTER(); - *ret = !HYDTI_bscd_in_env_list(env_name, env_list); + *should_inherit = !HYDTI_bscd_in_env_list(env_name, env_list); HYDU_FUNC_EXIT(); diff --git a/src/pm/hydra/lib/tools/bootstrap/external/pbs.h b/src/pm/hydra/lib/tools/bootstrap/external/pbs.h index 6d07f82d391..49956520ab9 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/pbs.h +++ b/src/pm/hydra/lib/tools/bootstrap/external/pbs.h @@ -21,7 +21,7 @@ extern struct HYDT_bscd_pbs_sys_s *HYDT_bscd_pbs_sys; HYD_status HYDT_bscd_pbs_launch_procs(char **args, struct HYD_proxy *proxy_list, int num_hosts, int use_rmk, int *control_fd); -HYD_status HYDT_bscd_pbs_query_env_inherit(const char *env_name, int *ret); +HYD_status HYDT_bscd_pbs_query_env_inherit(const char *env_name, int *should_inherit); HYD_status HYDT_bscd_pbs_wait_for_completion(int timeout); HYD_status HYDT_bscd_pbs_launcher_finalize(void); #endif /* if defined(HAVE_TM_H) */ diff --git a/src/pm/hydra/lib/tools/bootstrap/external/pbs_env.c b/src/pm/hydra/lib/tools/bootstrap/external/pbs_env.c index 403b69686bb..4dc9d6966e3 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/pbs_env.c +++ b/src/pm/hydra/lib/tools/bootstrap/external/pbs_env.c @@ -7,7 +7,7 @@ #include "common.h" #include "pbs.h" -HYD_status HYDT_bscd_pbs_query_env_inherit(const char *env_name, int *ret) +HYD_status HYDT_bscd_pbs_query_env_inherit(const char *env_name, int *should_inherit) { const char *env_list[] = { "PBSCOREDUMP", "PBSDEBUG", @@ -47,7 +47,7 @@ HYD_status HYDT_bscd_pbs_query_env_inherit(const char *env_name, int *ret) HYDU_FUNC_ENTER(); - *ret = !HYDTI_bscd_in_env_list(env_name, env_list); + *should_inherit = !HYDTI_bscd_in_env_list(env_name, env_list); HYDU_FUNC_EXIT(); diff --git a/src/pm/hydra/lib/tools/bootstrap/external/rsh.h b/src/pm/hydra/lib/tools/bootstrap/external/rsh.h index 8cb213f63c9..292cfd017e5 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/rsh.h +++ b/src/pm/hydra/lib/tools/bootstrap/external/rsh.h @@ -8,6 +8,6 @@ #include "hydra.h" -HYD_status HYDT_bscd_rsh_query_env_inherit(const char *env_name, int *ret); +HYD_status HYDT_bscd_rsh_query_env_inherit(const char *env_name, int *should_inherit); #endif /* RSH_H_INCLUDED */ diff --git a/src/pm/hydra/lib/tools/bootstrap/external/rsh_env.c b/src/pm/hydra/lib/tools/bootstrap/external/rsh_env.c index 249c5872b2e..bb6dc763856 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/rsh_env.c +++ b/src/pm/hydra/lib/tools/bootstrap/external/rsh_env.c @@ -7,13 +7,13 @@ #include "bsci.h" #include "common.h" -HYD_status HYDT_bscd_rsh_query_env_inherit(const char *env_name, int *ret) +HYD_status HYDT_bscd_rsh_query_env_inherit(const char *env_name, int *should_inherit) { const char *env_list[] = { "DISPLAY", NULL }; HYDU_FUNC_ENTER(); - *ret = !HYDTI_bscd_in_env_list(env_name, env_list); + *should_inherit = !HYDTI_bscd_in_env_list(env_name, env_list); HYDU_FUNC_EXIT(); diff --git a/src/pm/hydra/lib/tools/bootstrap/external/sge.h b/src/pm/hydra/lib/tools/bootstrap/external/sge.h index 42bc6423b50..038710c72d4 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/sge.h +++ b/src/pm/hydra/lib/tools/bootstrap/external/sge.h @@ -10,6 +10,6 @@ HYD_status HYDT_bscd_sge_query_native_int(int *ret); HYD_status HYDT_bscd_sge_query_node_list(struct HYD_node **node_list); -HYD_status HYDT_bscd_sge_query_env_inherit(const char *env_name, int *ret); +HYD_status HYDT_bscd_sge_query_env_inherit(const char *env_name, int *should_inherit); #endif /* SGE_H_INCLUDED */ diff --git a/src/pm/hydra/lib/tools/bootstrap/external/sge_env.c b/src/pm/hydra/lib/tools/bootstrap/external/sge_env.c index 689a0d1d54b..b8c8b34aadf 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/sge_env.c +++ b/src/pm/hydra/lib/tools/bootstrap/external/sge_env.c @@ -7,7 +7,7 @@ #include "bsci.h" #include "common.h" -HYD_status HYDT_bscd_sge_query_env_inherit(const char *env_name, int *ret) +HYD_status HYDT_bscd_sge_query_env_inherit(const char *env_name, int *should_inherit) { const char *env_list[] = { "DISPLAY", "SGE_ROOT", "SGE_CELL", "SGE_DEBUG_LEVEL", "SGE_QMASTER_PORT", "SGE_O_HOME", "SGE_O_HOST", @@ -26,7 +26,7 @@ HYD_status HYDT_bscd_sge_query_env_inherit(const char *env_name, int *ret) HYDU_FUNC_ENTER(); - *ret = !HYDTI_bscd_in_env_list(env_name, env_list); + *should_inherit = !HYDTI_bscd_in_env_list(env_name, env_list); HYDU_FUNC_EXIT(); diff --git a/src/pm/hydra/lib/tools/bootstrap/external/slurm.h b/src/pm/hydra/lib/tools/bootstrap/external/slurm.h index 026762fb4ed..a351a34507e 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/slurm.h +++ b/src/pm/hydra/lib/tools/bootstrap/external/slurm.h @@ -13,6 +13,6 @@ HYD_status HYDT_bscd_slurm_launch_procs(char **args, struct HYD_proxy *proxy_lis HYD_status HYDT_bscd_slurm_query_proxy_id(int *proxy_id); HYD_status HYDT_bscd_slurm_query_native_int(int *ret); HYD_status HYDT_bscd_slurm_query_node_list(struct HYD_node **node_list); -HYD_status HYDT_bscd_slurm_query_env_inherit(const char *env_name, int *ret); +HYD_status HYDT_bscd_slurm_query_env_inherit(const char *env_name, int *should_inherit); #endif /* SLURM_H_INCLUDED */ diff --git a/src/pm/hydra/lib/tools/bootstrap/external/slurm_env.c b/src/pm/hydra/lib/tools/bootstrap/external/slurm_env.c index 05380b004f9..50f22a9b93f 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/slurm_env.c +++ b/src/pm/hydra/lib/tools/bootstrap/external/slurm_env.c @@ -7,16 +7,16 @@ #include "bsci.h" #include "common.h" -HYD_status HYDT_bscd_slurm_query_env_inherit(const char *env_name, int *ret) +HYD_status HYDT_bscd_slurm_query_env_inherit(const char *env_name, int *should_inherit) { HYDU_FUNC_ENTER(); /* check if envvar starts with SBATCH_, SLURMD_, or SLURM_ */ if (strncmp(env_name, "SBATCH_", 7) == 0 || strncmp(env_name, "SLURMD_", 7) == 0 || strncmp(env_name, "SLURM_", 6) == 0) { - *ret = 1; + *should_inherit = 0; } else { - *ret = 0; + *should_inherit = 1; } HYDU_FUNC_EXIT(); diff --git a/src/pm/hydra/lib/tools/bootstrap/external/ssh.h b/src/pm/hydra/lib/tools/bootstrap/external/ssh.h index 382fd3718f1..752f27c8f41 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/ssh.h +++ b/src/pm/hydra/lib/tools/bootstrap/external/ssh.h @@ -32,7 +32,7 @@ extern struct HYDT_bscd_ssh_time *HYDT_bscd_ssh_time; HYD_status HYDTI_bscd_ssh_store_launch_time(char *hostname); -HYD_status HYDT_bscd_ssh_query_env_inherit(const char *env_name, int *ret); +HYD_status HYDT_bscd_ssh_query_env_inherit(const char *env_name, int *should_inherit); HYD_status HYDT_bscd_ssh_launcher_finalize(void); #endif /* SSH_H_INCLUDED */ diff --git a/src/pm/hydra/lib/tools/bootstrap/external/ssh_env.c b/src/pm/hydra/lib/tools/bootstrap/external/ssh_env.c index f34fc0b5054..f53467c437c 100644 --- a/src/pm/hydra/lib/tools/bootstrap/external/ssh_env.c +++ b/src/pm/hydra/lib/tools/bootstrap/external/ssh_env.c @@ -7,13 +7,13 @@ #include "bsci.h" #include "common.h" -HYD_status HYDT_bscd_ssh_query_env_inherit(const char *env_name, int *ret) +HYD_status HYDT_bscd_ssh_query_env_inherit(const char *env_name, int *should_inherit) { const char *env_list[] = { "DISPLAY", NULL }; HYDU_FUNC_ENTER(); - *ret = !HYDTI_bscd_in_env_list(env_name, env_list); + *should_inherit = !HYDTI_bscd_in_env_list(env_name, env_list); HYDU_FUNC_EXIT(); diff --git a/src/pm/hydra/lib/tools/bootstrap/include/bsci.h b/src/pm/hydra/lib/tools/bootstrap/include/bsci.h index 957801eefc6..22873ee1fa2 100644 --- a/src/pm/hydra/lib/tools/bootstrap/include/bsci.h +++ b/src/pm/hydra/lib/tools/bootstrap/include/bsci.h @@ -63,7 +63,7 @@ struct HYDT_bsci_fns { HYD_status(*query_proxy_id) (int *proxy_id); /** \brief Query if an environment variable should be inherited */ - HYD_status(*query_env_inherit) (const char *env_name, int *ret); + HYD_status(*query_env_inherit) (const char *env_name, int *should_inherit); }; /** \cond */ @@ -186,7 +186,7 @@ HYD_status HYDT_bsci_query_proxy_id(int *proxy_id); * from the user's environment is safe to be propagated to the remote * processes. */ -HYD_status HYDT_bsci_query_env_inherit(const char *env_name, int *ret); +HYD_status HYDT_bsci_query_env_inherit(const char *env_name, int *should_inherit); /** * \brief HYDT_bsci_query_native_int - Query if the RMK integrates diff --git a/src/pm/hydra/lib/utils/env.c b/src/pm/hydra/lib/utils/env.c index df78d506b45..9bc8aaef9a5 100644 --- a/src/pm/hydra/lib/utils/env.c +++ b/src/pm/hydra/lib/utils/env.c @@ -39,37 +39,29 @@ HYD_status HYDU_env_to_str(struct HYD_env *env, char **str) HYD_status HYDU_list_inherited_env(struct HYD_env **env_list) { - char *env_str = NULL, *env_name; - int i, ret; HYD_status status = HYD_SUCCESS; HYDU_FUNC_ENTER(); *env_list = NULL; - i = 0; - while (environ[i]) { + for (int i = 0; environ[i]; i++) { + char *env_str, *env_name; + int should_inherit; + env_str = MPL_strdup(environ[i]); env_name = strtok(env_str, "="); - status = HYDT_bsci_query_env_inherit(env_name, &ret); - HYDU_ERR_POP(status, "error querying environment propagation\n"); - + status = HYDT_bsci_query_env_inherit(env_name, &should_inherit); MPL_free(env_str); - env_str = NULL; + HYDU_ERR_POP(status, "error querying environment propagation\n"); - if (!ret) { - i++; - continue; + if (should_inherit) { + status = HYDU_append_env_str_to_list(environ[i], env_list); + HYDU_ERR_POP(status, "unable to add env to list\n"); } - - status = HYDU_append_env_str_to_list(environ[i], env_list); - HYDU_ERR_POP(status, "unable to add env to list\n"); - - i++; } fn_exit: - MPL_free(env_str); HYDU_FUNC_EXIT(); return status; diff --git a/src/pmi/configure.ac b/src/pmi/configure.ac index eca0ff6efd6..c4aef0c30f9 100644 --- a/src/pmi/configure.ac +++ b/src/pmi/configure.ac @@ -16,7 +16,6 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AM_PROG_AR AC_PROG_CC -AC_PROG_CC_C99 AM_PROG_CC_C_O PAC_C_NO_COMMON diff --git a/src/pmi/src/pmix.c b/src/pmi/src/pmix.c index 9cda26dff85..3dce70dea06 100644 --- a/src/pmi/src/pmix.c +++ b/src/pmi/src/pmix.c @@ -399,11 +399,13 @@ pmix_status_t PMIx_Resolve_peers(const char *nodename, const pmix_nspace_t nspace, pmix_proc_t ** procs, size_t * nprocs) { assert(0); + return PMIX_SUCCESS; } pmix_status_t PMIx_Resolve_nodes(const pmix_nspace_t nspace, char **nodelist) { assert(0); + return PMIX_SUCCESS; } const char *PMIx_Error_string(pmix_status_t status) @@ -415,6 +417,7 @@ pmix_status_t PMIx_Spawn(const pmix_info_t job_info[], size_t ninfo, const pmix_app_t apps[], size_t napps, pmix_nspace_t nspace) { assert(0); + return PMIX_SUCCESS; } /* convert predefined keys/attributes to the server format */ diff --git a/src/util/mpir_pmi.c b/src/util/mpir_pmi.c index d3fb776c337..f567cac624a 100644 --- a/src/util/mpir_pmi.c +++ b/src/util/mpir_pmi.c @@ -142,7 +142,7 @@ int MPIR_pmi_init(void) MPL_env2int("PMI_VERSION", &pmi_version); MPL_env2int("PMI_SUBVERSION", &pmi_subversion); - int has_parent, rank, size, appnum; + int has_parent, rank, size, appnum = -1; SWITCH_PMI(mpi_errno = pmi1_init(&has_parent, &rank, &size, &appnum), mpi_errno = pmi2_init(&has_parent, &rank, &size, &appnum), mpi_errno = pmix_init(&has_parent, &rank, &size, &appnum)); diff --git a/src/util/mpir_pmix.inc b/src/util/mpir_pmix.inc index 089fded51b3..3f3afa859ce 100644 --- a/src/util/mpir_pmix.inc +++ b/src/util/mpir_pmix.inc @@ -93,11 +93,14 @@ static int pmix_init(int *has_parent, int *rank, int *size, int *appnum) /* Get the appnum */ pmi_errno = PMIx_Get(&pmix_proc, PMIX_APPNUM, NULL, 0, &pvalue); - MPIR_ERR_CHKANDJUMP1(pmi_errno != PMIX_SUCCESS, mpi_errno, MPI_ERR_OTHER, - "**pmix_get", "**pmix_get %s", PMIx_Error_string(pmi_errno)); - MPIR_Assert(pvalue->data.uint32 <= INT_MAX); /* overflow check */ - *appnum = (int) pvalue->data.uint32; - PMIX_VALUE_RELEASE(pvalue); + if (pmi_errno != PMIX_ERR_NOT_FOUND) { + MPIR_ERR_CHKANDJUMP1(pmi_errno != PMIX_SUCCESS, mpi_errno, MPI_ERR_OTHER, + "**pmix_get", "**pmix_get %s", PMIx_Error_string(pmi_errno)); + MPIR_Assert(pvalue->data.uint32 <= INT_MAX); /* overflow check */ + *appnum = (int) pvalue->data.uint32; + PMIX_VALUE_RELEASE(pvalue); + } + pmix_value_t value; pmix_value_t *val = &value; @@ -219,14 +222,25 @@ static int pmix_get_parent(const char *key, char *val, int val_size) static bool pmix_get_jobattr(const char *key, char *valbuf) { + bool found = false; pmix_value_t *pvalue; - int pmi_errno = PMIx_Get(NULL, key, NULL, 0, &pvalue); - if (pmi_errno != PMIX_SUCCESS) { - return false; + + /* if this is a non-reserved key, we want to make sure not to block + * by using PMIX_IMMEDIATE */ + pmix_info_t *info; + PMIX_INFO_CREATE(info, 1); + int flag = 1; + PMIx_Info_load(info, PMIX_IMMEDIATE, &flag, PMIX_BOOL); + + int pmi_errno = PMIx_Get(NULL, key, info, 1, &pvalue); + if (pmi_errno == PMIX_SUCCESS) { + strncpy(valbuf, pvalue->data.string, pmi_max_val_size); + PMIX_VALUE_RELEASE(pvalue); + found = true; } - strncpy(valbuf, pvalue->data.string, pmi_max_val_size); - PMIX_VALUE_RELEASE(pvalue); - return true; + PMIX_INFO_FREE(info, 1); + + return found; } static int pmix_barrier(void) diff --git a/test/mpi/autogen.sh b/test/mpi/autogen.sh index e363e27bb42..b23ef4205ef 100755 --- a/test/mpi/autogen.sh +++ b/test/mpi/autogen.sh @@ -12,12 +12,23 @@ echo_n() { check_python3() { echo_n "Checking for Python 3... " PYTHON= - if test 3 = `python -c 'import sys; print(sys.version_info[0])' 2> /dev/null || echo "0"`; then - PYTHON=python - fi - if test -z "$PYTHON" -a 3 = `python3 -c 'import sys; print(sys.version_info[0])' 2> /dev/null || echo "0"`; then - PYTHON=python3 + python_one_liner="import sys; print(sys.version_info[0])" + PYTHON_PATH=`command -v python` + if test "x$PYTHON_PATH" != x ; then + version=`$PYTHON_PATH -c "$python_one_liner"` + if test "$version" = 3 ; then + PYTHON=$PYTHON_PATH + fi + fi + if test "x$PYTHON" = x ; then + PYTHON_PATH=`command -v python3` + if test "x$PYTHON_PATH" != x ; then + version=`$PYTHON_PATH -c "$python_one_liner"` + if test "$version" = 3 ; then + PYTHON=$PYTHON_PATH + fi + fi fi if test -z "$PYTHON" ; then diff --git a/test/mpi/configure.ac b/test/mpi/configure.ac index 826d8deda40..84a75f0726f 100644 --- a/test/mpi/configure.ac +++ b/test/mpi/configure.ac @@ -416,7 +416,6 @@ PAC_CONFIG_SUBDIR_ARGS([dtpools]) # Running C compiler tests AC_PROG_CC -AC_PROG_CC_C99 AM_PROG_CC_C_O AC_USE_SYSTEM_EXTENSIONS diff --git a/test/mpi/dtpools/configure.ac b/test/mpi/dtpools/configure.ac index f47b9e08c0a..e22b3a1a02c 100644 --- a/test/mpi/dtpools/configure.ac +++ b/test/mpi/dtpools/configure.ac @@ -31,7 +31,6 @@ fi # Checks for programs. AC_PROG_AWK AC_PROG_CC -AC_PROG_CC_C99 AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S diff --git a/test/mpi/io/i_noncontig_coll2.c b/test/mpi/io/i_noncontig_coll2.c index 3714fc58b12..390c3ddc82e 100644 --- a/test/mpi/io/i_noncontig_coll2.c +++ b/test/mpi/io/i_noncontig_coll2.c @@ -75,7 +75,7 @@ int cb_gather_name_array(MPI_Comm comm, ADIO_cb_name_array * arrayp) * uses a keyval to cache the name array. We'll just rebuild it if we * need to */ - char my_procname[MPI_MAX_PROCESSOR_NAME], **procname = 0; + char my_procname[MPI_MAX_PROCESSOR_NAME], **procname = 0, *procname_buffer; int *procname_len = NULL, my_procname_len, *disp = NULL, i; int commsize, commrank; ADIO_cb_name_array array = NULL; @@ -121,30 +121,22 @@ int cb_gather_name_array(MPI_Comm comm, ADIO_cb_name_array * arrayp) } #endif + int len_total = 0; + disp = malloc((commsize + 1) * sizeof(int)); + disp[0] = 0; for (i = 0; i < commsize; i++) { /* add one to the lengths because we need to count the * terminator, and we are going to use this list of lengths * again in the gatherv. */ procname_len[i]++; - procname[i] = malloc(procname_len[i]); - if (procname[i] == NULL) { - return -1; - } + len_total += procname_len[i]; + disp[i + 1] = len_total; } - /* create our list of displacements for the gatherv. we're going - * to do everything relative to the start of the region allocated - * for procname[0] - * - * I suppose it is theoretically possible that the distance between - * malloc'd regions could be more than will fit in an int. We don't - * cover that case. - */ - disp = malloc(commsize * sizeof(int)); - disp[0] = 0; - for (i = 1; i < commsize; i++) { - disp[i] = (int) (procname[i] - procname[0]); + procname_buffer = malloc(len_total); + for (i = 0; i < commsize; i++) { + procname[i] = procname_buffer + disp[i]; } } @@ -322,9 +314,10 @@ int main(int argc, char **argv) free(filename); free(cb_config_string); - for (i = 0; i < array->namect; i++) - free(array->names[i]); - free(array->names); + if (mynod == 0) { + free(array->names[0]); + free(array->names); + } free(array); MTest_Finalize(errs); return MTestReturnValue(errs); diff --git a/test/mpi/rma/win_shared_query_null.c b/test/mpi/rma/win_shared_query_null.c index 49bc2f4e059..2328ac1fe35 100644 --- a/test/mpi/rma/win_shared_query_null.c +++ b/test/mpi/rma/win_shared_query_null.c @@ -27,6 +27,19 @@ int main(int argc, char **argv) MTest_Init(&argc, &argv); + size = sizeof(int) * 4; + + /* First test the query on self works */ + MPI_Win_allocate_shared(size, sizeof(int), MPI_INFO_NULL, MPI_COMM_SELF, &my_base, &shm_win); + MPI_Win_shared_query(shm_win, MPI_PROC_NULL, &query_size, &query_disp_unit, &query_base); + if (query_base == NULL || query_size != size || query_disp_unit != sizeof(int)) { + fprintf(stderr, "Self shared query with PROC_NULL: base %p, size %ld, unit %d\n", + query_base, query_size, query_disp_unit); + errors++; + } + MPI_Win_free(&shm_win); + + /* Next test the query with a true shared domain */ MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_split_type(MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED, rank, MPI_INFO_NULL, &shm_comm); @@ -38,8 +51,6 @@ int main(int argc, char **argv) if (shm_nproc < 2) goto exit; - size = sizeof(int) * 4; - /* Allocate zero-byte window on rank 0 and non-zero for others */ if (shm_rank == 0) { MPI_Win_allocate_shared(0, sizeof(int), MPI_INFO_NULL, shm_comm, &my_base, &shm_win);