Skip to content

Commit

Permalink
Merge pull request #7026 from raffenet/4.2.x-fixes
Browse files Browse the repository at this point in the history
[4.2.x] backport fixes for upcoming 4.2.2
  • Loading branch information
raffenet authored Jun 13, 2024
2 parents aef79f6 + 7439860 commit 0cdbd7d
Show file tree
Hide file tree
Showing 38 changed files with 171 additions and 105 deletions.
21 changes: 16 additions & 5 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 23 additions & 7 deletions confdb/aclocal_misc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
])
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion maint/fcrosscompile/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
7 changes: 6 additions & 1 deletion maint/local_python/binding_f08.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 3 additions & 0 deletions src/mpi/romio/adio/common/flatten.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/mpi/romio/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/mpid/ch4/netmod/ofi/init_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 5 additions & 1 deletion src/mpid/ch4/netmod/ofi/ofi_nic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/mpid/ch4/src/mpidig_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/mpl/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions src/mpl/src/sock/mpl_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion src/pm/hydra/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/pm/hydra/lib/tools/bootstrap/external/ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
4 changes: 2 additions & 2 deletions src/pm/hydra/lib/tools/bootstrap/external/ll_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/pm/hydra/lib/tools/bootstrap/external/lsf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
4 changes: 2 additions & 2 deletions src/pm/hydra/lib/tools/bootstrap/external/lsf_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/pm/hydra/lib/tools/bootstrap/external/pbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down
4 changes: 2 additions & 2 deletions src/pm/hydra/lib/tools/bootstrap/external/pbs_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/pm/hydra/lib/tools/bootstrap/external/rsh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
4 changes: 2 additions & 2 deletions src/pm/hydra/lib/tools/bootstrap/external/rsh_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/pm/hydra/lib/tools/bootstrap/external/sge.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
4 changes: 2 additions & 2 deletions src/pm/hydra/lib/tools/bootstrap/external/sge_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/pm/hydra/lib/tools/bootstrap/external/slurm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
6 changes: 3 additions & 3 deletions src/pm/hydra/lib/tools/bootstrap/external/slurm_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/pm/hydra/lib/tools/bootstrap/external/ssh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
4 changes: 2 additions & 2 deletions src/pm/hydra/lib/tools/bootstrap/external/ssh_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Loading

0 comments on commit 0cdbd7d

Please sign in to comment.