Skip to content

Split the pmix external component into one for the 1.1.4 release, and… #1739

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 1 commit into from
Jun 1, 2016
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
84 changes: 2 additions & 82 deletions config/opal_check_pmi.m4
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,6 @@ AC_DEFUN([OPAL_CHECK_PMI],[

AC_DEFUN([OPAL_CHECK_PMIX],[

opal_pmix_ext_CPPFLAGS=
opal_pmix_ext_LDFLAGS=
opal_pmix_ext_LIBS=

OPAL_VAR_SCOPE_PUSH([pmix_ext_install_dir opal_pmix_CPPFLAGS_save opal_pmix_LDFLAGS_save opal_pmix_LIBS_save opal_pmix_LD_LIBRARY_PATH_save])

AC_ARG_WITH([pmix],
[AC_HELP_STRING([--with-pmix(=DIR)],
[Build PMIx support. DIR can take one of three values: "internal", "external", or a valid directory name. "internal" (or no DIR value) forces Open MPI to use its internal copy of PMIx. "external" forces Open MPI to use an external installation of PMIx. Supplying a valid directory name also forces Open MPI to use an external installation of PMIx, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI does not support --without-pmix.])])
Expand All @@ -246,7 +240,7 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
AC_MSG_CHECKING([if user requested external PMIx support($with_pmix)])
AS_IF([test -z "$with_pmix" || test "$with_pmix" = "yes" || test "$with_pmix" = "internal"],
[AC_MSG_RESULT([no])
opal_external_pmix_happy="no"],
opal_external_pmix_happy=no],
[AC_MSG_RESULT([yes])
# check for external pmix lib */
AS_IF([test "$with_pmix" = "external"],
Expand All @@ -255,80 +249,6 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
# Make sure we have the headers and libs in the correct location
OPAL_CHECK_WITHDIR([external-pmix], [$pmix_ext_install_dir/include], [pmix.h])
OPAL_CHECK_WITHDIR([external-libpmix], [$pmix_ext_install_dir/lib], [libpmix.*])
AC_MSG_CHECKING([if external component can be used])
OPAL_CHECK_PACKAGE([opal_pmix_ext],
[pmix.h],
[pmix],
[PMIx_Init],
[],
[$pmix_ext_install_dir],
[$pmix_ext_install_dir/lib],
[AC_MSG_RESULT([PMIx external support will be built])
opal_external_pmix_happy=yes],
[opal_external_pmix_happy="no"
AC_MSG_RESULT([no])
AC_MSG_WARN([External PMIx support was requested but failed])
AC_MSG_WARN([as explained above.])
AC_MSG_ERROR([Cannot continue])])
# Check the version
opal_external_pmix_version="unknown"
opal_pmix_CPPFLAGS_save=$CPPFLAGS
opal_pmix_LDFLAGS_save=$LDFLAGS
opal_pmix_LIBS_save=$LIBS
LD_LIBRARY_PATH_orig=$opal_pmix_LD_LIBRARY_PATH_save

CPPFLAGS=$opal_pmix_ext_CPPFLAGS
LDFLAGS=$opal_pmix_ext_LDFLAGS
LIBS=$opal_pmix_ext_LIBS
LD_LIBRARY_PATH=$pmix_ext_install_dir/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

AC_MSG_CHECKING([PMIx library version])
AC_RUN_IFELSE([
AC_LANG_SOURCE([
#include <stdio.h>
#include <stdlib.h>
#include <pmix.h>
#include <pmix/pmix_common.h>

int main(int argc, char **argv)
{
const char * version = NULL;
FILE *f = NULL;
opal_external_pmix_happy=yes])

f = fopen("conftestval", "w");
if( !f ) exit(1);
version = PMIx_Get_version();
fprintf(f, "%s", version);
fclose(f);

return 0;
}
])], [
eval opal_external_pmix_version=`cat conftestval`
AC_MSG_RESULT([$opal_external_pmix_version])
], [
LD_LIBRARY_PATH=$opal_pmix_LD_LIBRARY_PATH_save
export LD_LIBRARY_PATH
opal_external_pmix_happy="no"
AC_MSG_ERROR([External PMIx support requested but could not build/run a test program. Aborting])
], [
LD_LIBRARY_PATH=$opal_pmix_LD_LIBRARY_PATH_save
export LD_LIBRARY_PATH
opal_external_pmix_happy="no"
AC_MSG_ERROR([External PMIx disabled for cross compile. Aborting])
])
CPPFLAGS=$opal_pmix_CPPFLAGS_save
LDFLAGS=$opal_pmix_LDFLAGS_save
LIBS=$opal_pmix_LIBS_save
LD_LIBRARY_PATH=$opal_pmix_LD_LIBRARY_PATH_save

opal_external_pmix_happy="yes"
])

AC_SUBST(opal_pmix_ext_CPPFLAGS)
AC_SUBST(opal_pmix_ext_LDFLAGS)
AC_SUBST(opal_pmix_ext_LIBS)

OPAL_VAR_SCOPE_POP
])
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
# Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014-2015 Mellanox Technologies, Inc.
# All rights reserved.
Expand All @@ -22,25 +22,25 @@ sources = \
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).

