Skip to content

Miscellaneous cleanups #10246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/ompi_configure_options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dnl $HEADER$
dnl

AC_DEFUN([OMPI_CONFIGURE_OPTIONS],[
opal_show_subtitle "OMPI Configuration options"
opal_show_subtitle "MPI layer configuration options"

#
# Disable MPI layer?
Expand Down Expand Up @@ -231,7 +231,7 @@ AC_DEFINE_UNQUOTED(MPI_PARAM_CHECK, $mpi_param_check,
AC_DEFINE_UNQUOTED(OMPI_PARAM_CHECK, $ompi_param_check,
[Whether we want to check MPI parameters never or possible (an integer constant)])

AC_MSG_CHECKING([if want ompio support])
AC_MSG_CHECKING([if want OMPIO support])
AC_ARG_ENABLE([io-ompio],
[AS_HELP_STRING([--disable-io-ompio],
[Disable the ompio MPI-IO component])])
Expand Down
2 changes: 1 addition & 1 deletion config/ompi_setup_prrte.m4
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[
OPAL_3RDPARTY_WITH([prrte], [prrte], [package_prrte], [1])

AC_ARG_WITH([prrte-bindir],
[AC_HELP_STRING([--with-prrte-bindir=DIR],
[AS_HELP_STRING([--with-prrte-bindir=DIR],
[Search for PRRTE binaries in DIR. Defaults to PRRTE_DIR/bin if not specified])])

prrte_setup_internal_happy=0
Expand Down
2 changes: 1 addition & 1 deletion config/opal_configure_options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dnl $HEADER$
dnl

AC_DEFUN([OPAL_CONFIGURE_OPTIONS],[
opal_show_subtitle "OPAL Configuration options"
opal_show_subtitle "General configuration options"


#
Expand Down
14 changes: 7 additions & 7 deletions config/oshmem_configure_options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ dnl $HEADER$
dnl

AC_DEFUN([OSHMEM_CONFIGURE_OPTIONS],[
opal_show_subtitle "OSHMEM Configuration options"
opal_show_subtitle "OpenSHMEM Configuration options"

AC_SUBST(OSHMEM_LIBSHMEM_EXTRA_LIBS)
AC_SUBST(OSHMEM_LIBSHMEM_EXTRA_LDFLAGS)

#
# Disable Open SHMEM?
#
AC_MSG_CHECKING([if want oshmem])
AC_MSG_CHECKING([if want OpenSHMEM])
AC_ARG_ENABLE([oshmem],
[AS_HELP_STRING([--enable-oshmem],
[Enable building the OpenSHMEM interface (available on Linux only, where it is enabled by default)])])
Expand Down Expand Up @@ -76,7 +76,7 @@ AC_DEFINE_UNQUOTED([OSHMEM_SPEC_COMPAT], [$OSHMEM_SPEC_COMPAT],
#
# Do we want to disable OSHMEM parameter checking at run-time?
#
AC_MSG_CHECKING([if want OSHMEM API parameter checking])
AC_MSG_CHECKING([if want OpenSHMEM API parameter checking])
AC_ARG_WITH([oshmem-param-check],
[AS_HELP_STRING([--with-oshmem-param-check(=VALUE)],
[behavior of OSHMEM API function parameter checking. Valid values are: always, never. If --with-oshmem-param-check is specified with no VALUE argument, it is equivalent to a VALUE of "always"; --without-oshmem-param-check is equivalent to "never" (default: always).])])
Expand Down Expand Up @@ -104,7 +104,7 @@ AC_DEFINE_UNQUOTED(OSHMEM_PARAM_CHECK, $shmem_param_check,
#
AC_ARG_ENABLE([oshmem-profile],
[AS_HELP_STRING([--enable-oshmem-profile],
[enable OSHMEM profiling (default: enabled)])])
[enable OpenSHMEM profiling (default: enabled)])])
AC_MSG_CHECKING([if want pshmem])
AS_IF([test "$enable_oshmem_profile" != "no"],
[AC_MSG_RESULT([yes])],
Expand All @@ -123,17 +123,17 @@ AS_IF([test "$enable_oshmem" = "no" && \
#
# Fortran bindings
#
AC_MSG_CHECKING([if want to build OSHMEM fortran bindings])
AC_MSG_CHECKING([if want to build OpenSHMEM fortran bindings])
AC_ARG_ENABLE([oshmem-fortran],
AS_HELP_STRING([--enable-oshmem-fortran],
[enable OSHMEM Fortran bindings (default: enabled if Fortran compiler found)]))
[enable OpenSHMEM Fortran bindings (default: enabled if Fortran compiler found)]))
if test "$enable_oshmem_fortran" != "no"; then
# If no OMPI FORTRAN, bail
AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -eq $OMPI_FORTRAN_NO_BINDINGS && \
test "$enable_oshmem_fortran" = "yes"],
[AC_MSG_RESULT([bad value OMPI_TRY_FORTRAN_BINDINGS: ($OMPI_TRY_FORTRAN_BINDINGS)])
AC_MSG_WARN([Your request to --enable-oshmem-fortran can only be satisfied if fortran support is enabled in OMPI.
You see this message because OMPI fortran support has been explicitly disabled via --disable-mpi-fortran and OSHMEM fortran support was explicitly enabled with --enable-oshmem-fortran.
You see this message because MPI fortran support has been explicitly disabled via --disable-mpi-fortran and OpenSHMEM fortran support was explicitly enabled with --enable-oshmem-fortran.
Configure will abort because you, a human, have asked for something that cannot be provided.])
AC_MSG_ERROR([Cannot continue])])
if test $OMPI_TRY_FORTRAN_BINDINGS -gt $OMPI_FORTRAN_NO_BINDINGS; then
Expand Down
49 changes: 18 additions & 31 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -128,29 +128,10 @@ AC_DEFUN([OMPI_CHECK_DIR_FOR_SPACES],[
AC_MSG_ERROR([Cannot continue.])])
])

AC_DEFUN([OMPI_CANONICALIZE_PATH],[
case $host_os in
darwin*)
# MacOS does not have "readlink -f" or realpath (at least as
# of MacOS Cataline / 10.15). Instead, use Python, because we
# know MacOS comes with a /usr/bin/python that has
# os.path.realpath.
$2=`/usr/bin/python -c 'import os; print os.path.realpath("'$1'")'`
;;
*)
$2=`readlink -f $1`
;;
esac
])

OMPI_CHECK_DIR_FOR_SPACES([$srcdir], [a], [source tree])
OMPI_CANONICALIZE_PATH([$srcdir], [ompi_dir])
OMPI_CHECK_DIR_FOR_SPACES([$ompi_dir], [an], [absolute source tree])
OMPI_CANONICALIZE_PATH([.], [ompi_dir])
ompi_dir=`pwd`
OMPI_CHECK_DIR_FOR_SPACES([$ompi_dir], [a], [build tree])
OMPI_CHECK_DIR_FOR_SPACES([$srcdir], [a], [source tree])
OMPI_CHECK_DIR_FOR_SPACES([$prefix], [a], [prefix])
OMPI_CANONICALIZE_PATH([$prefix], [ompi_dir])
OMPI_CHECK_DIR_FOR_SPACES([$ompi_dir], [an], [absolute prefix])

opal_show_subtitle "Checking versions"

Expand Down Expand Up @@ -288,17 +269,12 @@ m4_ifdef([project_oshmem],

OPAL_CONFIGURE_OPTIONS

###########################
# Open MPI options
m4_ifdef([project_ompi], [OMPI_CONFIGURE_OPTIONS])
m4_ifdef([project_oshmem], [OSHMEM_CONFIGURE_OPTIONS])

# Set up project specific AM_CONDITIONALs
AS_IF([test "$enable_ompi" != "no"], [project_ompi_amc=true], [project_ompi_amc=false])
m4_ifndef([project_ompi], [project_ompi_amc=false])

AS_IF([test "$enable_oshmem" != "no"], [project_oshmem_amc=true], [project_oshmem_amc="no (disabled)"])
m4_ifndef([project_oshmem], [project_oshmem_amc="no (not available)"])

# Enable/Disable Software-Based Performance Counters Capability
AC_MSG_CHECKING([if want software-based performance counters (SPC)])
AC_ARG_ENABLE([spc],
[AS_HELP_STRING([--enable-spc],
[Enable software-based performance counters capability (default: disabled)])])
Expand All @@ -324,10 +300,21 @@ fi
# The library prefixes must be set before we call OPAL MCA. Here is
# as good a place as any.
m4_ifdef([project_opal],
[OPAL_SET_LIB_NAME([open-pal])])
[OPAL_SET_LIB_NAME([open-pal])])

m4_ifdef([project_ompi],
[OMPI_SET_LIB_NAME([])])
[OMPI_SET_LIB_NAME([])])

###########################
# OSHMEM options
m4_ifdef([project_oshmem], [OSHMEM_CONFIGURE_OPTIONS])

# Set up project specific AM_CONDITIONALs
AS_IF([test "$enable_ompi" != "no"], [project_ompi_amc=true], [project_ompi_amc=false])
m4_ifndef([project_ompi], [project_ompi_amc=false])

AS_IF([test "$enable_oshmem" != "no"], [project_oshmem_amc=true], [project_oshmem_amc="no (disabled)"])
m4_ifndef([project_oshmem], [project_oshmem_amc="no (not available)"])

############################################################################
# Libtool: part one
Expand Down
20 changes: 13 additions & 7 deletions ompi/mpi/java/c/mpi_Info.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,20 @@ JNIEXPORT jlong JNICALL Java_mpi_Info_getNull(JNIEnv *env, jclass clazz)
return (jlong)MPI_INFO_NULL;
}

// At least some versions of jni.h have a global named "jvalue", and
// we get a compiler warning if we have a parameter or variable of the
// same name. So use "ljvalue" instead.
JNIEXPORT void JNICALL Java_mpi_Info_set(
JNIEnv *env, jobject jthis, jlong handle, jstring jkey, jstring jvalue)
JNIEnv *env, jobject jthis, jlong handle, jstring jkey, jstring ljvalue)
{
const char *key = (*env)->GetStringUTFChars(env, jkey, NULL),
*value = (*env)->GetStringUTFChars(env, jvalue, NULL);
const char *key = (*env)->GetStringUTFChars(env, jkey, NULL),
*value = (*env)->GetStringUTFChars(env, ljvalue, NULL);

int rc = MPI_Info_set((MPI_Info)handle, (char*)key, (char*)value);
ompi_java_exceptionCheck(env, rc);

(*env)->ReleaseStringUTFChars(env, jkey, key);
(*env)->ReleaseStringUTFChars(env, jvalue, value);
(*env)->ReleaseStringUTFChars(env, jkey, key);
(*env)->ReleaseStringUTFChars(env, ljvalue, value);
}

JNIEXPORT jstring JNICALL Java_mpi_Info_get(
Expand Down Expand Up @@ -83,9 +86,12 @@ JNIEXPORT jstring JNICALL Java_mpi_Info_get(
return NULL;
}

jstring jvalue = (*env)->NewStringUTF(env, value);
// At least some versions of jni.h have a global named "jvalue",
// and we get a compiler warning if we have a parameter or
// variable of the same name. So use "ljvalue" instead.
jstring ljvalue = (*env)->NewStringUTF(env, value);
free(value);
return jvalue;
return ljvalue;
}

JNIEXPORT void JNICALL Java_mpi_Info_delete(
Expand Down