if MCA_BUILD_opal_pmix_external_DSO
if MCA_BUILD_opal_pmix_ext114_DSO
component_noinst =
component_install = mca_pmix_external.la
component_install = mca_pmix_ext114.la
else
component_noinst = libmca_pmix_external.la
component_noinst = libmca_pmix_ext114.la
component_install =
endif

mcacomponentdir = $(opallibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_pmix_external_la_SOURCES = $(sources)
mca_pmix_external_la_CFLAGS =
mca_pmix_external_la_CPPFLAGS = $(opal_pmix_ext_CPPFLAGS)
mca_pmix_external_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext_LDFLAGS)
mca_pmix_external_la_LIBADD = $(opal_pmix_ext_LIBS)
mca_pmix_ext114_la_SOURCES = $(sources)
mca_pmix_ext114_la_CFLAGS =
mca_pmix_ext114_la_CPPFLAGS = $(opal_pmix_ext114_CPPFLAGS)
mca_pmix_ext114_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext114_LDFLAGS)
mca_pmix_ext114_la_LIBADD = $(opal_pmix_ext114_LIBS)

noinst_LTLIBRARIES = $(component_noinst)
libmca_pmix_external_la_SOURCES =$(sources)
libmca_pmix_external_la_CFLAGS =
libmca_pmix_external_la_CPPFLAGS = $(opal_pmix_ext_CPPFLAGS)
libmca_pmix_external_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext_LDFLAGS)
libmca_pmix_external_la_LIBADD = $(opal_pmix_ext_LIBS)
libmca_pmix_ext114_la_SOURCES =$(sources)
libmca_pmix_ext114_la_CFLAGS =
libmca_pmix_ext114_la_CPPFLAGS = $(opal_pmix_ext114_CPPFLAGS)
libmca_pmix_ext114_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext114_LDFLAGS)
libmca_pmix_ext114_la_LIBADD = $(opal_pmix_ext114_LIBS)
73 changes: 73 additions & 0 deletions opal/mca/pmix/ext114/configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2011-2013 Los Alamos National Security, LLC.
# All rights reserved.
# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2014-2015 Mellanox Technologies, Inc.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

# MCA_pmix_ext114_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_opal_pmix_ext114_CONFIG],[
AC_CONFIG_FILES([opal/mca/pmix/ext114/Makefile])

AC_REQUIRE([OPAL_CHECK_PMIX])

AS_IF([test "$opal_external_pmix_happy" = "yes"],
[AS_IF([test "$opal_event_external_support" != "yes"],
[AC_MSG_WARN([EXTERNAL PMIX SUPPORT REQUIRES USE OF EXTERNAL LIBEVENT])
AC_MSG_WARN([LIBRARY. THIS LIBRARY MUST POINT TO THE SAME ONE USED])
AC_MSG_WARN([TO BUILD PMIX OR ELSE UNPREDICTABLE BEHAVIOR MAY RESULT])
AC_MSG_ERROR([PLEASE CORRECT THE CONFIGURE COMMAND LINE AND REBUILD])])
AS_IF([test "$opal_hwloc_external_support" != "yes"],
[AC_MSG_WARN([EXTERNAL PMIX SUPPORT REQUIRES USE OF EXTERNAL HWLOC])
AC_MSG_WARN([LIBRARY THIS LIBRARY MUST POINT TO THE SAME ONE USED ])
AC_MSG_WARN([TO BUILD PMIX OR ELSE UNPREDICTABLE BEHAVIOR MAY RESULT])
AC_MSG_ERROR([PLEASE CORRECT THE CONFIGURE COMMAND LINE AND REBUILD])])
external_WRAPPER_EXTRA_CPPFLAGS='-I${includedir}/openmpi/$opal_pmix_external_basedir/pmix -I${includedir}/openmpi/$opal_pmix_external_basedir/pmix/include'
# check for the 1.1.4 version by looking for a function
# which was later removed
AC_MSG_CHECKING([if external component is version 1.1.4])
OPAL_CHECK_PACKAGE([opal_pmix_ext114],
[pmix.h],
[pmix],
[PMIx_Register_errhandler],
[-lpmix],
[$pmix_ext_install_dir],
[$pmix_ext_install_dir/lib],
[AC_MSG_RESULT([yes])
opal_pmix_external_114_happy=yes],
[AC_MSG_RESULT([no])
opal_pmix_external_114_happy=no])

AC_SUBST(opal_pmix_ext114_CPPFLAGS)
AC_SUBST(opal_pmix_ext114_LDFLAGS)
AC_SUBST(opal_pmix_ext114_LIBS)

AS_IF([test "$opal_pmix_external_114_happy" = "yes"],
[$1
# need to set the wrapper flags for static builds
pmix_ext114_WRAPPER_EXTRA_LDFLAGS="$opal_pmix_ext114_LDFLAGS"
pmix_ext114_WRAPPER_EXTRA_LIBS="$opal_pmix_ext114_LIBS"],
[$2])],
[$2])
])dnl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
Expand Down Expand Up @@ -48,7 +48,7 @@
static const char *pmix1_get_nspace(opal_jobid_t jobid);
static void pmix1_register_jobid(opal_jobid_t jobid, const char *nspace);

const opal_pmix_base_module_t opal_pmix_external_module = {
const opal_pmix_base_module_t opal_pmix_ext114_module = {
/* client APIs */
.init = pmix1_client_init,
.finalize = pmix1_client_finalize,
Expand Down Expand Up @@ -99,7 +99,7 @@ static const char *pmix1_get_nspace(opal_jobid_t jobid)
{
opal_pmix1_jobid_trkr_t *jptr;

OPAL_LIST_FOREACH(jptr, &mca_pmix_external_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == jobid) {
return jptr->nspace;
}
Expand All @@ -112,15 +112,15 @@ static void pmix1_register_jobid(opal_jobid_t jobid, const char *nspace)
opal_pmix1_jobid_trkr_t *jptr;

/* if we don't already have it, add this to our jobid tracker */
OPAL_LIST_FOREACH(jptr, &mca_pmix_external_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == jobid) {
return;
}
}
jptr = OBJ_NEW(opal_pmix1_jobid_trkr_t);
(void)strncpy(jptr->nspace, nspace, PMIX_MAX_NSLEN);
jptr->jobid = jobid;
opal_list_append(&mca_pmix_external_component.jobids, &jptr->super);
opal_list_append(&mca_pmix_ext114_component.jobids, &jptr->super);
}

pmix_status_t pmix1_convert_opalrc(int rc)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 Research Organization for Information Science
Expand All @@ -11,8 +11,8 @@
* $HEADER$
*/

#ifndef MCA_PMIX_EXTERNAL_H
#define MCA_PMIX_EXTERNAL_H
#ifndef MCA_PMIX_EXT114_H
#define MCA_PMIX_EXT114_H

#include "opal_config.h"

Expand All @@ -38,11 +38,11 @@ typedef struct {
opal_pmix_base_component_t super;
opal_list_t jobids;
bool native_launch;
} mca_pmix_external_component_t;
} mca_pmix_ext114_component_t;

OPAL_DECLSPEC extern mca_pmix_external_component_t mca_pmix_external_component;
OPAL_DECLSPEC extern mca_pmix_ext114_component_t mca_pmix_ext114_component;

OPAL_DECLSPEC extern const opal_pmix_base_module_t opal_pmix_external_module;
OPAL_DECLSPEC extern const opal_pmix_base_module_t opal_pmix_ext114_module;

/**** INTERNAL OBJECTS ****/
typedef struct {
Expand Down
Loading