1
1

Merge pull request #2017 from rhc54/topic/pmixconfig

Update configury to support multiple PMIx versions
Этот коммит содержится в:
rhc54 2016-08-25 21:36:34 -05:00 коммит произвёл GitHub
родитель 277c319389 af67f16422
Коммит c0fff60e59
322 изменённых файлов: 6684 добавлений и 1241 удалений

10
.gitignore поставляемый
Просмотреть файл

@ -307,11 +307,11 @@ opal/mca/pmix/pmix*/pmix/src/include/private/autogen/config.h.in
opal/mca/pmix/pmix*/pmix/src/include/private/autogen/config.h
opal/mca/hwloc/base/static-components.h.new.extern
opal/mca/hwloc/base/static-components.h.new.struct
opal/mca/pmix/pmix2x/pmix/src/include/frameworks.h
opal/mca/pmix/pmix2x/pmix/src/mca/pinstalldirs/config/pinstall_dirs.h
opal/mca/pmix/pmix2x/pmix/config/autogen_found_items.m4
opal/mca/pmix/pmix2x/pmix/src/include/pmix_config.h
opal/mca/pmix/pmix2x/pmix/src/include/pmix_config.h.in
opal/mca/pmix/pmix3x/pmix/src/include/frameworks.h
opal/mca/pmix/pmix3x/pmix/src/mca/pinstalldirs/config/pinstall_dirs.h
opal/mca/pmix/pmix3x/pmix/config/autogen_found_items.m4
opal/mca/pmix/pmix3x/pmix/src/include/pmix_config.h
opal/mca/pmix/pmix3x/pmix/src/include/pmix_config.h.in
opal/tools/opal-checkpoint/opal-checkpoint
opal/tools/opal-checkpoint/opal-checkpoint.1

Просмотреть файл

@ -259,13 +259,63 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
opal_external_pmix_save_LDFLAGS=$LDFLAGS
opal_external_pmix_save_LIBS=$LIBS
LDFLAGS="-L$pmix_ext_install_dir/lib $LDFLAGS"
AC_SEARCH_LIBS([PMIx_Register_event_handler], [pmix],
[opal_external_pmix_version=2],
[opal_external_pmix_version=1])
# if the pmix_version.h file does not exist, then
# this must be from a pre-1.1.5 version
AC_MSG_CHECKING([PMIx version])
AC_MSG_RESULT([$opal_external_pmix_version])
CPPFLAGS="-I$pmix_ext_install_dir/include $CPPFLAGS"
AS_IF([test "x`ls $pmix_ext_install_dir/include/pmix_version.h 2> /dev/null`" = "x"],
[AC_MSG_RESULT([version file not found - assuming v1.1.4])
opal_external_pmix_version_found=1
opal_external_pmix_version=114],
[AC_MSG_RESULT([version file found])
opal_external_pmix_version_found=0])
# if it does exist, then we need to parse it to find
# the actual release series
AS_IF([test "$opal_external_pmix_version_found" = "0"],
[AC_MSG_CHECKING([version 3x])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
#include <pmix_version.h>
#if (PMIX_VERSION_MAJOR != 3L)
#error "not version 3"
#endif
], [])],
[AC_MSG_RESULT([found])
opal_external_pmix_version=3X
opal_external_pmix_version_found=1],
[AC_MSG_RESULT([not found])])])
AS_IF([test "$opal_external_pmix_version_found" = "0"],
[AC_MSG_CHECKING([version 2x])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
#include <pmix_version.h>
#if (PMIX_VERSION_MAJOR != 2L)
#error "not version 2"
#endif
], [])],
[AC_MSG_RESULT([found])
opal_external_pmix_version=2X
opal_external_pmix_version_found=1],
[AC_MSG_RESULT([not found])])])
AS_IF([test "$opal_external_pmix_version_found" = "0"],
[AC_MSG_CHECKING([version 1x])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
#include <pmix_version.h>
#if (PMIX_VERSION_MAJOR != 1L)
#error "not version 1"
#endif
], [])],
[AC_MSG_RESULT([found])
opal_external_pmix_version=1X
opal_external_pmix_version_found=1],
[AC_MSG_RESULT([not found])])])
AS_IF([test "x$opal_external_pmix_version" = "x"],
[AC_MSG_WARN([External PMIx support requested, but version])
AC_MSG_WARN([information of the external lib could not])
AC_MSG_WARN([be detected])
AC_MSG_ERROR([cannot continue])])
CPPFLAGS=$opal_external_pmix_save_CPPFLAGS
LDFLAGS=$opal_external_pmix_save_LDFLAGS

Просмотреть файл

@ -250,6 +250,7 @@ m4_ifdef([project_oshmem],
OPAL_CONFIGURE_OPTIONS
OPAL_CHECK_OS_FLAVORS
OPAL_CHECK_CUDA
OPAL_CHECK_PMIX
m4_ifdef([project_orte], [ORTE_CONFIGURE_OPTIONS])
m4_ifdef([project_ompi], [OMPI_CONFIGURE_OPTIONS])
m4_ifdef([project_oshmem], [OSHMEM_CONFIGURE_OPTIONS])

Просмотреть файл

@ -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_ext114_DSO
if MCA_BUILD_opal_pmix_ext11_DSO
component_noinst =
component_install = mca_pmix_ext114.la
component_install = mca_pmix_ext11.la
else
component_noinst = libmca_pmix_ext114.la
component_noinst = libmca_pmix_ext11.la
component_install =
endif
mcacomponentdir = $(opallibdir)
mcacomponent_LTLIBRARIES = $(component_install)
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)
mca_pmix_ext11_la_SOURCES = $(sources)
mca_pmix_ext11_la_CFLAGS =
mca_pmix_ext11_la_CPPFLAGS = $(opal_pmix_ext11_CPPFLAGS)
mca_pmix_ext11_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext11_LDFLAGS)
mca_pmix_ext11_la_LIBADD = $(opal_pmix_ext11_LIBS)
noinst_LTLIBRARIES = $(component_noinst)
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)
libmca_pmix_ext11_la_SOURCES =$(sources)
libmca_pmix_ext11_la_CFLAGS =
libmca_pmix_ext11_la_CPPFLAGS = $(opal_pmix_ext11_CPPFLAGS)
libmca_pmix_ext11_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext11_LDFLAGS)
libmca_pmix_ext11_la_LIBADD = $(opal_pmix_ext11_LIBS)

Просмотреть файл

@ -25,12 +25,10 @@
# $HEADER$
#
# MCA_pmix_ext114_CONFIG([action-if-found], [action-if-not-found])
# MCA_pmix_ext11_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])
AC_DEFUN([MCA_opal_pmix_ext11_CONFIG],[
AC_CONFIG_FILES([opal/mca/pmix/ext11/Makefile])
AS_IF([test "$opal_external_pmix_happy" = "yes"],
[AS_IF([test "$opal_event_external_support" != "yes"],
@ -45,27 +43,28 @@ AC_DEFUN([MCA_opal_pmix_ext114_CONFIG],[
AC_MSG_ERROR([PLEASE CORRECT THE CONFIGURE COMMAND LINE AND REBUILD])])
# check for the 1.1.4 version
AC_MSG_CHECKING([if external component is version 1.x])
AS_IF([test "$opal_external_pmix_version" = "1"],
AC_MSG_CHECKING([if external component is version 1.1.4])
AS_IF([test "$opal_external_pmix_version" = "11" ||
test "$opal_external_pmix_version" = "1X"],
[AC_MSG_RESULT([yes])
opal_pmix_external_114_happy=yes],
opal_pmix_external_11_happy=yes],
[AC_MSG_RESULT([no])
opal_pmix_external_114_happy=no])
opal_pmix_external_11_happy=no])
AS_IF([test "$opal_pmix_external_114_happy" = "yes"],
AS_IF([test "$opal_pmix_external_11_happy" = "yes"],
[$1
# need to set the wrapper flags for static builds
pmix_ext114_WRAPPER_EXTRA_LDFLAGS=$opal_external_pmix_LDFLAGS
pmix_ext114_WRAPPER_EXTRA_LIBS=$opal_external_pmix_LIBS],
pmix_ext11_WRAPPER_EXTRA_LDFLAGS=$opal_external_pmix_LDFLAGS
pmix_ext11_WRAPPER_EXTRA_LIBS=$opal_external_pmix_LIBS],
[$2])],
[$2])
opal_pmix_ext114_CPPFLAGS=$opal_external_pmix_CPPFLAGS
opal_pmix_ext114_LDFLAGS=$opal_external_pmix_LDFLAGS
opal_pmix_ext114_LIBS=$opal_external_pmix_LIBS
opal_pmix_ext11_CPPFLAGS=$opal_external_pmix_CPPFLAGS
opal_pmix_ext11_LDFLAGS=$opal_external_pmix_LDFLAGS
opal_pmix_ext11_LIBS=$opal_external_pmix_LIBS
AC_SUBST([opal_pmix_ext114_CPPFLAGS])
AC_SUBST([opal_pmix_ext114_LDFLAGS])
AC_SUBST([opal_pmix_ext114_LIBS])
AC_SUBST([opal_pmix_ext11_CPPFLAGS])
AC_SUBST([opal_pmix_ext11_LDFLAGS])
AC_SUBST([opal_pmix_ext11_LIBS])
])dnl

Просмотреть файл

@ -49,7 +49,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_ext114_module = {
const opal_pmix_base_module_t opal_pmix_ext11_module = {
/* client APIs */
.init = pmix1_client_init,
.finalize = pmix1_client_finalize,
@ -100,7 +100,7 @@ static const char *pmix1_get_nspace(opal_jobid_t jobid)
{
opal_pmix1_jobid_trkr_t *jptr;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == jobid) {
return jptr->nspace;
}
@ -113,7 +113,7 @@ 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_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == jobid) {
return;
}
@ -121,7 +121,7 @@ static void pmix1_register_jobid(opal_jobid_t jobid, const char *nspace)
jptr = OBJ_NEW(opal_pmix1_jobid_trkr_t);
(void)strncpy(jptr->nspace, nspace, PMIX_MAX_NSLEN);
jptr->jobid = jobid;
opal_list_append(&mca_pmix_ext114_component.jobids, &jptr->super);
opal_list_append(&mca_pmix_ext11_component.jobids, &jptr->super);
}
pmix_status_t pmix1_convert_opalrc(int rc)
@ -287,10 +287,12 @@ pmix_scope_t pmix1_convert_opalscope(opal_pmix_scope_t scope) {
void pmix1_value_load(pmix_value_t *v,
opal_value_t *kv)
{
int ival;
unsigned int ui;
switch(kv->type) {
case OPAL_UNDEF:
v->type = PMIX_UNDEF;
opal_output(0, "TYPE WAS UNDEF");
break;
case OPAL_BOOL:
v->type = PMIX_BOOL;
@ -317,6 +319,7 @@ void pmix1_value_load(pmix_value_t *v,
memcpy(&(v->data.pid), &kv->data.pid, sizeof(pid_t));
break;
case OPAL_INT:
case OPAL_STATUS:
v->type = PMIX_INT;
memcpy(&(v->data.integer), &kv->data.integer, sizeof(int));
break;
@ -341,6 +344,7 @@ void pmix1_value_load(pmix_value_t *v,
memcpy(&(v->data.uint), &kv->data.uint, sizeof(int));
break;
case OPAL_UINT8:
case OPAL_PROC_STATE:
v->type = PMIX_UINT8;
memcpy(&(v->data.uint8), &kv->data.uint8, 1);
break;
@ -349,6 +353,7 @@ void pmix1_value_load(pmix_value_t *v,
memcpy(&(v->data.uint16), &kv->data.uint16, 2);
break;
case OPAL_UINT32:
case OPAL_INFO_DIRECTIVES:
v->type = PMIX_UINT32;
memcpy(&(v->data.uint32), &kv->data.uint32, 4);
break;
@ -379,13 +384,31 @@ void pmix1_value_load(pmix_value_t *v,
v->data.bo.size = 0;
}
break;
case OPAL_VPID:
v->type = PMIX_UINT32;
memcpy(&(v->data.uint32), &kv->data.name.vpid, 4);
break;
case OPAL_PERSIST:
v->type = PMIX_INT;
/* the value is in the uint8_t field, so convert it first */
ival = (int)kv->data.uint8;
memcpy(&(v->data.integer), &ival, sizeof(int));
break;
case OPAL_SCOPE:
case OPAL_DATA_RANGE:
v->type = PMIX_UINT;
ui = (unsigned int)kv->data.uint8;
memcpy(&(v->data.uint), &ui, sizeof(unsigned int));
break;
default:
/* silence warnings */
v->type = PMIX_UNDEF;
break;
}
}
int pmix1_value_unload(opal_value_t *kv,
const char *key,
const pmix_value_t *v)
{
int rc=OPAL_SUCCESS;

Просмотреть файл

@ -11,8 +11,8 @@
* $HEADER$
*/
#ifndef MCA_PMIX_EXT114_H
#define MCA_PMIX_EXT114_H
#ifndef MCA_PMIX_EXT11_H
#define MCA_PMIX_EXT11_H
#include "opal_config.h"
@ -37,11 +37,11 @@ typedef struct {
opal_pmix_base_component_t super;
opal_list_t jobids;
bool native_launch;
} mca_pmix_ext114_component_t;
} mca_pmix_ext11_component_t;
OPAL_DECLSPEC extern mca_pmix_ext114_component_t mca_pmix_ext114_component;
OPAL_DECLSPEC extern mca_pmix_ext11_component_t mca_pmix_ext11_component;
OPAL_DECLSPEC extern const opal_pmix_base_module_t opal_pmix_ext114_module;
OPAL_DECLSPEC extern const opal_pmix_base_module_t opal_pmix_ext11_module;
/**** INTERNAL OBJECTS ****/
typedef struct {
@ -171,6 +171,7 @@ OPAL_MODULE_DECLSPEC pmix_scope_t pmix1_convert_opalscope(opal_pmix_scope_t scop
OPAL_MODULE_DECLSPEC void pmix1_value_load(pmix_value_t *v,
opal_value_t *kv);
OPAL_MODULE_DECLSPEC int pmix1_value_unload(opal_value_t *kv,
const char *key,
const pmix_value_t *v);
END_C_DECLS

Просмотреть файл

@ -124,7 +124,7 @@ int pmix1_client_init(void)
if (NULL != getenv(OPAL_MCA_PREFIX"orte_launch")) {
/* if we were launched by the OMPI RTE, then
* the jobid is in a special format - so get it */
mca_pmix_ext114_component.native_launch = true;
mca_pmix_ext11_component.native_launch = true;
opal_convert_string_to_jobid(&pname.jobid, my_proc.nspace);
} else {
/* we were launched by someone else, so make the
@ -136,7 +136,7 @@ int pmix1_client_init(void)
job = OBJ_NEW(opal_pmix1_jobid_trkr_t);
(void)strncpy(job->nspace, my_proc.nspace, PMIX_MAX_NSLEN);
job->jobid = pname.jobid;
opal_list_append(&mca_pmix_ext114_component.jobids, &job->super);
opal_list_append(&mca_pmix_ext11_component.jobids, &job->super);
pname.vpid = my_proc.rank;
opal_proc_set_name(&pname);
@ -190,7 +190,7 @@ int pmix1_abort(int flag, const char *msg,
/* look thru our list of jobids and find the
* corresponding nspace */
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == ptr->name.jobid) {
job = jptr;
break;
@ -225,7 +225,7 @@ int pmix1_store_local(const opal_process_name_t *proc, opal_value_t *val)
/* look thru our list of jobids and find the
* corresponding nspace */
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == proc->jobid) {
job = jptr;
break;
@ -291,7 +291,7 @@ int pmix1_fence(opal_list_t *procs, int collect_data)
/* look thru our list of jobids and find the
* corresponding nspace */
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == ptr->name.jobid) {
job = jptr;
break;
@ -353,7 +353,7 @@ int pmix1_fencenb(opal_list_t *procs, int collect_data,
/* look thru our list of jobids and find the
* corresponding nspace */
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == ptr->name.jobid) {
job = jptr;
break;
@ -438,7 +438,7 @@ int pmix1_get(const opal_process_name_t *proc, const char *key,
/* look thru our list of jobids and find the
* corresponding nspace */
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == proc->jobid) {
job = jptr;
break;
@ -543,7 +543,7 @@ int pmix1_getnb(const opal_process_name_t *proc, const char *key,
/* look thru our list of jobids and find the
* corresponding nspace */
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == proc->jobid) {
job = jptr;
break;
@ -694,7 +694,7 @@ int pmix1_lookup(opal_list_t *data, opal_list_t *info)
/* transfer the data back */
n=0;
OPAL_LIST_FOREACH(d, data, opal_pmix_pdata_t) {
if (mca_pmix_ext114_component.native_launch) {
if (mca_pmix_ext11_component.native_launch) {
/* if we were launched by the OMPI RTE, then
* the jobid is in a special format - so get it */
opal_convert_string_to_jobid(&d->proc.jobid, pdata[n].proc.nspace);
@ -705,7 +705,7 @@ int pmix1_lookup(opal_list_t *data, opal_list_t *info)
}
/* if we don't already have it, add this to our jobid tracker */
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == d->proc.jobid) {
job = jptr;
break;
@ -715,7 +715,7 @@ int pmix1_lookup(opal_list_t *data, opal_list_t *info)
job = OBJ_NEW(opal_pmix1_jobid_trkr_t);
(void)strncpy(job->nspace, pdata[n].proc.nspace, PMIX_MAX_NSLEN);
job->jobid = d->proc.jobid;
opal_list_append(&mca_pmix_ext114_component.jobids, &job->super);
opal_list_append(&mca_pmix_ext11_component.jobids, &job->super);
}
if (PMIX_RANK_WILDCARD == pdata[n].proc.rank) {
d->proc.vpid = OPAL_VPID_WILDCARD;
@ -757,7 +757,7 @@ static void lk_cbfunc(pmix_status_t status,
for (n=0; n < ndata; n++) {
d = OBJ_NEW(opal_pmix_pdata_t);
opal_list_append(&results, &d->super);
if (mca_pmix_ext114_component.native_launch) {
if (mca_pmix_ext11_component.native_launch) {
/* if we were launched by the OMPI RTE, then
* the jobid is in a special format - so get it */
opal_convert_string_to_jobid(&d->proc.jobid, data[n].proc.nspace);
@ -768,7 +768,7 @@ static void lk_cbfunc(pmix_status_t status,
}
/* if we don't already have it, add this to our jobid tracker */
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == d->proc.jobid) {
job = jptr;
break;
@ -778,7 +778,7 @@ static void lk_cbfunc(pmix_status_t status,
job = OBJ_NEW(opal_pmix1_jobid_trkr_t);
(void)strncpy(job->nspace, data[n].proc.nspace, PMIX_MAX_NSLEN);
job->jobid = d->proc.jobid;
opal_list_append(&mca_pmix_ext114_component.jobids, &job->super);
opal_list_append(&mca_pmix_ext11_component.jobids, &job->super);
}
if (PMIX_RANK_WILDCARD == data[n].proc.rank) {
d->proc.vpid = OPAL_VPID_WILDCARD;
@ -942,7 +942,7 @@ int pmix1_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid)
ret = PMIx_Spawn(pinfo, ninfo, papps, napps, nspace);
if (PMIX_SUCCESS == ret) {
if (mca_pmix_ext114_component.native_launch) {
if (mca_pmix_ext11_component.native_launch) {
/* if we were launched by the OMPI RTE, then
* the jobid is in a special format - so get it */
opal_convert_string_to_jobid(jobid, nspace);
@ -955,7 +955,7 @@ int pmix1_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid)
job = OBJ_NEW(opal_pmix1_jobid_trkr_t);
(void)strncpy(job->nspace, nspace, PMIX_MAX_NSLEN);
job->jobid = *jobid;
opal_list_append(&mca_pmix_ext114_component.jobids, &job->super);
opal_list_append(&mca_pmix_ext11_component.jobids, &job->super);
}
PMIX_APP_FREE(papps, napps);
@ -972,7 +972,7 @@ static void spcbfunc(pmix_status_t status,
rc = pmix1_convert_rc(status);
if (PMIX_SUCCESS == status) {
if (mca_pmix_ext114_component.native_launch) {
if (mca_pmix_ext11_component.native_launch) {
/* if we were launched by the OMPI RTE, then
* the jobid is in a special format - so get it */
opal_convert_string_to_jobid(&jobid, nspace);
@ -985,7 +985,7 @@ static void spcbfunc(pmix_status_t status,
job = OBJ_NEW(opal_pmix1_jobid_trkr_t);
(void)strncpy(job->nspace, nspace, PMIX_MAX_NSLEN);
job->jobid = jobid;
opal_list_append(&mca_pmix_ext114_component.jobids, &job->super);
opal_list_append(&mca_pmix_ext11_component.jobids, &job->super);
}
op->spcbfunc(rc, jobid, op->cbdata);
@ -1063,7 +1063,7 @@ int pmix1_connect(opal_list_t *procs)
/* look thru our list of jobids and find the
* corresponding nspace */
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == ptr->name.jobid) {
job = jptr;
break;
@ -1116,7 +1116,7 @@ int pmix1_connectnb(opal_list_t *procs,
OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) {
/* look thru our list of jobids and find the
* corresponding nspace */
OPAL_LIST_FOREACH(job, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(job, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (job->jobid == ptr->name.jobid) {
(void)strncpy(op->procs[n].nspace, job->nspace, PMIX_MAX_NSLEN);
break;
@ -1155,7 +1155,7 @@ int pmix1_disconnect(opal_list_t *procs)
OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) {
/* look thru our list of jobids and find the
* corresponding nspace */
OPAL_LIST_FOREACH(job, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(job, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (job->jobid == ptr->name.jobid) {
(void)strncpy(parray[n].nspace, job->nspace, PMIX_MAX_NSLEN);
break;
@ -1203,7 +1203,7 @@ int pmix1_disconnectnb(opal_list_t *procs,
OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) {
/* look thru our list of jobids and find the
* corresponding nspace */
OPAL_LIST_FOREACH(job, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(job, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (job->jobid == ptr->name.jobid) {
(void)strncpy(op->procs[n].nspace, job->nspace, PMIX_MAX_NSLEN);
break;
@ -1238,7 +1238,7 @@ int pmix1_resolve_peers(const char *nodename, opal_jobid_t jobid,
nspace = NULL;
} else {
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == jobid) {
job = jptr;
break;
@ -1257,7 +1257,7 @@ int pmix1_resolve_peers(const char *nodename, opal_jobid_t jobid,
for (n=0; n < nprocs; n++) {
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(procs, &nm->super);
if (mca_pmix_ext114_component.native_launch) {
if (mca_pmix_ext11_component.native_launch) {
/* if we were launched by the OMPI RTE, then
* the jobid is in a special format - so get it */
opal_convert_string_to_jobid(&nm->name.jobid, array[n].nspace);
@ -1268,7 +1268,7 @@ int pmix1_resolve_peers(const char *nodename, opal_jobid_t jobid,
}
/* if we don't already have it, add this to our jobid tracker */
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == nm->name.jobid) {
job = jptr;
break;
@ -1278,7 +1278,7 @@ int pmix1_resolve_peers(const char *nodename, opal_jobid_t jobid,
job = OBJ_NEW(opal_pmix1_jobid_trkr_t);
(void)strncpy(job->nspace, nspace, PMIX_MAX_NSLEN);
job->jobid = jobid;
opal_list_append(&mca_pmix_ext114_component.jobids, &job->super);
opal_list_append(&mca_pmix_ext11_component.jobids, &job->super);
}
nm->name.vpid = array[n].rank;
}
@ -1298,7 +1298,7 @@ int pmix1_resolve_nodes(opal_jobid_t jobid, char **nodelist)
/* look thru our list of jobids and find the
* corresponding nspace */
job = NULL;
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == jobid) {
job = jptr;
break;

Просмотреть файл

@ -25,9 +25,9 @@
#include "pmix_ext.h"
/*
* Public string showing the pmix ext114 component version number
* Public string showing the pmix ext11 component version number
*/
const char *opal_pmix_ext114_component_version_string =
const char *opal_pmix_ext11_component_version_string =
"OPAL external pmix1.1.4 MCA component version " OPAL_VERSION;
/*
@ -43,7 +43,7 @@ static int external_component_query(mca_base_module_t **module, int *priority);
* and pointers to our public functions in it
*/
mca_pmix_ext114_component_t mca_pmix_ext114_component = {
mca_pmix_ext11_component_t mca_pmix_ext11_component = {
{
/* First, the mca_component_t struct containing meta information
about the component itself */
@ -56,7 +56,7 @@ mca_pmix_ext114_component_t mca_pmix_ext114_component = {
/* Component name and version */
.mca_component_name = "ext114",
.mca_component_name = "ext11",
MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION),
@ -77,13 +77,13 @@ mca_pmix_ext114_component_t mca_pmix_ext114_component = {
static int external_open(void)
{
OBJ_CONSTRUCT(&mca_pmix_ext114_component.jobids, opal_list_t);
OBJ_CONSTRUCT(&mca_pmix_ext11_component.jobids, opal_list_t);
return OPAL_SUCCESS;
}
static int external_close(void)
{
OPAL_LIST_DESTRUCT(&mca_pmix_ext114_component.jobids);
OPAL_LIST_DESTRUCT(&mca_pmix_ext11_component.jobids);
return OPAL_SUCCESS;
}
@ -101,6 +101,6 @@ static int external_component_query(mca_base_module_t **module, int *priority)
/* we could be a server, so we still need to be considered */
*priority = 5;
}
*module = (mca_base_module_t *)&opal_pmix_ext114_module;
*module = (mca_base_module_t *)&opal_pmix_ext11_module;
return OPAL_SUCCESS;
}

Просмотреть файл

@ -47,43 +47,43 @@
static pmix_status_t server_client_connected_fn(const pmix_proc_t *proc, void* server_object);
static pmix_status_t server_client_finalized_fn(const pmix_proc_t *proc, void* server_object,
pmix_op_cbfunc_t cbfunc, void *cbdata);
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_abort_fn(const pmix_proc_t *proc, void *server_object,
int status, const char msg[],
pmix_proc_t procs[], size_t nprocs,
pmix_op_cbfunc_t cbfunc, void *cbdata);
int status, const char msg[],
pmix_proc_t procs[], size_t nprocs,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_fencenb_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
char *data, size_t ndata,
pmix_modex_cbfunc_t cbfunc, void *cbdata);
const pmix_info_t info[], size_t ninfo,
char *data, size_t ndata,
pmix_modex_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *proc,
const pmix_info_t info[], size_t ninfo,
pmix_modex_cbfunc_t cbfunc, void *cbdata);
const pmix_info_t info[], size_t ninfo,
pmix_modex_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_publish_fn(const pmix_proc_t *proc,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_lookup_fn(const pmix_proc_t *proc, char **keys,
const pmix_info_t info[], size_t ninfo,
pmix_lookup_cbfunc_t cbfunc, void *cbdata);
const pmix_info_t info[], size_t ninfo,
pmix_lookup_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_unpublish_fn(const pmix_proc_t *proc, char **keys,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_spawn_fn(const pmix_proc_t *proc,
const pmix_info_t job_info[], size_t ninfo,
const pmix_app_t apps[], size_t napps,
pmix_spawn_cbfunc_t cbfunc, void *cbdata);
const pmix_info_t job_info[], size_t ninfo,
const pmix_app_t apps[], size_t napps,
pmix_spawn_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_register_events(const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_deregister_events(const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_listener_fn(int listening_sd,
pmix_connection_cbfunc_t cbfunc);
pmix_connection_cbfunc_t cbfunc);
pmix_server_module_t mymodule = {
.client_connected = server_client_connected_fn,
@ -110,7 +110,7 @@ static void opal_opcbfunc(int status, void *cbdata)
pmix1_opalcaddy_t *opalcaddy = (pmix1_opalcaddy_t*)cbdata;
if (NULL != opalcaddy->opcbfunc) {
opalcaddy->opcbfunc(pmix1_convert_opalrc(status), opalcaddy->cbdata);
opalcaddy->opcbfunc(pmix1_convert_opalrc(status), opalcaddy->cbdata);
}
OBJ_RELEASE(opalcaddy);
}
@ -121,35 +121,35 @@ static pmix_status_t server_client_connected_fn(const pmix_proc_t *p, void *serv
opal_process_name_t proc;
if (NULL == host_module || NULL == host_module->client_connected) {
return PMIX_SUCCESS;
return PMIX_SUCCESS;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return pmix1_convert_opalrc(rc);
return pmix1_convert_opalrc(rc);
}
proc.vpid = p->rank;
/* pass it up */
rc = host_module->client_connected(&proc, server_object,
NULL, NULL);
NULL, NULL);
return pmix1_convert_opalrc(rc);
}
static pmix_status_t server_client_finalized_fn(const pmix_proc_t *p, void* server_object,
pmix_op_cbfunc_t cbfunc, void *cbdata)
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
pmix1_opalcaddy_t *opalcaddy;
opal_process_name_t proc;
if (NULL == host_module || NULL == host_module->client_finalized) {
return PMIX_SUCCESS;
return PMIX_SUCCESS;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return pmix1_convert_opalrc(rc);
return pmix1_convert_opalrc(rc);
}
proc.vpid = p->rank;
@ -161,15 +161,15 @@ static pmix_status_t server_client_finalized_fn(const pmix_proc_t *p, void* serv
/* pass it up */
rc = host_module->client_finalized(&proc, server_object, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
OBJ_RELEASE(opalcaddy);
}
return pmix1_convert_opalrc(rc);
}
static pmix_status_t server_abort_fn(const pmix_proc_t *p, void *server_object,
int status, const char msg[],
pmix_proc_t procs[], size_t nprocs,
pmix_op_cbfunc_t cbfunc, void *cbdata)
int status, const char msg[],
pmix_proc_t procs[], size_t nprocs,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
size_t n;
opal_namelist_t *nm;
@ -178,12 +178,12 @@ static pmix_status_t server_abort_fn(const pmix_proc_t *p, void *server_object,
pmix1_opalcaddy_t *opalcaddy;
if (NULL == host_module || NULL == host_module->abort) {
return PMIX_ERR_NOT_SUPPORTED;
return PMIX_ERR_NOT_SUPPORTED;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return pmix1_convert_opalrc(rc);
return pmix1_convert_opalrc(rc);
}
proc.vpid = p->rank;
@ -194,24 +194,24 @@ static pmix_status_t server_abort_fn(const pmix_proc_t *p, void *server_object,
/* convert the array of pmix_proc_t to the list of procs */
for (n=0; n < nprocs; n++) {
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == procs[n].rank) {
nm->name.vpid = OPAL_VPID_WILDCARD;
} else {
nm->name.vpid = procs[n].rank;
}
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == procs[n].rank) {
nm->name.vpid = OPAL_VPID_WILDCARD;
} else {
nm->name.vpid = procs[n].rank;
}
}
/* pass it up */
rc = host_module->abort(&proc, server_object, status, msg,
&opalcaddy->procs, opal_opcbfunc, opalcaddy);
&opalcaddy->procs, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
OBJ_RELEASE(opalcaddy);
}
return pmix1_convert_opalrc(rc);
}
@ -221,32 +221,32 @@ static void _data_release(void *cbdata)
pmix1_opalcaddy_t *opalcaddy = (pmix1_opalcaddy_t*)cbdata;
if (NULL != opalcaddy->odmdxfunc) {
opalcaddy->odmdxfunc(opalcaddy->ocbdata);
opalcaddy->odmdxfunc(opalcaddy->ocbdata);
}
OBJ_RELEASE(opalcaddy);
}
static void opmdx_response(int status, const char *data, size_t sz, void *cbdata,
opal_pmix_release_cbfunc_t relcbfunc, void *relcbdata)
opal_pmix_release_cbfunc_t relcbfunc, void *relcbdata)
{
pmix_status_t rc;
pmix1_opalcaddy_t *opalcaddy = (pmix1_opalcaddy_t*)cbdata;
rc = pmix1_convert_rc(status);
if (NULL != opalcaddy->mdxcbfunc) {
opalcaddy->odmdxfunc = relcbfunc;
opalcaddy->ocbdata = relcbdata;
opalcaddy->mdxcbfunc(rc, data, sz, opalcaddy->cbdata,
_data_release, opalcaddy);
opalcaddy->odmdxfunc = relcbfunc;
opalcaddy->ocbdata = relcbdata;
opalcaddy->mdxcbfunc(rc, data, sz, opalcaddy->cbdata,
_data_release, opalcaddy);
} else {
OBJ_RELEASE(opalcaddy);
OBJ_RELEASE(opalcaddy);
}
}
static pmix_status_t server_fencenb_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
char *data, size_t ndata,
pmix_modex_cbfunc_t cbfunc, void *cbdata)
const pmix_info_t info[], size_t ninfo,
char *data, size_t ndata,
pmix_modex_cbfunc_t cbfunc, void *cbdata)
{
pmix1_opalcaddy_t *opalcaddy;
size_t n;
@ -255,7 +255,7 @@ static pmix_status_t server_fencenb_fn(const pmix_proc_t procs[], size_t nprocs,
int rc;
if (NULL == host_module || NULL == host_module->fence_nb) {
return PMIX_ERR_NOT_SUPPORTED;
return PMIX_ERR_NOT_SUPPORTED;
}
/* setup the caddy */
@ -265,42 +265,42 @@ static pmix_status_t server_fencenb_fn(const pmix_proc_t procs[], size_t nprocs,
/* convert the array of pmix_proc_t to the list of procs */
for (n=0; n < nprocs; n++) {
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == procs[n].rank) {
nm->name.vpid = OPAL_VPID_WILDCARD;
} else {
nm->name.vpid = procs[n].rank;
}
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == procs[n].rank) {
nm->name.vpid = OPAL_VPID_WILDCARD;
} else {
nm->name.vpid = procs[n].rank;
}
}
/* convert the array of pmix_info_t to the list of info */
for (n=0; n < ninfo; n++) {
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->fence_nb(&opalcaddy->procs, &opalcaddy->info,
data, ndata, opmdx_response, opalcaddy);
data, ndata, opmdx_response, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
OBJ_RELEASE(opalcaddy);
}
return pmix1_convert_opalrc(rc);
}
static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *p,
const pmix_info_t info[], size_t ninfo,
pmix_modex_cbfunc_t cbfunc, void *cbdata)
const pmix_info_t info[], size_t ninfo,
pmix_modex_cbfunc_t cbfunc, void *cbdata)
{
int rc;
pmix1_opalcaddy_t *opalcaddy;
@ -309,17 +309,17 @@ static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *p,
size_t n;
if (NULL == host_module || NULL == host_module->direct_modex) {
return PMIX_ERR_NOT_SUPPORTED;
return PMIX_ERR_NOT_SUPPORTED;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return pmix1_convert_opalrc(rc);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == p->rank) {
proc.vpid = OPAL_VPID_WILDCARD;
proc.vpid = OPAL_VPID_WILDCARD;
} else {
proc.vpid = p->rank;
proc.vpid = p->rank;
}
/* setup the caddy */
@ -329,29 +329,29 @@ static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *p,
/* convert the array of pmix_info_t to the list of info */
for (n=0; n < ninfo; n++) {
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->direct_modex(&proc, &opalcaddy->info, opmdx_response, opalcaddy);
if (OPAL_SUCCESS != rc && OPAL_ERR_IN_PROCESS != rc) {
OBJ_RELEASE(opalcaddy);
OBJ_RELEASE(opalcaddy);
}
if (OPAL_ERR_IN_PROCESS == rc) {
rc = OPAL_SUCCESS;
rc = OPAL_SUCCESS;
}
return pmix1_convert_opalrc(rc);
}
static pmix_status_t server_publish_fn(const pmix_proc_t *p,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
size_t n;
@ -360,17 +360,17 @@ static pmix_status_t server_publish_fn(const pmix_proc_t *p,
opal_value_t *oinfo;
if (NULL == host_module || NULL == host_module->publish) {
return PMIX_ERR_NOT_SUPPORTED;
return PMIX_ERR_NOT_SUPPORTED;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return pmix1_convert_opalrc(rc);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == p->rank) {
proc.vpid = OPAL_VPID_WILDCARD;
proc.vpid = OPAL_VPID_WILDCARD;
} else {
proc.vpid = p->rank;
proc.vpid = p->rank;
}
/* setup the caddy */
@ -380,27 +380,27 @@ static pmix_status_t server_publish_fn(const pmix_proc_t *p,
/* convert the info array */
for (n=0; n < ninfo; n++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->publish(&proc, &opalcaddy->info, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
OBJ_RELEASE(opalcaddy);
}
return pmix1_convert_opalrc(rc);
}
static void opal_lkupcbfunc(int status,
opal_list_t *data,
void *cbdata)
opal_list_t *data,
void *cbdata)
{
pmix1_opalcaddy_t *opalcaddy = (pmix1_opalcaddy_t*)cbdata;
pmix_status_t rc;
@ -409,28 +409,28 @@ static void opal_lkupcbfunc(int status,
opal_pmix_pdata_t *p;
if (NULL != opalcaddy->lkupcbfunc) {
rc = pmix1_convert_opalrc(status);
/* convert any returned data */
if (NULL != data) {
nd = opal_list_get_size(data);
PMIX_PDATA_CREATE(d, nd);
n=0;
OPAL_LIST_FOREACH(p, data, opal_pmix_pdata_t) {
/* convert the jobid */
(void)opal_snprintf_jobid(d[n].proc.nspace, PMIX_MAX_NSLEN, p->proc.jobid);
d[n].proc.rank = p->proc.vpid;
(void)strncpy(d[n].key, p->value.key, PMIX_MAX_KEYLEN);
pmix1_value_load(&d[n].value, &p->value);
}
}
opalcaddy->lkupcbfunc(rc, d, nd, opalcaddy->cbdata);
rc = pmix1_convert_opalrc(status);
/* convert any returned data */
if (NULL != data) {
nd = opal_list_get_size(data);
PMIX_PDATA_CREATE(d, nd);
n=0;
OPAL_LIST_FOREACH(p, data, opal_pmix_pdata_t) {
/* convert the jobid */
(void)opal_snprintf_jobid(d[n].proc.nspace, PMIX_MAX_NSLEN, p->proc.jobid);
d[n].proc.rank = p->proc.vpid;
(void)strncpy(d[n].key, p->value.key, PMIX_MAX_KEYLEN);
pmix1_value_load(&d[n].value, &p->value);
}
}
opalcaddy->lkupcbfunc(rc, d, nd, opalcaddy->cbdata);
}
OBJ_RELEASE(opalcaddy);
}
static pmix_status_t server_lookup_fn(const pmix_proc_t *p, char **keys,
const pmix_info_t info[], size_t ninfo,
pmix_lookup_cbfunc_t cbfunc, void *cbdata)
const pmix_info_t info[], size_t ninfo,
pmix_lookup_cbfunc_t cbfunc, void *cbdata)
{
int rc;
pmix1_opalcaddy_t *opalcaddy;
@ -439,17 +439,17 @@ static pmix_status_t server_lookup_fn(const pmix_proc_t *p, char **keys,
size_t n;
if (NULL == host_module || NULL == host_module->lookup) {
return PMIX_ERR_NOT_SUPPORTED;
return PMIX_ERR_NOT_SUPPORTED;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return pmix1_convert_opalrc(rc);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == p->rank) {
proc.vpid = OPAL_VPID_WILDCARD;
proc.vpid = OPAL_VPID_WILDCARD;
} else {
proc.vpid = p->rank;
proc.vpid = p->rank;
}
/* setup the caddy */
@ -459,19 +459,19 @@ static pmix_status_t server_lookup_fn(const pmix_proc_t *p, char **keys,
/* convert the array of pmix_info_t to the list of info */
for (n=0; n < ninfo; n++) {
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->lookup(&proc, keys, &opalcaddy->info, opal_lkupcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
OBJ_RELEASE(opalcaddy);
}
return pmix1_convert_opalrc(rc);
@ -479,8 +479,8 @@ static pmix_status_t server_lookup_fn(const pmix_proc_t *p, char **keys,
static pmix_status_t server_unpublish_fn(const pmix_proc_t *p, char **keys,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
pmix1_opalcaddy_t *opalcaddy;
@ -489,17 +489,17 @@ static pmix_status_t server_unpublish_fn(const pmix_proc_t *p, char **keys,
size_t n;
if (NULL == host_module || NULL == host_module->unpublish) {
return PMIX_SUCCESS;
return PMIX_SUCCESS;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return pmix1_convert_opalrc(rc);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == p->rank) {
proc.vpid = OPAL_VPID_WILDCARD;
proc.vpid = OPAL_VPID_WILDCARD;
} else {
proc.vpid = p->rank;
proc.vpid = p->rank;
}
/* setup the caddy */
@ -509,19 +509,19 @@ static pmix_status_t server_unpublish_fn(const pmix_proc_t *p, char **keys,
/* convert the array of pmix_info_t to the list of info */
for (n=0; n < ninfo; n++) {
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->unpublish(&proc, keys, &opalcaddy->info, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
OBJ_RELEASE(opalcaddy);
}
return pmix1_convert_opalrc(rc);
@ -534,18 +534,18 @@ static void opal_spncbfunc(int status, opal_jobid_t jobid, void *cbdata)
char nspace[PMIX_MAX_NSLEN];
if (NULL != opalcaddy->spwncbfunc) {
rc = pmix1_convert_opalrc(status);
/* convert the jobid */
(void)opal_snprintf_jobid(nspace, PMIX_MAX_NSLEN, jobid);
opalcaddy->spwncbfunc(rc, nspace, opalcaddy->cbdata);
rc = pmix1_convert_opalrc(status);
/* convert the jobid */
(void)opal_snprintf_jobid(nspace, PMIX_MAX_NSLEN, jobid);
opalcaddy->spwncbfunc(rc, nspace, opalcaddy->cbdata);
}
OBJ_RELEASE(opalcaddy);
}
static pmix_status_t server_spawn_fn(const pmix_proc_t *p,
const pmix_info_t job_info[], size_t ninfo,
const pmix_app_t apps[], size_t napps,
pmix_spawn_cbfunc_t cbfunc, void *cbdata)
const pmix_info_t job_info[], size_t ninfo,
const pmix_app_t apps[], size_t napps,
pmix_spawn_cbfunc_t cbfunc, void *cbdata)
{
pmix1_opalcaddy_t *opalcaddy;
opal_process_name_t proc;
@ -555,17 +555,17 @@ static pmix_status_t server_spawn_fn(const pmix_proc_t *p,
int rc;
if (NULL == host_module || NULL == host_module->spawn) {
return PMIX_ERR_NOT_SUPPORTED;
return PMIX_ERR_NOT_SUPPORTED;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return pmix1_convert_opalrc(rc);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == p->rank) {
proc.vpid = OPAL_VPID_WILDCARD;
proc.vpid = OPAL_VPID_WILDCARD;
} else {
proc.vpid = p->rank;
proc.vpid = p->rank;
}
/* setup the caddy */
@ -575,46 +575,46 @@ static pmix_status_t server_spawn_fn(const pmix_proc_t *p,
/* convert the job info */
for (k=0; k < ninfo; k++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(job_info[k].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &job_info[k].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(job_info[k].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, job_info[k].key, &job_info[k].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
}
/* convert the apps */
for (n=0; n < napps; n++) {
app = OBJ_NEW(opal_pmix_app_t);
opal_list_append(&opalcaddy->apps, &app->super);
if (NULL != apps[n].cmd) {
app->cmd = strdup(apps[n].cmd);
}
app->argc = apps[n].argc;
if (NULL != apps[n].argv) {
app->argv = opal_argv_copy(apps[n].argv);
}
if (NULL != apps[n].env) {
app->env = opal_argv_copy(apps[n].env);
}
app->maxprocs = apps[n].maxprocs;
for (k=0; k < apps[n].ninfo; k++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&app->info, &oinfo->super);
oinfo->key = strdup(apps[n].info[k].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &apps[n].info[k].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
}
app = OBJ_NEW(opal_pmix_app_t);
opal_list_append(&opalcaddy->apps, &app->super);
if (NULL != apps[n].cmd) {
app->cmd = strdup(apps[n].cmd);
}
app->argc = apps[n].argc;
if (NULL != apps[n].argv) {
app->argv = opal_argv_copy(apps[n].argv);
}
if (NULL != apps[n].env) {
app->env = opal_argv_copy(apps[n].env);
}
app->maxprocs = apps[n].maxprocs;
for (k=0; k < apps[n].ninfo; k++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&app->info, &oinfo->super);
oinfo->key = strdup(apps[n].info[k].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, apps[n].info[k].key, &apps[n].info[k].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
}
}
/* pass it up */
rc = host_module->spawn(&proc, &opalcaddy->info, &opalcaddy->apps, opal_spncbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OPAL_ERROR_LOG(rc);
OBJ_RELEASE(opalcaddy);
OPAL_ERROR_LOG(rc);
OBJ_RELEASE(opalcaddy);
}
return pmix1_convert_opalrc(rc);
@ -622,8 +622,8 @@ static pmix_status_t server_spawn_fn(const pmix_proc_t *p,
static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
pmix1_opalcaddy_t *opalcaddy;
@ -632,7 +632,7 @@ static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs,
opal_value_t *oinfo;
if (NULL == host_module || NULL == host_module->connect) {
return PMIX_ERR_NOT_SUPPORTED;
return PMIX_ERR_NOT_SUPPORTED;
}
/* setup the caddy */
@ -642,34 +642,34 @@ static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs,
/* convert the array of pmix_proc_t to the list of procs */
for (n=0; n < nprocs; n++) {
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == procs[n].rank) {
nm->name.vpid = OPAL_VPID_WILDCARD;
} else {
nm->name.vpid = procs[n].rank;
}
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == procs[n].rank) {
nm->name.vpid = OPAL_VPID_WILDCARD;
} else {
nm->name.vpid = procs[n].rank;
}
}
/* convert the info */
for (n=0; n < ninfo; n++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->connect(&opalcaddy->procs, &opalcaddy->info, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
OBJ_RELEASE(opalcaddy);
}
return pmix1_convert_opalrc(rc);
@ -677,8 +677,8 @@ static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs,
static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
pmix1_opalcaddy_t *opalcaddy;
@ -687,7 +687,7 @@ static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t npro
opal_value_t *oinfo;
if (NULL == host_module || NULL == host_module->disconnect) {
return PMIX_ERR_NOT_SUPPORTED;
return PMIX_ERR_NOT_SUPPORTED;
}
/* setup the caddy */
@ -697,41 +697,41 @@ static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t npro
/* convert the array of pmix_proc_t to the list of procs */
for (n=0; n < nprocs; n++) {
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == procs[n].rank) {
nm->name.vpid = OPAL_VPID_WILDCARD;
} else {
nm->name.vpid = procs[n].rank;
}
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
if (PMIX_RANK_WILDCARD == procs[n].rank) {
nm->name.vpid = OPAL_VPID_WILDCARD;
} else {
nm->name.vpid = procs[n].rank;
}
}
/* convert the info */
for (n=0; n < ninfo; n++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->disconnect(&opalcaddy->procs, &opalcaddy->info, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
OBJ_RELEASE(opalcaddy);
}
return pmix1_convert_opalrc(rc);
}
static pmix_status_t server_register_events(const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
pmix1_opalcaddy_t *opalcaddy;
size_t n;
@ -745,36 +745,36 @@ static pmix_status_t server_register_events(const pmix_info_t info[], size_t nin
/* convert the info */
for (n=0; n < ninfo; n++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return pmix1_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->register_events(&opalcaddy->info, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
OBJ_RELEASE(opalcaddy);
}
return pmix1_convert_opalrc(rc);
}
static pmix_status_t server_deregister_events(const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
return PMIX_ERR_NOT_IMPLEMENTED;
}
static pmix_status_t server_listener_fn(int listening_sd,
pmix_connection_cbfunc_t cbfunc)
pmix_connection_cbfunc_t cbfunc)
{
int rc;
if (NULL == host_module || NULL == host_module->listener) {
return PMIX_ERR_NOT_SUPPORTED;
return PMIX_ERR_NOT_SUPPORTED;
}
rc = host_module->listener(listening_sd, cbfunc);

Просмотреть файл

@ -52,22 +52,22 @@ static char *dbgvalue=NULL;
static int errhdler_ref = 0;
static void completion_handler(int status, opal_list_t *results,
opal_pmix_op_cbfunc_t cbfunc, void *thiscbdata,
void *notification_cbdata) {
opal_pmix_op_cbfunc_t cbfunc, void *thiscbdata,
void *notification_cbdata) {
int * cond = (int *)notification_cbdata;
*cond = 0;
}
#define PMIX_WAIT_FOR_COMPLETION(a) \
do { \
while ((a)) { \
usleep(10); \
} \
while ((a)) { \
usleep(10); \
} \
} while (0);
static void myerr(pmix_status_t status,
pmix_proc_t procs[], size_t nprocs,
pmix_info_t info[], size_t ninfo)
pmix_proc_t procs[], size_t nprocs,
pmix_info_t info[], size_t ninfo)
{
int rc;
opal_list_t plist, ilist;
@ -82,19 +82,19 @@ static void myerr(pmix_status_t status,
/* convert the array of procs */
OBJ_CONSTRUCT(&plist, opal_list_t);
for (n=0; n < nprocs; n++) {
nm = OBJ_NEW(opal_namelist_t);
nm->name.jobid = strtoul(procs[n].nspace, NULL, 10);
nm->name.vpid = procs[n].rank;
opal_list_append(&plist, &nm->super);
nm = OBJ_NEW(opal_namelist_t);
nm->name.jobid = strtoul(procs[n].nspace, NULL, 10);
nm->name.vpid = procs[n].rank;
opal_list_append(&plist, &nm->super);
}
/* convert the array of info */
OBJ_CONSTRUCT(&ilist, opal_list_t);
for (n=0; n < ninfo; n++) {
iptr = OBJ_NEW(opal_value_t);
iptr->key = strdup(info[n].key);
pmix1_value_unload(iptr, &info[n].value);
opal_list_append(&plist, &iptr->super);
iptr = OBJ_NEW(opal_value_t);
iptr->key = strdup(info[n].key);
pmix1_value_unload(iptr, &info[n].value);
opal_list_append(&plist, &iptr->super);
}
/* call the base errhandler */
@ -106,17 +106,17 @@ static void myerr(pmix_status_t status,
}
static void errreg_cbfunc(pmix_status_t status,
int errhandler_ref,
void *cbdata)
int errhandler_ref,
void *cbdata)
{
errhdler_ref = errhandler_ref;
opal_output_verbose(5, opal_pmix_base_framework.framework_output,
"PMIX server errreg_cbfunc - error handler registered status=%d, reference=%d",
status, errhandler_ref);
"PMIX server errreg_cbfunc - error handler registered status=%d, reference=%d",
status, errhandler_ref);
}
int pmix1_server_init(opal_pmix_server_module_t *module,
opal_list_t *info)
opal_list_t *info)
{
pmix_status_t rc;
int dbg;
@ -125,28 +125,28 @@ int pmix1_server_init(opal_pmix_server_module_t *module,
size_t sz, n;
if (0 < (dbg = opal_output_get_verbosity(opal_pmix_base_framework.framework_output))) {
asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg);
putenv(dbgvalue);
asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg);
putenv(dbgvalue);
}
/* convert the list to an array of pmix_info_t */
if (NULL != info) {
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
pmix1_value_load(&pinfo[n].value, kv);
++n;
}
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
pmix1_value_load(&pinfo[n].value, kv);
++n;
}
} else {
sz = 0;
pinfo = NULL;
sz = 0;
pinfo = NULL;
}
if (PMIX_SUCCESS != (rc = PMIx_server_init(&mymodule, pinfo, sz))) {
PMIX_INFO_FREE(pinfo, sz);
return pmix1_convert_rc(rc);
PMIX_INFO_FREE(pinfo, sz);
return pmix1_convert_rc(rc);
}
PMIX_INFO_FREE(pinfo, sz);
@ -191,16 +191,16 @@ static void opcbfunc(pmix_status_t status, void *cbdata)
pmix1_opcaddy_t *op = (pmix1_opcaddy_t*)cbdata;
if (NULL != op->opcbfunc) {
op->opcbfunc(pmix1_convert_rc(status), op->cbdata);
op->opcbfunc(pmix1_convert_rc(status), op->cbdata);
}
OBJ_RELEASE(op);
}
int pmix1_server_register_nspace(opal_jobid_t jobid,
int nlocalprocs,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
int nlocalprocs,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
opal_value_t *kv, *k2;
pmix_info_t *pinfo, *pmap;
@ -218,38 +218,38 @@ int pmix1_server_register_nspace(opal_jobid_t jobid,
job = OBJ_NEW(opal_pmix1_jobid_trkr_t);
(void)strncpy(job->nspace, nspace, PMIX_MAX_NSLEN);
job->jobid = jobid;
opal_list_append(&mca_pmix_ext114_component.jobids, &job->super);
opal_list_append(&mca_pmix_ext11_component.jobids, &job->super);
/* convert the list to an array of pmix_info_t */
if (NULL != info) {
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
if (0 == strcmp(kv->key, OPAL_PMIX_PROC_DATA)) {
pinfo[n].value.type = PMIX_INFO_ARRAY;
/* the value contains a list of values - convert
* that list to another array */
pmapinfo = (opal_list_t*)kv->data.ptr;
szmap = opal_list_get_size(pmapinfo);
PMIX_INFO_CREATE(pmap, szmap);
pinfo[n].value.data.array.array = (struct pmix_info_t*)pmap;
pinfo[n].value.data.array.size = szmap;
m = 0;
OPAL_LIST_FOREACH(k2, pmapinfo, opal_value_t) {
(void)strncpy(pmap[m].key, k2->key, PMIX_MAX_KEYLEN);
pmix1_value_load(&pmap[m].value, k2);
++m;
}
} else {
pmix1_value_load(&pinfo[n].value, kv);
}
++n;
}
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
if (0 == strcmp(kv->key, OPAL_PMIX_PROC_DATA)) {
pinfo[n].value.type = PMIX_INFO_ARRAY;
/* the value contains a list of values - convert
* that list to another array */
pmapinfo = (opal_list_t*)kv->data.ptr;
szmap = opal_list_get_size(pmapinfo);
PMIX_INFO_CREATE(pmap, szmap);
pinfo[n].value.data.array.array = (struct pmix_info_t*)pmap;
pinfo[n].value.data.array.size = szmap;
m = 0;
OPAL_LIST_FOREACH(k2, pmapinfo, opal_value_t) {
(void)strncpy(pmap[m].key, k2->key, PMIX_MAX_KEYLEN);
pmix1_value_load(&pmap[m].value, k2);
++m;
}
} else {
pmix1_value_load(&pinfo[n].value, kv);
}
++n;
}
} else {
sz = 0;
pinfo = NULL;
sz = 0;
pinfo = NULL;
}
/* setup the caddy */
@ -259,37 +259,37 @@ int pmix1_server_register_nspace(opal_jobid_t jobid,
op->opcbfunc = cbfunc;
op->cbdata = cbdata;
rc = PMIx_server_register_nspace(nspace, nlocalprocs, pinfo, sz,
opcbfunc, op);
opcbfunc, op);
if (PMIX_SUCCESS != rc) {
OBJ_RELEASE(op);
OBJ_RELEASE(op);
}
return pmix1_convert_rc(rc);
}
void pmix1_server_deregister_nspace(opal_jobid_t jobid,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
opal_pmix1_jobid_trkr_t *jptr;
/* if we don't already have it, we can ignore this */
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == jobid) {
/* found it - tell the server to deregister */
PMIx_server_deregister_nspace(jptr->nspace);
/* now get rid of it from our list */
opal_list_remove_item(&mca_pmix_ext114_component.jobids, &jptr->super);
OBJ_RELEASE(jptr);
return;
}
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == jobid) {
/* found it - tell the server to deregister */
PMIx_server_deregister_nspace(jptr->nspace);
/* now get rid of it from our list */
opal_list_remove_item(&mca_pmix_ext11_component.jobids, &jptr->super);
OBJ_RELEASE(jptr);
return;
}
}
}
int pmix1_server_register_client(const opal_process_name_t *proc,
uid_t uid, gid_t gid,
void *server_object,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
uid_t uid, gid_t gid,
void *server_object,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
pmix_status_t rc;
pmix1_opcaddy_t *op;
@ -304,29 +304,29 @@ int pmix1_server_register_client(const opal_process_name_t *proc,
op->p.rank = proc->vpid;
rc = PMIx_server_register_client(&op->p, uid, gid, server_object,
opcbfunc, op);
opcbfunc, op);
if (PMIX_SUCCESS != rc) {
OBJ_RELEASE(op);
OBJ_RELEASE(op);
}
return pmix1_convert_rc(rc);
}
void pmix1_server_deregister_client(const opal_process_name_t *proc,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
opal_pmix1_jobid_trkr_t *jptr;
pmix_proc_t p;
/* if we don't already have it, we can ignore this */
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext114_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == proc->jobid) {
/* found it - tell the server to deregister */
(void)strncpy(p.nspace, jptr->nspace, PMIX_MAX_NSLEN);
p.rank = proc->vpid;
PMIx_server_deregister_client(&p);
return;
}
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext11_component.jobids, opal_pmix1_jobid_trkr_t) {
if (jptr->jobid == proc->jobid) {
/* found it - tell the server to deregister */
(void)strncpy(p.nspace, jptr->nspace, PMIX_MAX_NSLEN);
p.rank = proc->vpid;
PMIx_server_deregister_client(&p);
return;
}
}
}
@ -354,13 +354,13 @@ static void dmdx_response(pmix_status_t status, char *data, size_t sz, void *cbd
rc = pmix1_convert_rc(status);
if (NULL != op->mdxcbfunc) {
op->mdxcbfunc(rc, data, sz, op->cbdata, NULL, NULL);
op->mdxcbfunc(rc, data, sz, op->cbdata, NULL, NULL);
}
OBJ_RELEASE(op);
}
int pmix1_server_dmodex(const opal_process_name_t *proc,
opal_pmix_modex_cbfunc_t cbfunc, void *cbdata)
opal_pmix_modex_cbfunc_t cbfunc, void *cbdata)
{
pmix1_opcaddy_t *op;
pmix_status_t rc;
@ -377,15 +377,15 @@ int pmix1_server_dmodex(const opal_process_name_t *proc,
/* find the internally-cached data for this proc */
rc = PMIx_server_dmodex_request(&op->p, dmdx_response, op);
if (PMIX_SUCCESS != rc) {
OBJ_RELEASE(op);
OBJ_RELEASE(op);
}
return pmix1_convert_rc(rc);
}
int pmix1_server_notify_error(int status,
const opal_process_name_t *source,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata)
const opal_process_name_t *source,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata)
{
opal_value_t *kv;
pmix_info_t *pinfo;
@ -400,25 +400,25 @@ int pmix1_server_notify_error(int status,
/* convert the list to an array of pmix_info_t */
if (NULL != info) {
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
pmix1_value_load(&pinfo[n].value, kv);
}
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
pmix1_value_load(&pinfo[n].value, kv);
}
} else {
sz = 0;
pinfo = NULL;
sz = 0;
pinfo = NULL;
}
op->info = pinfo;
op->sz = sz;
rc = pmix1_convert_opalrc(status);
rc = PMIx_Notify_error(rc, NULL, 0, NULL, 0,
pinfo, sz, opcbfunc, op);
pinfo, sz, opcbfunc, op);
if (PMIX_SUCCESS != rc) {
OBJ_RELEASE(op);
OBJ_RELEASE(op);
}
return pmix1_convert_rc(rc);
}

46
opal/mca/pmix/ext2x/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,46 @@
#
# Copyright (c) 2x14-2x16 Intel, Inc. All rights reserved.
# Copyright (c) 2x15 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2x14-2x15 Mellanox Technologies, Inc.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
sources = \
pmix_ext2x.h \
pmix_ext2x_component.c \
pmix_ext2x.c \
pmix_ext2x_client.c \
pmix_ext2x_server_south.c \
pmix_ext2x_server_north.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if MCA_BUILD_opal_pmix_ext2x_DSO
component_noinst =
component_install = mca_pmix_ext2x.la
else
component_noinst = libmca_pmix_ext2x.la
component_install =
endif
mcacomponentdir = $(opallibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_pmix_ext2x_la_SOURCES = $(sources)
mca_pmix_ext2x_la_CFLAGS =
mca_pmix_ext2x_la_CPPFLAGS = $(opal_pmix_ext2x_CPPFLAGS)
mca_pmix_ext2x_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext2x_LDFLAGS)
mca_pmix_ext2x_la_LIBADD = $(opal_pmix_ext2x_LIBS)
noinst_LTLIBRARIES = $(component_noinst)
libmca_pmix_ext2x_la_SOURCES =$(sources)
libmca_pmix_ext2x_la_CFLAGS =
libmca_pmix_ext2x_la_CPPFLAGS = $(opal_pmix_ext2x_CPPFLAGS)
libmca_pmix_ext2x_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext2x_LDFLAGS)
libmca_pmix_ext2x_la_LIBADD = $(opal_pmix_ext2x_LIBS)

65
opal/mca/pmix/ext2x/configure.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,65 @@
# -*- shell-script -*-
#
# Copyright (c) 2x04-2x05 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2x04-2x05 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2x04-2x05 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2x04-2x05 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2x11-2x13 Los Alamos National Security, LLC.
# All rights reserved.
# Copyright (c) 2x10-2x15 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2x13-2x16 Intel, Inc. All rights reserved.
# Copyright (c) 2x15 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2x14-2x15 Mellanox Technologies, Inc.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_pmix_ext2x_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_opal_pmix_ext2x_CONFIG],[
AC_CONFIG_FILES([opal/mca/pmix/ext2x/Makefile])
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'
AC_MSG_CHECKING([if external component is version 2.x])
AS_IF([test "$opal_external_pmix_version" = "2X"],
[AC_MSG_RESULT([yes])
opal_pmix_ext2x_happy=yes],
[AC_MSG_RESULT([no])
opal_pmix_ext2x_happy=no])
opal_pmix_ext2x_CPPFLAGS=$opal_external_pmix_CPPFLAGS
opal_pmix_ext2x_LDFLAGS=$opal_external_pmix_LDFLAGS
opal_pmix_ext2x_LIBS=$opal_external_pmix_LIBS
AC_SUBST(opal_pmix_ext2x_CPPFLAGS)
AC_SUBST(opal_pmix_ext2x_LDFLAGS)
AC_SUBST(opal_pmix_ext2x_LIBS)
AS_IF([test "$opal_pmix_ext2x_happy" = "yes"],
[$1],
[$2])],
[$2])
])dnl

1409
opal/mca/pmix/ext2x/pmix_ext2x.c Обычный файл

Разница между файлами не показана из-за своего большого размера Загрузить разницу

325
opal/mca/pmix/ext2x/pmix_ext2x.h Обычный файл
Просмотреть файл

@ -0,0 +1,325 @@
/*
* Copyright (c) 2x14-2x16 Intel, Inc. All rights reserved.
* Copyright (c) 2x14-2x15 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2x16 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef MCA_PMIX_PMIX2X_H
#define MCA_PMIX_PMIX2X_H
#include "opal_config.h"
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
#include "opal/class/opal_list.h"
#include "opal/mca/mca.h"
#include "opal/mca/event/event.h"
#include "opal/util/proc.h"
#include "opal/mca/pmix/pmix.h"
#include "pmix_server.h"
#include "pmix/pmix_common.h"
BEGIN_C_DECLS
typedef struct {
opal_pmix_base_component_t super;
opal_list_t jobids;
bool native_launch;
size_t evindex;
opal_list_t single_events;
opal_list_t multi_events;
opal_list_t default_events;
int cache_size;
opal_list_t cache;
} mca_pmix_ext2x_component_t;
OPAL_DECLSPEC extern mca_pmix_ext2x_component_t mca_pmix_ext2x_component;
OPAL_DECLSPEC extern const opal_pmix_base_module_t opal_pmix_ext2x_module;
/**** INTERNAL OBJECTS ****/
typedef struct {
opal_list_item_t super;
opal_jobid_t jobid;
char nspace[PMIX_MAX_NSLEN + 1];
} opal_ext2x_jobid_trkr_t;
OBJ_CLASS_DECLARATION(opal_ext2x_jobid_trkr_t);
typedef struct {
opal_list_item_t super;
size_t index;
int code;
opal_pmix_notification_fn_t handler;
} opal_ext2x_single_event_t;
OBJ_CLASS_DECLARATION(opal_ext2x_single_event_t);
typedef struct {
opal_list_item_t super;
size_t index;
int *codes;
size_t ncodes;
opal_pmix_notification_fn_t handler;
} opal_ext2x_multi_event_t;
OBJ_CLASS_DECLARATION(opal_ext2x_multi_event_t);
typedef struct {
opal_list_item_t super;
size_t index;
opal_pmix_notification_fn_t handler;
} opal_ext2x_default_event_t;
OBJ_CLASS_DECLARATION(opal_ext2x_default_event_t);
typedef struct {
opal_list_item_t super;
int status;
bool nondefault;
opal_process_name_t source;
pmix_data_range_t range;
opal_list_t *info;
opal_list_t results;
opal_ext2x_single_event_t *sing;
opal_ext2x_multi_event_t *multi;
opal_ext2x_default_event_t *def;
opal_pmix_op_cbfunc_t final_cbfunc;
void *final_cbdata;
} opal_ext2x_event_chain_t;
OBJ_CLASS_DECLARATION(opal_ext2x_event_chain_t);
typedef struct {
opal_object_t super;
pmix_status_t status;
char *key;
pmix_proc_t p;
pmix_proc_t *procs;
size_t nprocs;
pmix_proc_t *error_procs;
size_t nerror_procs;
pmix_info_t *info;
size_t ninfo;
pmix_app_t *apps;
size_t sz;
volatile bool active;
opal_pmix_op_cbfunc_t opcbfunc;
opal_pmix_modex_cbfunc_t mdxcbfunc;
opal_pmix_value_cbfunc_t valcbfunc;
opal_pmix_lookup_cbfunc_t lkcbfunc;
opal_pmix_spawn_cbfunc_t spcbfunc;
void *cbdata;
} ext2x_opcaddy_t;
OBJ_CLASS_DECLARATION(ext2x_opcaddy_t);
typedef struct {
opal_object_t super;
opal_list_t procs;
opal_list_t info;
opal_list_t apps;
pmix_op_cbfunc_t opcbfunc;
pmix_dmodex_response_fn_t dmdxfunc;
pmix_modex_cbfunc_t mdxcbfunc;
pmix_lookup_cbfunc_t lkupcbfunc;
pmix_spawn_cbfunc_t spwncbfunc;
pmix_info_cbfunc_t infocbfunc;
pmix_tool_connection_cbfunc_t toolcbfunc;
void *cbdata;
opal_pmix_release_cbfunc_t odmdxfunc;
void *ocbdata;
} ext2x_opalcaddy_t;
OBJ_CLASS_DECLARATION(ext2x_opalcaddy_t);
typedef struct {
opal_object_t super;
opal_event_t ev;
volatile bool active;
size_t id;
int status;
opal_process_name_t pname;
opal_jobid_t jobid;
const opal_process_name_t *source;
opal_pmix_data_range_t range;
bool nondefault;
size_t handler;
opal_list_t *event_codes;
opal_list_t *info;
opal_pmix_notification_fn_t evhandler;
opal_pmix_evhandler_reg_cbfunc_t cbfunc;
opal_pmix_op_cbfunc_t opcbfunc;
void *cbdata;
} ext2x_threadshift_t;
OBJ_CLASS_DECLARATION(ext2x_threadshift_t);
#define OPAL_PMIX_OPCD_THREADSHIFT(i, s, sr, if, nif, fn, cb, cd) \
do { \
ext2x_opalcaddy_t *_cd; \
_cd = OBJ_NEW(ext2x_opalcaddy_t); \
_cd->id = (i); \
_cd->status = (s); \
_cd->source = (sr); \
_cd->info = (i); \
_cd->evcbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
} while(0)
#define OPAL_PMIX_OP_THREADSHIFT(e, fn, cb, cd) \
do { \
ext2x_threadshift_t *_cd; \
_cd = OBJ_NEW(ext2x_threadshift_t); \
_cd->handler = (e); \
_cd->opcbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
} while(0)
#define OPAL_PMIX_THREADSHIFT(e, i, eh, fn, cb, cd) \
do { \
ext2x_threadshift_t *_cd; \
_cd = OBJ_NEW(ext2x_threadshift_t); \
_cd->event_codes = (e); \
_cd->info = (i); \
_cd->evhandler = (eh); \
_cd->cbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
} while(0)
#define OPAL_PMIX_NOTIFY_THREADSHIFT(s, sr, r, i, fn, cb, cd) \
do { \
ext2x_threadshift_t *_cd; \
_cd = OBJ_NEW(ext2x_threadshift_t); \
_cd->status = (s); \
_cd->source = (sr); \
_cd->range = (r); \
_cd->info = (i); \
_cd->opcbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
} while(0)
/**** CLIENT FUNCTIONS ****/
OPAL_MODULE_DECLSPEC int ext2x_client_init(void);
OPAL_MODULE_DECLSPEC int ext2x_client_finalize(void);
OPAL_MODULE_DECLSPEC int ext2x_initialized(void);
OPAL_MODULE_DECLSPEC int ext2x_abort(int flag, const char *msg,
opal_list_t *procs);
OPAL_MODULE_DECLSPEC int ext2x_commit(void);
OPAL_MODULE_DECLSPEC int ext2x_fence(opal_list_t *procs, int collect_data);
OPAL_MODULE_DECLSPEC int ext2x_fencenb(opal_list_t *procs, int collect_data,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext2x_put(opal_pmix_scope_t scope,
opal_value_t *val);
OPAL_MODULE_DECLSPEC int ext2x_get(const opal_process_name_t *proc, const char *key,
opal_list_t *info, opal_value_t **val);
OPAL_MODULE_DECLSPEC int ext2x_getnb(const opal_process_name_t *proc, const char *key,
opal_list_t *info,
opal_pmix_value_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext2x_publish(opal_list_t *info);
OPAL_MODULE_DECLSPEC int ext2x_publishnb(opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext2x_lookup(opal_list_t *data, opal_list_t *info);
OPAL_MODULE_DECLSPEC int ext2x_lookupnb(char **keys, opal_list_t *info,
opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext2x_unpublish(char **keys, opal_list_t *info);
OPAL_MODULE_DECLSPEC int ext2x_unpublishnb(char **keys, opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext2x_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid);
OPAL_MODULE_DECLSPEC int ext2x_spawnnb(opal_list_t *job_info, opal_list_t *apps,
opal_pmix_spawn_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext2x_connect(opal_list_t *procs);
OPAL_MODULE_DECLSPEC int ext2x_connectnb(opal_list_t *procs,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int ext2x_disconnect(opal_list_t *procs);
OPAL_MODULE_DECLSPEC int ext2x_disconnectnb(opal_list_t *procs,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int ext2x_resolve_peers(const char *nodename, opal_jobid_t jobid,
opal_list_t *procs);
OPAL_MODULE_DECLSPEC int ext2x_resolve_nodes(opal_jobid_t jobid, char **nodelist);
/**** COMMON FUNCTIONS ****/
OPAL_MODULE_DECLSPEC int ext2x_store_local(const opal_process_name_t *proc,
opal_value_t *val);
/**** SERVER SOUTHBOUND FUNCTIONS ****/
OPAL_MODULE_DECLSPEC int ext2x_server_init(opal_pmix_server_module_t *module,
opal_list_t *info);
OPAL_MODULE_DECLSPEC int ext2x_server_finalize(void);
OPAL_MODULE_DECLSPEC int ext2x_server_gen_regex(const char *input, char **regex);
OPAL_MODULE_DECLSPEC int ext2x_server_gen_ppn(const char *input, char **ppn);
OPAL_MODULE_DECLSPEC int ext2x_server_register_nspace(opal_jobid_t jobid,
int nlocalprocs,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC void ext2x_server_deregister_nspace(opal_jobid_t jobid,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int ext2x_server_register_client(const opal_process_name_t *proc,
uid_t uid, gid_t gid,
void *server_object,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC void ext2x_server_deregister_client(const opal_process_name_t *proc,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int ext2x_server_setup_fork(const opal_process_name_t *proc, char ***env);
OPAL_MODULE_DECLSPEC int ext2x_server_dmodex(const opal_process_name_t *proc,
opal_pmix_modex_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext2x_server_notify_event(int status,
const opal_process_name_t *source,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
/**** COMPONENT UTILITY FUNCTIONS ****/
OPAL_MODULE_DECLSPEC void ext2x_event_hdlr(size_t evhdlr_registration_id,
pmix_status_t status, const pmix_proc_t *source,
pmix_info_t info[], size_t ninfo,
pmix_info_t results[], size_t nresults,
pmix_event_notification_cbfunc_fn_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC pmix_status_t ext2x_convert_opalrc(int rc);
OPAL_MODULE_DECLSPEC int ext2x_convert_rc(pmix_status_t rc);
OPAL_MODULE_DECLSPEC opal_vpid_t ext2x_convert_rank(int rank);
OPAL_MODULE_DECLSPEC int ext2x_convert_opalrank(opal_vpid_t vpid);
OPAL_MODULE_DECLSPEC opal_pmix_scope_t ext2x_convert_scope(pmix_scope_t scope);
OPAL_MODULE_DECLSPEC pmix_scope_t ext2x_convert_opalscope(opal_pmix_scope_t scope);
OPAL_MODULE_DECLSPEC pmix_data_range_t ext2x_convert_opalrange(opal_pmix_data_range_t range);
OPAL_MODULE_DECLSPEC opal_pmix_data_range_t ext2x_convert_range(pmix_data_range_t range);
OPAL_MODULE_DECLSPEC opal_pmix_persistence_t ext2x_convert_persist(pmix_persistence_t scope);
OPAL_MODULE_DECLSPEC pmix_persistence_t ext2x_convert_opalpersist(opal_pmix_persistence_t scope);
OPAL_MODULE_DECLSPEC void ext2x_value_load(pmix_value_t *v,
opal_value_t *kv);
OPAL_MODULE_DECLSPEC int ext2x_value_unload(opal_value_t *kv,
const char *key,
const pmix_value_t *v);
END_C_DECLS
#endif /* MCA_PMIX_EXTERNAL_H */

1284
opal/mca/pmix/ext2x/pmix_ext2x_client.c Обычный файл

Разница между файлами не показана из-за своего большого размера Загрузить разницу

131
opal/mca/pmix/ext2x/pmix_ext2x_component.c Обычный файл
Просмотреть файл

@ -0,0 +1,131 @@
/*
* Copyright (c) 2x14-2x16 Intel, Inc. All rights reserved.
* Copyright (c) 2x14-2x15 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2x16 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
* These symbols are in a file by themselves to provide nice linker
* semantics. Since linkers generally pull in symbols by object
* files, keeping these symbols as the only symbols in this file
* prevents utility programs such as "ompi_info" from having to import
* entire components just to query their version and parameters.
*/
#include "opal_config.h"
#include "opal/constants.h"
#include "opal/class/opal_list.h"
#include "opal/util/proc.h"
#include "opal/mca/pmix/pmix.h"
#include "pmix_ext2x.h"
/*
* Public string showing the pmix external component version number
*/
const char *opal_pmix_ext2x_component_version_string =
"OPAL external pmix2.0 MCA component version " OPAL_VERSION;
/*
* Local function
*/
static int external_open(void);
static int external_close(void);
static int external_component_query(mca_base_module_t **module, int *priority);
static int external_register(void);
/*
* Instantiate the public struct with all of our public information
* and pointers to our public functions in it
*/
mca_pmix_ext2x_component_t mca_pmix_ext2x_component = {
{
/* First, the mca_component_t struct containing meta information
about the component itself */
.base_version = {
/* Indicate that we are a pmix v1.1.0 component (which also
implies a specific MCA version) */
OPAL_PMIX_BASE_VERSION_2_0_0,
/* Component name and version */
.mca_component_name = "ext2x",
MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION),
/* Component open and close functions */
.mca_open_component = external_open,
.mca_close_component = external_close,
.mca_query_component = external_component_query,
.mca_register_component_params = external_register,
},
/* Next the MCA v1.0.0 component meta data */
.base_data = {
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
}
},
.native_launch = false
};
static int external_register(void)
{
mca_pmix_ext2x_component.cache_size = 256;
mca_base_component_var_register(&mca_pmix_ext2x_component.super.base_version,
"cache_size", "Size of the ring buffer cache for events",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_CONSTANT,
&mca_pmix_ext2x_component.cache_size);
return OPAL_SUCCESS;
}
static int external_open(void)
{
mca_pmix_ext2x_component.evindex = 0;
OBJ_CONSTRUCT(&mca_pmix_ext2x_component.jobids, opal_list_t);
OBJ_CONSTRUCT(&mca_pmix_ext2x_component.single_events, opal_list_t);
OBJ_CONSTRUCT(&mca_pmix_ext2x_component.multi_events, opal_list_t);
OBJ_CONSTRUCT(&mca_pmix_ext2x_component.default_events, opal_list_t);
OBJ_CONSTRUCT(&mca_pmix_ext2x_component.cache, opal_list_t);
return OPAL_SUCCESS;
}
static int external_close(void)
{
OPAL_LIST_DESTRUCT(&mca_pmix_ext2x_component.jobids);
OPAL_LIST_DESTRUCT(&mca_pmix_ext2x_component.single_events);
OPAL_LIST_DESTRUCT(&mca_pmix_ext2x_component.multi_events);
OPAL_LIST_DESTRUCT(&mca_pmix_ext2x_component.default_events);
OPAL_LIST_DESTRUCT(&mca_pmix_ext2x_component.cache);
return OPAL_SUCCESS;
}
static int external_component_query(mca_base_module_t **module, int *priority)
{
char *t, *id;
/* see if a PMIx server is present */
if (NULL != (t = getenv("PMIX_SERVER_URI")) ||
NULL != (id = getenv("PMIX_ID"))) {
/* if PMIx is present, then we are a client and need to use it */
*priority = 100;
} else {
/* we could be a server, so we still need to be considered */
*priority = 5;
}
*module = (mca_base_module_t *)&opal_pmix_ext2x_module;
return OPAL_SUCCESS;
}

754
opal/mca/pmix/ext2x/pmix_ext2x_server_north.c Обычный файл
Просмотреть файл

@ -0,0 +1,754 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* 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.
* All rights reserved.
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "opal_config.h"
#include "opal/constants.h"
#include "opal/types.h"
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "opal/dss/dss.h"
#include "opal/mca/event/event.h"
#include "opal/mca/hwloc/base/base.h"
#include "opal/runtime/opal.h"
#include "opal/runtime/opal_progress_threads.h"
#include "opal/util/argv.h"
#include "opal/util/error.h"
#include "opal/util/output.h"
#include "opal/util/proc.h"
#include "opal/util/show_help.h"
#include "opal/mca/pmix/base/base.h"
#include "pmix_ext2x.h"
#include "pmix.h"
#include "pmix_server.h"
/**** N.O.R.T.H.B.O.U.N.D I.N.T.E.R.F.A.C.E.S ****/
/* These are the interfaces used by the embedded PMIx server
* to call up into ORTE for service requests */
static pmix_status_t server_client_connected_fn(const pmix_proc_t *proc, void* server_object,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_client_finalized_fn(const pmix_proc_t *proc, void* server_object,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_abort_fn(const pmix_proc_t *proc, void *server_object,
int status, const char msg[],
pmix_proc_t procs[], size_t nprocs,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_fencenb_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
char *data, size_t ndata,
pmix_modex_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *proc,
const pmix_info_t info[], size_t ninfo,
pmix_modex_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_publish_fn(const pmix_proc_t *proc,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_lookup_fn(const pmix_proc_t *proc, char **keys,
const pmix_info_t info[], size_t ninfo,
pmix_lookup_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_unpublish_fn(const pmix_proc_t *proc, char **keys,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_spawn_fn(const pmix_proc_t *proc,
const pmix_info_t job_info[], size_t ninfo,
const pmix_app_t apps[], size_t napps,
pmix_spawn_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_register_events(pmix_status_t *codes, size_t ncodes,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_deregister_events(pmix_status_t *codes, size_t ncodes,
pmix_op_cbfunc_t cbfunc, void *cbdata);
static pmix_status_t server_notify_event(pmix_status_t code,
const pmix_proc_t *source,
pmix_data_range_t range,
pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata);
pmix_server_module_t mymodule = {
.client_connected = server_client_connected_fn,
.client_finalized = server_client_finalized_fn,
.abort = server_abort_fn,
.fence_nb = server_fencenb_fn,
.direct_modex = server_dmodex_req_fn,
.publish = server_publish_fn,
.lookup = server_lookup_fn,
.unpublish = server_unpublish_fn,
.spawn = server_spawn_fn,
.connect = server_connect_fn,
.disconnect = server_disconnect_fn,
.register_events = server_register_events,
.deregister_events = server_deregister_events,
.notify_event = server_notify_event
};
opal_pmix_server_module_t *host_module = NULL;
static void opal_opcbfunc(int status, void *cbdata)
{
ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata;
if (NULL != opalcaddy->opcbfunc) {
opalcaddy->opcbfunc(ext2x_convert_opalrc(status), opalcaddy->cbdata);
}
OBJ_RELEASE(opalcaddy);
}
static pmix_status_t server_client_connected_fn(const pmix_proc_t *p, void *server_object,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
opal_process_name_t proc;
ext2x_opalcaddy_t *opalcaddy;
if (NULL == host_module || NULL == host_module->client_connected) {
return PMIX_SUCCESS;
}
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->opcbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return ext2x_convert_opalrc(rc);
}
proc.vpid = ext2x_convert_rank(p->rank);
/* pass it up */
rc = host_module->client_connected(&proc, server_object,
opal_opcbfunc, opalcaddy);
return ext2x_convert_opalrc(rc);
}
static pmix_status_t server_client_finalized_fn(const pmix_proc_t *p, void* server_object,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
ext2x_opalcaddy_t *opalcaddy;
opal_process_name_t proc;
if (NULL == host_module || NULL == host_module->client_finalized) {
return PMIX_SUCCESS;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return ext2x_convert_opalrc(rc);
}
proc.vpid = ext2x_convert_rank(p->rank);
/* setup the caddy */
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->opcbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* pass it up */
rc = host_module->client_finalized(&proc, server_object, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
}
return ext2x_convert_opalrc(rc);
}
static pmix_status_t server_abort_fn(const pmix_proc_t *p, void *server_object,
int status, const char msg[],
pmix_proc_t procs[], size_t nprocs,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
size_t n;
opal_namelist_t *nm;
opal_process_name_t proc;
int rc;
ext2x_opalcaddy_t *opalcaddy;
if (NULL == host_module || NULL == host_module->abort) {
return PMIX_ERR_NOT_SUPPORTED;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return ext2x_convert_opalrc(rc);
}
proc.vpid = ext2x_convert_rank(p->rank);
/* setup the caddy */
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->opcbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* convert the array of pmix_proc_t to the list of procs */
for (n=0; n < nprocs; n++) {
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
nm->name.vpid = ext2x_convert_rank(procs[n].rank);
}
/* pass it up */
rc = host_module->abort(&proc, server_object, status, msg,
&opalcaddy->procs, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
}
return ext2x_convert_opalrc(rc);
}
static void _data_release(void *cbdata)
{
ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata;
if (NULL != opalcaddy->odmdxfunc) {
opalcaddy->odmdxfunc(opalcaddy->ocbdata);
}
OBJ_RELEASE(opalcaddy);
}
static void opmdx_response(int status, const char *data, size_t sz, void *cbdata,
opal_pmix_release_cbfunc_t relcbfunc, void *relcbdata)
{
pmix_status_t rc;
ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata;
rc = ext2x_convert_rc(status);
if (NULL != opalcaddy->mdxcbfunc) {
opalcaddy->odmdxfunc = relcbfunc;
opalcaddy->ocbdata = relcbdata;
opalcaddy->mdxcbfunc(rc, data, sz, opalcaddy->cbdata,
_data_release, opalcaddy);
} else {
OBJ_RELEASE(opalcaddy);
}
}
static pmix_status_t server_fencenb_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
char *data, size_t ndata,
pmix_modex_cbfunc_t cbfunc, void *cbdata)
{
ext2x_opalcaddy_t *opalcaddy;
size_t n;
opal_namelist_t *nm;
opal_value_t *iptr;
int rc;
if (NULL == host_module || NULL == host_module->fence_nb) {
return PMIX_ERR_NOT_SUPPORTED;
}
/* setup the caddy */
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->mdxcbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* convert the array of pmix_proc_t to the list of procs */
for (n=0; n < nprocs; n++) {
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
nm->name.vpid = ext2x_convert_rank(procs[n].rank);
}
/* convert the array of pmix_info_t to the list of info */
for (n=0; n < ninfo; n++) {
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = ext2x_value_unload(iptr, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->fence_nb(&opalcaddy->procs, &opalcaddy->info,
data, ndata, opmdx_response, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
}
return ext2x_convert_opalrc(rc);
}
static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *p,
const pmix_info_t info[], size_t ninfo,
pmix_modex_cbfunc_t cbfunc, void *cbdata)
{
int rc;
ext2x_opalcaddy_t *opalcaddy;
opal_process_name_t proc;
opal_value_t *iptr;
size_t n;
if (NULL == host_module || NULL == host_module->direct_modex) {
return PMIX_ERR_NOT_SUPPORTED;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return ext2x_convert_opalrc(rc);
}
proc.vpid = ext2x_convert_rank(p->rank);
/* setup the caddy */
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->mdxcbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* convert the array of pmix_info_t to the list of info */
for (n=0; n < ninfo; n++) {
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = ext2x_value_unload(iptr, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->direct_modex(&proc, &opalcaddy->info, opmdx_response, opalcaddy);
if (OPAL_SUCCESS != rc && OPAL_ERR_IN_PROCESS != rc) {
OBJ_RELEASE(opalcaddy);
}
if (OPAL_ERR_IN_PROCESS == rc) {
rc = OPAL_SUCCESS;
}
return ext2x_convert_opalrc(rc);
}
static pmix_status_t server_publish_fn(const pmix_proc_t *p,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
size_t n;
ext2x_opalcaddy_t *opalcaddy;
opal_process_name_t proc;
opal_value_t *oinfo;
if (NULL == host_module || NULL == host_module->publish) {
return PMIX_ERR_NOT_SUPPORTED;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return ext2x_convert_opalrc(rc);
}
proc.vpid = ext2x_convert_rank(p->rank);
/* setup the caddy */
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->opcbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* convert the info array */
for (n=0; n < ninfo; n++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->publish(&proc, &opalcaddy->info, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
}
return ext2x_convert_opalrc(rc);
}
static void opal_lkupcbfunc(int status,
opal_list_t *data,
void *cbdata)
{
ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata;
pmix_status_t rc;
pmix_pdata_t *d=NULL;
size_t nd=0, n;
opal_pmix_pdata_t *p;
if (NULL != opalcaddy->lkupcbfunc) {
rc = ext2x_convert_opalrc(status);
/* convert any returned data */
if (NULL != data) {
nd = opal_list_get_size(data);
PMIX_PDATA_CREATE(d, nd);
n=0;
OPAL_LIST_FOREACH(p, data, opal_pmix_pdata_t) {
/* convert the jobid */
(void)opal_snprintf_jobid(d[n].proc.nspace, PMIX_MAX_NSLEN, p->proc.jobid);
d[n].proc.rank = ext2x_convert_opalrank(p->proc.vpid);
(void)strncpy(d[n].key, p->value.key, PMIX_MAX_KEYLEN);
ext2x_value_load(&d[n].value, &p->value);
}
}
opalcaddy->lkupcbfunc(rc, d, nd, opalcaddy->cbdata);
}
OBJ_RELEASE(opalcaddy);
}
static pmix_status_t server_lookup_fn(const pmix_proc_t *p, char **keys,
const pmix_info_t info[], size_t ninfo,
pmix_lookup_cbfunc_t cbfunc, void *cbdata)
{
int rc;
ext2x_opalcaddy_t *opalcaddy;
opal_process_name_t proc;
opal_value_t *iptr;
size_t n;
if (NULL == host_module || NULL == host_module->lookup) {
return PMIX_ERR_NOT_SUPPORTED;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return ext2x_convert_opalrc(rc);
}
proc.vpid = ext2x_convert_rank(p->rank);
/* setup the caddy */
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->lkupcbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* convert the array of pmix_info_t to the list of info */
for (n=0; n < ninfo; n++) {
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = ext2x_value_unload(iptr, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->lookup(&proc, keys, &opalcaddy->info, opal_lkupcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
}
return ext2x_convert_opalrc(rc);
}
static pmix_status_t server_unpublish_fn(const pmix_proc_t *p, char **keys,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
ext2x_opalcaddy_t *opalcaddy;
opal_process_name_t proc;
opal_value_t *iptr;
size_t n;
if (NULL == host_module || NULL == host_module->unpublish) {
return PMIX_SUCCESS;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return ext2x_convert_opalrc(rc);
}
proc.vpid = ext2x_convert_rank(p->rank);
/* setup the caddy */
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->opcbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* convert the array of pmix_info_t to the list of info */
for (n=0; n < ninfo; n++) {
iptr = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &iptr->super);
iptr->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = ext2x_value_unload(iptr, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->unpublish(&proc, keys, &opalcaddy->info, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
}
return ext2x_convert_opalrc(rc);
}
static void opal_spncbfunc(int status, opal_jobid_t jobid, void *cbdata)
{
ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata;
pmix_status_t rc;
char nspace[PMIX_MAX_NSLEN];
if (NULL != opalcaddy->spwncbfunc) {
rc = ext2x_convert_opalrc(status);
/* convert the jobid */
(void)opal_snprintf_jobid(nspace, PMIX_MAX_NSLEN, jobid);
opalcaddy->spwncbfunc(rc, nspace, opalcaddy->cbdata);
}
OBJ_RELEASE(opalcaddy);
}
static pmix_status_t server_spawn_fn(const pmix_proc_t *p,
const pmix_info_t job_info[], size_t ninfo,
const pmix_app_t apps[], size_t napps,
pmix_spawn_cbfunc_t cbfunc, void *cbdata)
{
ext2x_opalcaddy_t *opalcaddy;
opal_process_name_t proc;
opal_pmix_app_t *app;
opal_value_t *oinfo;
size_t k, n;
int rc;
if (NULL == host_module || NULL == host_module->spawn) {
return PMIX_ERR_NOT_SUPPORTED;
}
/* convert the nspace/rank to an opal_process_name_t */
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) {
return ext2x_convert_opalrc(rc);
}
proc.vpid = ext2x_convert_rank(p->rank);
/* setup the caddy */
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->spwncbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* convert the job info */
for (k=0; k < ninfo; k++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(job_info[k].key);
if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, job_info[k].key, &job_info[k].value))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
}
/* convert the apps */
for (n=0; n < napps; n++) {
app = OBJ_NEW(opal_pmix_app_t);
opal_list_append(&opalcaddy->apps, &app->super);
if (NULL != apps[n].cmd) {
app->cmd = strdup(apps[n].cmd);
}
app->argc = apps[n].argc;
if (NULL != apps[n].argv) {
app->argv = opal_argv_copy(apps[n].argv);
}
if (NULL != apps[n].env) {
app->env = opal_argv_copy(apps[n].env);
}
app->maxprocs = apps[n].maxprocs;
for (k=0; k < apps[n].ninfo; k++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&app->info, &oinfo->super);
oinfo->key = strdup(apps[n].info[k].key);
if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, apps[n].info[k].key, &apps[n].info[k].value))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
}
}
/* pass it up */
rc = host_module->spawn(&proc, &opalcaddy->info, &opalcaddy->apps, opal_spncbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OPAL_ERROR_LOG(rc);
OBJ_RELEASE(opalcaddy);
}
return ext2x_convert_opalrc(rc);
}
static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
ext2x_opalcaddy_t *opalcaddy;
opal_namelist_t *nm;
size_t n;
opal_value_t *oinfo;
if (NULL == host_module || NULL == host_module->connect) {
return PMIX_ERR_NOT_SUPPORTED;
}
/* setup the caddy */
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->opcbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* convert the array of pmix_proc_t to the list of procs */
for (n=0; n < nprocs; n++) {
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
nm->name.vpid = ext2x_convert_rank(procs[n].rank);
}
/* convert the info */
for (n=0; n < ninfo; n++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->connect(&opalcaddy->procs, &opalcaddy->info, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
}
return ext2x_convert_opalrc(rc);
}
static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t nprocs,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
int rc;
ext2x_opalcaddy_t *opalcaddy;
opal_namelist_t *nm;
size_t n;
opal_value_t *oinfo;
if (NULL == host_module || NULL == host_module->disconnect) {
return PMIX_ERR_NOT_SUPPORTED;
}
/* setup the caddy */
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->opcbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* convert the array of pmix_proc_t to the list of procs */
for (n=0; n < nprocs; n++) {
nm = OBJ_NEW(opal_namelist_t);
opal_list_append(&opalcaddy->procs, &nm->super);
if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
nm->name.vpid = ext2x_convert_rank(procs[n].rank);
}
/* convert the info */
for (n=0; n < ninfo; n++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->disconnect(&opalcaddy->procs, &opalcaddy->info, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
}
return ext2x_convert_opalrc(rc);
}
static pmix_status_t server_register_events(pmix_status_t *codes, size_t ncodes,
const pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
ext2x_opalcaddy_t *opalcaddy;
size_t n;
opal_value_t *oinfo;
int rc;
/* setup the caddy */
opalcaddy = OBJ_NEW(ext2x_opalcaddy_t);
opalcaddy->opcbfunc = cbfunc;
opalcaddy->cbdata = cbdata;
/* convert the info */
for (n=0; n < ninfo; n++) {
oinfo = OBJ_NEW(opal_value_t);
opal_list_append(&opalcaddy->info, &oinfo->super);
oinfo->key = strdup(info[n].key);
if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, info[n].key, &info[n].value))) {
OBJ_RELEASE(opalcaddy);
return ext2x_convert_opalrc(rc);
}
}
/* pass it up */
rc = host_module->register_events(&opalcaddy->info, opal_opcbfunc, opalcaddy);
if (OPAL_SUCCESS != rc) {
OBJ_RELEASE(opalcaddy);
}
return ext2x_convert_opalrc(rc);
}
static pmix_status_t server_deregister_events(pmix_status_t *codes, size_t ncodes,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
return PMIX_ERR_NOT_SUPPORTED;
}
static pmix_status_t server_notify_event(pmix_status_t code,
const pmix_proc_t *source,
pmix_data_range_t range,
pmix_info_t info[], size_t ninfo,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
return PMIX_ERR_NOT_SUPPORTED;
}

517
opal/mca/pmix/ext2x/pmix_ext2x_server_south.c Обычный файл
Просмотреть файл

@ -0,0 +1,517 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* 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-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "opal_config.h"
#include "opal/constants.h"
#include "opal/types.h"
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "opal/dss/dss.h"
#include "opal/mca/event/event.h"
#include "opal/mca/hwloc/base/base.h"
#include "opal/runtime/opal.h"
#include "opal/runtime/opal_progress_threads.h"
#include "opal/util/argv.h"
#include "opal/util/error.h"
#include "opal/util/output.h"
#include "opal/util/proc.h"
#include "opal/util/show_help.h"
#include "opal/mca/pmix/base/base.h"
#include "pmix_ext2x.h"
#include "pmix.h"
#include "pmix_server.h"
/**** S.O.U.T.H.B.O.U.N.D I.N.T.E.R.F.A.C.E.S ****/
/* These are the interfaces used by the OMPI/ORTE/OPAL layer to call
* down into the embedded PMIx server. */
extern pmix_server_module_t mymodule;
extern opal_pmix_server_module_t *host_module;
static char *dbgvalue=NULL;
static size_t errhdler_ref = 0;
#define PMIX_WAIT_FOR_COMPLETION(a) \
do { \
while ((a)) { \
usleep(10); \
} \
} while (0)
static void errreg_cbfunc (pmix_status_t status,
size_t errhandler_ref,
void *cbdata)
{
volatile bool *active = (volatile bool*)cbdata;
errhdler_ref = errhandler_ref;
opal_output_verbose(5, opal_pmix_base_framework.framework_output,
"PMIX server errreg_cbfunc - error handler registered status=%d, reference=%lu",
status, (unsigned long)errhandler_ref);
*active = false;
}
int ext2x_server_init(opal_pmix_server_module_t *module,
opal_list_t *info)
{
pmix_status_t rc;
int dbg;
opal_value_t *kv;
pmix_info_t *pinfo;
size_t sz, n;
volatile bool active;
opal_ext2x_jobid_trkr_t *job;
if (0 < (dbg = opal_output_get_verbosity(opal_pmix_base_framework.framework_output))) {
asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg);
putenv(dbgvalue);
}
/* convert the list to an array of pmix_info_t */
if (NULL != info) {
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
ext2x_value_load(&pinfo[n].value, kv);
++n;
}
} else {
sz = 0;
pinfo = NULL;
}
/* insert ourselves into our list of jobids - it will be the
* first, and so we'll check it first */
job = OBJ_NEW(opal_ext2x_jobid_trkr_t);
(void)opal_snprintf_jobid(job->nspace, PMIX_MAX_NSLEN, OPAL_PROC_MY_NAME.jobid);
job->jobid = OPAL_PROC_MY_NAME.jobid;
opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super);
if (PMIX_SUCCESS != (rc = PMIx_server_init(&mymodule, pinfo, sz))) {
PMIX_INFO_FREE(pinfo, sz);
return ext2x_convert_rc(rc);
}
PMIX_INFO_FREE(pinfo, sz);
/* record the host module */
host_module = module;
/* register the default event handler */
active = true;
PMIx_Register_event_handler(NULL, 0, NULL, 0, ext2x_event_hdlr, errreg_cbfunc, (void*)&active);
PMIX_WAIT_FOR_COMPLETION(active);
return OPAL_SUCCESS;
}
static void fincb(pmix_status_t status, void *cbdata)
{
volatile bool *active = (volatile bool*)cbdata;
*active = false;
}
int ext2x_server_finalize(void)
{
pmix_status_t rc;
volatile bool active;
/* deregister the default event handler */
active = true;
PMIx_Deregister_event_handler(errhdler_ref, fincb, (void*)&active);
PMIX_WAIT_FOR_COMPLETION(active);
rc = PMIx_server_finalize();
return ext2x_convert_rc(rc);
}
int ext2x_server_gen_regex(const char *input, char **regex)
{
pmix_status_t rc;
rc = PMIx_generate_regex(input, regex);
return ext2x_convert_rc(rc);
}
int ext2x_server_gen_ppn(const char *input, char **ppn)
{
pmix_status_t rc;
rc = PMIx_generate_ppn(input, ppn);
return ext2x_convert_rc(rc);
}
static void opcbfunc(pmix_status_t status, void *cbdata)
{
ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata;
if (NULL != op->opcbfunc) {
op->opcbfunc(ext2x_convert_rc(status), op->cbdata);
}
if (op->active) {
op->status = status;
op->active = false;
} else {
OBJ_RELEASE(op);
}
}
static void _reg_nspace(int sd, short args, void *cbdata)
{
ext2x_threadshift_t *cd = (ext2x_threadshift_t*)cbdata;
opal_value_t *kv, *k2;
pmix_info_t *pinfo = NULL, *pmap;
size_t sz, szmap, m, n;
char nspace[PMIX_MAX_NSLEN];
pmix_status_t rc;
opal_list_t *pmapinfo;
opal_ext2x_jobid_trkr_t *job;
ext2x_opcaddy_t op;
/* we must threadshift this request as we might not be in an event
* and we are going to access framework-global lists/objects */
/* convert the jobid */
(void)opal_snprintf_jobid(nspace, PMIX_MAX_NSLEN, cd->jobid);
/* store this job in our list of known nspaces */
job = OBJ_NEW(opal_ext2x_jobid_trkr_t);
(void)strncpy(job->nspace, nspace, PMIX_MAX_NSLEN);
job->jobid = cd->jobid;
opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super);
/* convert the list to an array of pmix_info_t */
if (NULL != cd->info) {
sz = opal_list_get_size(cd->info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, cd->info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
if (0 == strcmp(kv->key, OPAL_PMIX_PROC_DATA)) {
pinfo[n].value.type = PMIX_INFO_ARRAY;
/* the value contains a list of values - convert
* that list to another array */
pmapinfo = (opal_list_t*)kv->data.ptr;
szmap = opal_list_get_size(pmapinfo);
PMIX_INFO_CREATE(pmap, szmap);
pinfo[n].value.data.array.array = (struct pmix_info_t*)pmap;
pinfo[n].value.data.array.size = szmap;
m = 0;
OPAL_LIST_FOREACH(k2, pmapinfo, opal_value_t) {
(void)strncpy(pmap[m].key, k2->key, PMIX_MAX_KEYLEN);
ext2x_value_load(&pmap[m].value, k2);
++m;
}
} else {
ext2x_value_load(&pinfo[n].value, kv);
}
++n;
}
} else {
sz = 0;
pinfo = NULL;
}
OBJ_CONSTRUCT(&op, ext2x_opcaddy_t);
op.active = true;
rc = PMIx_server_register_nspace(nspace, cd->status, pinfo, sz,
opcbfunc, (void*)&op);
if (PMIX_SUCCESS == rc) {
PMIX_WAIT_FOR_COMPLETION(op.active);
} else {
op.status = rc;
}
/* ensure we execute the cbfunc so the caller doesn't hang */
if (NULL != cd->opcbfunc) {
cd->opcbfunc(ext2x_convert_rc(op.status), cd->cbdata);
}
if (NULL != pinfo) {
PMIX_INFO_FREE(pinfo, sz);
}
OBJ_DESTRUCT(&op);
OBJ_RELEASE(cd);
}
int ext2x_server_register_nspace(opal_jobid_t jobid,
int nlocalprocs,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
ext2x_threadshift_t *cd;
/* we must threadshift this request as it touches
* shared lists of objects */
cd = OBJ_NEW(ext2x_threadshift_t);
cd->jobid = jobid;
cd->status = nlocalprocs;
cd->info = info;
cd->opcbfunc = cbfunc;
cd->cbdata = cbdata;
/* if the cbfunc is NULL, then the caller is in an event
* and we can directly call the processing function */
if (NULL == cbfunc) {
_reg_nspace(0, 0, cd);
} else {
event_assign(&cd->ev, opal_pmix_base.evbase,
-1, EV_WRITE, _reg_nspace, cd);
event_active(&cd->ev, EV_WRITE, 1);
}
return OPAL_SUCCESS;
}
static void tdcbfunc(pmix_status_t status, void *cbdata)
{
ext2x_threadshift_t *cd = (ext2x_threadshift_t*)cbdata;
if (NULL != cd->opcbfunc) {
cd->opcbfunc(ext2x_convert_rc(status), cd->cbdata);
}
if (cd->active) {
cd->active = false;
} else {
OBJ_RELEASE(cd);
}
}
static void _dereg_nspace(int sd, short args, void *cbdata)
{
ext2x_threadshift_t *cd = (ext2x_threadshift_t*)cbdata;
opal_ext2x_jobid_trkr_t *jptr;
/* if we don't already have it, we can ignore this */
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext2x_component.jobids, opal_ext2x_jobid_trkr_t) {
if (jptr->jobid == cd->jobid) {
/* found it - tell the server to deregister */
cd->active = true;
PMIx_server_deregister_nspace(jptr->nspace, tdcbfunc, cd);
PMIX_WAIT_FOR_COMPLETION(cd->active);
OBJ_RELEASE(cd);
/* now get rid of it from our list */
opal_list_remove_item(&mca_pmix_ext2x_component.jobids, &jptr->super);
OBJ_RELEASE(jptr);
return;
}
}
/* must release the caller */
tdcbfunc(PMIX_ERR_NOT_FOUND, cd);
}
void ext2x_server_deregister_nspace(opal_jobid_t jobid,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
ext2x_threadshift_t *cd;
/* we must threadshift this request as it touches
* shared lists of objects */
cd = OBJ_NEW(ext2x_threadshift_t);
cd->jobid = jobid;
cd->opcbfunc = cbfunc;
cd->cbdata = cbdata;
if (NULL == cbfunc) {
_dereg_nspace(0, 0, cd);
} else {
event_assign(&cd->ev, opal_pmix_base.evbase,
-1, EV_WRITE, _dereg_nspace, cd);
event_active(&cd->ev, EV_WRITE, 1);
}
}
int ext2x_server_register_client(const opal_process_name_t *proc,
uid_t uid, gid_t gid,
void *server_object,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
pmix_status_t rc;
pmix_proc_t p;
ext2x_opcaddy_t op;
/* convert the jobid */
(void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc->jobid);
p.rank = ext2x_convert_opalrank(proc->vpid);
OBJ_CONSTRUCT(&op, ext2x_opcaddy_t);
op.active = true;
rc = PMIx_server_register_client(&p, uid, gid, server_object,
opcbfunc, (void*)&op);
if (PMIX_SUCCESS == rc) {
PMIX_WAIT_FOR_COMPLETION(op.active);
rc = op.status;
}
OBJ_DESTRUCT(&op);
return ext2x_convert_rc(rc);
}
static void _dereg_client(int sd, short args, void *cbdata)
{
ext2x_threadshift_t *cd = (ext2x_threadshift_t*)cbdata;
opal_ext2x_jobid_trkr_t *jptr;
pmix_proc_t p;
/* if we don't already have it, we can ignore this */
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext2x_component.jobids, opal_ext2x_jobid_trkr_t) {
if (jptr->jobid == cd->source->jobid) {
/* found it - tell the server to deregister */
(void)strncpy(p.nspace, jptr->nspace, PMIX_MAX_NSLEN);
p.rank = ext2x_convert_opalrank(cd->source->vpid);
cd->active = true;
PMIx_server_deregister_client(&p, tdcbfunc, (void*)cd);
PMIX_WAIT_FOR_COMPLETION(cd->active);
break;
}
}
OBJ_RELEASE(cd);
}
/* tell the local PMIx server to cleanup this client as it is
* done executing */
void ext2x_server_deregister_client(const opal_process_name_t *proc,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
ext2x_threadshift_t *cd;
/* we must threadshift this request as we might not be in an event
* and we are going to access framework-global lists/objects */
cd = OBJ_NEW(ext2x_threadshift_t);
cd->source = proc;
cd->opcbfunc = cbfunc;
cd->cbdata = cbdata;
if (NULL == cbfunc) {
_dereg_client(0, 0, cd);
} else {
event_assign(&cd->ev, opal_pmix_base.evbase,
-1, EV_WRITE, _dereg_client, cd);
event_active(&cd->ev, EV_WRITE, 1);
}
}
/* have the local PMIx server setup the environment for this client */
int ext2x_server_setup_fork(const opal_process_name_t *proc, char ***env)
{
pmix_status_t rc;
pmix_proc_t p;
/* convert the jobid */
(void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc->jobid);
p.rank = ext2x_convert_opalrank(proc->vpid);
rc = PMIx_server_setup_fork(&p, env);
return ext2x_convert_rc(rc);
}
/* this is the call back up from the embedded PMIx server that
* will contain the returned data. Note that the embedded server
* "owns" the data and will free it upon return from this function */
static void dmdx_response(pmix_status_t status, char *data, size_t sz, void *cbdata)
{
int rc;
ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata;
rc = ext2x_convert_rc(status);
if (NULL != op->mdxcbfunc) {
op->mdxcbfunc(rc, data, sz, op->cbdata, NULL, NULL);
}
OBJ_RELEASE(op);
}
/* request modex data for a local proc from the PMIx server */
int ext2x_server_dmodex(const opal_process_name_t *proc,
opal_pmix_modex_cbfunc_t cbfunc, void *cbdata)
{
ext2x_opcaddy_t *op;
pmix_status_t rc;
/* setup the caddy */
op = OBJ_NEW(ext2x_opcaddy_t);
op->mdxcbfunc = cbfunc;
op->cbdata = cbdata;
/* convert the jobid */
(void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, proc->jobid);
op->p.rank = ext2x_convert_opalrank(proc->vpid);
/* find the internally-cached data for this proc */
rc = PMIx_server_dmodex_request(&op->p, dmdx_response, op);
if (PMIX_SUCCESS != rc) {
OBJ_RELEASE(op);
}
return ext2x_convert_rc(rc);
}
/* tell the PMIx server to notify its local clients of an event */
int ext2x_server_notify_event(int status,
const opal_process_name_t *source,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata)
{
opal_value_t *kv;
pmix_info_t *pinfo;
size_t sz, n;
pmix_status_t rc;
ext2x_opcaddy_t *op;
/* convert the list to an array of pmix_info_t */
if (NULL != info) {
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
ext2x_value_load(&pinfo[n].value, kv);
}
} else {
sz = 0;
pinfo = NULL;
}
/* setup the caddy */
op = OBJ_NEW(ext2x_opcaddy_t);
op->info = pinfo;
op->sz = sz;
op->opcbfunc = cbfunc;
op->cbdata = cbdata;
/* convert the jobid */
if (NULL == source) {
(void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, OPAL_JOBID_INVALID);
op->p.rank = ext2x_convert_opalrank(OPAL_VPID_INVALID);
} else {
(void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, source->jobid);
op->p.rank = ext2x_convert_opalrank(source->vpid);
}
rc = ext2x_convert_opalrc(status);
/* the range is irrelevant here as the server is passing
* the event down to its local clients */
rc = PMIx_Notify_event(rc, &op->p, PMIX_RANGE_LOCAL,
pinfo, sz, opcbfunc, op);
if (PMIX_SUCCESS != rc) {
OBJ_RELEASE(op);
}
return ext2x_convert_rc(rc);
}

Просмотреть файл

@ -1,53 +0,0 @@
#
# Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
EXTRA_DIST = autogen.subdirs
SUBDIRS = pmix
sources = \
pmix2x.h \
pmix2x_component.c \
pmix2x.c \
pmix2x_client.c \
pmix2x_server_south.c \
pmix2x_server_north.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if MCA_BUILD_opal_pmix_pmix2x_DSO
component_noinst =
component_install = mca_pmix_pmix2x.la
else
component_noinst = libmca_pmix_pmix2x.la
component_install =
endif
mcacomponentdir = $(opallibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_pmix_pmix2x_la_SOURCES = $(sources)
mca_pmix_pmix2x_la_CFLAGS = $(opal_pmix_pmix2x_CFLAGS)
mca_pmix_pmix2x_la_CPPFLAGS = \
-I$(srcdir)/pmix/include $(opal_pmix_pmix2x_CPPFLAGS)
mca_pmix_pmix2x_la_LDFLAGS = -module -avoid-version $(opal_pmix_pmix2x_LDFLAGS)
mca_pmix_pmix2x_la_LIBADD = $(opal_pmix_pmix2x_LIBS)
mca_pmix_pmix2x_la_DEPENDENCIES = $(opal_pmix_pmix2x_DEPENDENCIES)
noinst_LTLIBRARIES = $(component_noinst)
libmca_pmix_pmix2x_la_SOURCES =$(sources)
libmca_pmix_pmix2x_la_CFLAGS = $(opal_pmix_pmix2x_CFLAGS)
libmca_pmix_pmix2x_la_CPPFLAGS = $(opal_pmix_pmix2x_CPPFLAGS)
libmca_pmix_pmix2x_la_LDFLAGS = -module -avoid-version $(opal_pmix_pmix2x_LDFLAGS)
libmca_pmix_pmix2x_la_LIBADD = $(opal_pmix_pmix2x_LIBS)
libmca_pmix_pmix2x_la_DEPENDENCIES = $(opal_pmix_pmix2x_DEPENDENCIES)

Просмотреть файл

@ -1,101 +0,0 @@
# -*- 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-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
# Copyright (c) 2015-2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_pmix_pmix2x_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_opal_pmix_pmix2x_CONFIG],[
AC_CONFIG_FILES([opal/mca/pmix/pmix2x/Makefile])
AC_REQUIRE([OPAL_CHECK_PMIX])
OPAL_VAR_SCOPE_PUSH([PMIX_VERSION opal_pmix_pmix2x_save_CPPFLAGS opal_pmix_pmix2x_save_LDFLAGS opal_pmix_pmix2x_save_LIBS opal_pmix_pmix2x_basedir opal_pmix_pmix2x_save_cflags])
PMIX_VERSION=
opal_pmix_pmix2x_basedir=opal/mca/pmix/pmix2x
opal_pmix_pmix2x_save_CFLAGS=$CFLAGS
opal_pmix_pmix2x_save_CPPFLAGS=$CPPFLAGS
opal_pmix_pmix2x_save_LDFLAGS=$LDFLAGS
opal_pmix_pmix2x_save_LIBS=$LIBS
opal_pmix_pmix2x_args="--without-tests-examples --disable-visibility --enable-embedded-libevent --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\" --enable-embedded-hwloc --with-hwloc-header=\\\"$opal_hwloc_base_include\\\""
AS_IF([test "$enable_debug" = "yes"],
[opal_pmix_pmix2x_args="--enable-debug $opal_pmix_pmix2x_args"
CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS -g"],
[opal_pmix_pmix2x_args="--disable-debug $opal_pmix_pmix2x_args"
CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS"])
AS_IF([test "$with_devel_headers" = "yes"], [],
[opal_pmix_pmix2x_args="--enable-embedded-mode $opal_pmix_pmix2x_args"])
CPPFLAGS="-I$OPAL_TOP_SRCDIR -I$OPAL_TOP_BUILDDIR -I$OPAL_TOP_SRCDIR/opal/include -I$OPAL_TOP_BUILDDIR/opal/include $CPPFLAGS"
OPAL_CONFIG_SUBDIR([$opal_pmix_pmix2x_basedir/pmix],
[$opal_pmix_pmix2x_args $opal_subdir_args 'CFLAGS=$CFLAGS' 'CPPFLAGS=$CPPFLAGS'],
[opal_pmix_pmix2x_happy=1], [opal_pmix_pmix2x_happy=0])
CFLAGS=$opal_pmix_pmix2x_save_CFLAGS
CPPFLAGS=$opal_pmix_pmix2x_save_CPPFLAGS
LDFLAGS=$opal_pmix_pmix2x_save_LDFLAGS
LIBS=$opal_pmix_pmix2x_save_LIBS
# If we are not building the internal pmix, then check to see
# if we are linking to an external v2.x library. If not, then
# do not use this component. NOTE: we still did all the
# above configury so that all the proper GNU Autotools
# infrastructure is setup properly (e.g., w.r.t. SUBDIRS=pmix in
# this directory's Makefile.am, we still need the Autotools "make
# distclean" infrastructure to work properly).
AC_MSG_CHECKING([if v2.x component is to be used])
AS_IF([test "$opal_external_pmix_happy" = "yes"],
[AS_IF([test "$opal_external_pmix_version" = "2"],
[AC_MSG_RESULT([yes - using an external v2.x library])
# Build flags for our Makefile.am
opal_pmix_pmix2x_CPPFLAGS=$opal_external_pmix_CPPFLAGS
opal_pmix_pmix2x_LDFLAGS=$opal_external_pmix_LDFLAGS
opal_pmix_pmix2x_LIBS=$opal_external_pmix_LIBS
opal_pmix_pmix2x_DEPENDENCIES=
# setup wrapper flags
pmix_pmix2x_WRAPPER_EXTRA_LDFLAGS=$opal_external_pmix_LDFLAGS
pmix_pmix2x_WRAPPER_EXTRA_LIBS=$opal_external_pmix_LIBS],
[AC_MSG_RESULT([no - using an external v1.x pmix; disqualifying this component])
opal_pmix_pmix2x_happy=0])],
[AC_MSG_RESULT([yes - using the internal v2.x library])
PMIX_VERSION="internal v`$srcdir/$opal_pmix_pmix2x_basedir/pmix/config/pmix_get_version.sh $srcdir/$opal_pmix_pmix2x_basedir/pmix/VERSION`"
# Build flags for our Makefile.am
opal_pmix_pmix2x_LDFLAGS=
opal_pmix_pmix2x_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_pmix_pmix2x_basedir"'/pmix/src/libpmix.la'
opal_pmix_pmix2x_CPPFLAGS='-I$(OPAL_TOP_BUILDDIR)/opal/mca/pmix/pmix2x/pmix/include -I$(OPAL_TOP_BUILDDIR)/opal/mca/pmix/pmix2x/pmix -I$(OPAL_TOP_SRCDIR)/opal/mca/pmix/pmix2x/pmix/include -I$(OPAL_TOP_SRCDIR)/opal/mca/pmix/pmix2x/pmix'
opal_pmix_pmix2x_DEPENDENCIES='$(OPAL_TOP_BUILDDIR)/opal/mca/pmix/pmix2x/pmix/src/libpmix.la'])
AC_SUBST([opal_pmix_pmix2x_LIBS])
AC_SUBST([opal_pmix_pmix2x_CPPFLAGS])
AC_SUBST([opal_pmix_pmix2x_LDFLAGS])
AC_SUBST([opal_pmix_pmix2x_DEPENDENCIES])
AS_IF([test $opal_pmix_pmix2x_happy -eq 1],
[$1],
[$2])
OPAL_VAR_SCOPE_POP
])dnl

53
opal/mca/pmix/pmix3x/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,53 @@
#
# Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
EXTRA_DIST = autogen.subdirs
SUBDIRS = pmix
sources = \
pmix3x.h \
pmix3x_component.c \
pmix3x.c \
pmix3x_client.c \
pmix3x_server_south.c \
pmix3x_server_north.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if MCA_BUILD_opal_pmix_pmix3x_DSO
component_noinst =
component_install = mca_pmix_pmix3x.la
else
component_noinst = libmca_pmix_pmix3x.la
component_install =
endif
mcacomponentdir = $(opallibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_pmix_pmix3x_la_SOURCES = $(sources)
mca_pmix_pmix3x_la_CFLAGS = $(opal_pmix_pmix3x_CFLAGS)
mca_pmix_pmix3x_la_CPPFLAGS = \
-I$(srcdir)/pmix/include $(opal_pmix_pmix3x_CPPFLAGS)
mca_pmix_pmix3x_la_LDFLAGS = -module -avoid-version $(opal_pmix_pmix3x_LDFLAGS)
mca_pmix_pmix3x_la_LIBADD = $(opal_pmix_pmix3x_LIBS)
mca_pmix_pmix3x_la_DEPENDENCIES = $(opal_pmix_pmix3x_DEPENDENCIES)
noinst_LTLIBRARIES = $(component_noinst)
libmca_pmix_pmix3x_la_SOURCES =$(sources)
libmca_pmix_pmix3x_la_CFLAGS = $(opal_pmix_pmix3x_CFLAGS)
libmca_pmix_pmix3x_la_CPPFLAGS = $(opal_pmix_pmix3x_CPPFLAGS)
libmca_pmix_pmix3x_la_LDFLAGS = -module -avoid-version $(opal_pmix_pmix3x_LDFLAGS)
libmca_pmix_pmix3x_la_LIBADD = $(opal_pmix_pmix3x_LIBS)
libmca_pmix_pmix3x_la_DEPENDENCIES = $(opal_pmix_pmix3x_DEPENDENCIES)

97
opal/mca/pmix/pmix3x/configure.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,97 @@
# -*- 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-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
# Copyright (c) 2015-2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_pmix_pmix3x_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_opal_pmix_pmix3x_CONFIG],[
AC_CONFIG_FILES([opal/mca/pmix/pmix3x/Makefile])
OPAL_VAR_SCOPE_PUSH([PMIX_VERSION opal_pmix_pmix3x_save_CPPFLAGS opal_pmix_pmix3x_save_LDFLAGS opal_pmix_pmix3x_save_LIBS opal_pmix_pmix3x_basedir opal_pmix_pmix3x_save_cflags])
opal_pmix_pmix3x_basedir=opal/mca/pmix/pmix3x
opal_pmix_pmix3x_save_CFLAGS=$CFLAGS
opal_pmix_pmix3x_save_CPPFLAGS=$CPPFLAGS
opal_pmix_pmix3x_save_LDFLAGS=$LDFLAGS
opal_pmix_pmix3x_save_LIBS=$LIBS
opal_pmix_pmix3x_args="--without-tests-examples --disable-visibility --enable-embedded-libevent --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\" --enable-embedded-hwloc --with-hwloc-header=\\\"$opal_hwloc_base_include\\\""
AS_IF([test "$enable_debug" = "yes"],
[opal_pmix_pmix3x_args="--enable-debug $opal_pmix_pmix3x_args"
CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS -g"],
[opal_pmix_pmix3x_args="--disable-debug $opal_pmix_pmix3x_args"
CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS"])
AS_IF([test "$with_devel_headers" = "yes"], [],
[opal_pmix_pmix3x_args="--enable-embedded-mode $opal_pmix_pmix3x_args"])
CPPFLAGS="-I$OPAL_TOP_SRCDIR -I$OPAL_TOP_BUILDDIR -I$OPAL_TOP_SRCDIR/opal/include -I$OPAL_TOP_BUILDDIR/opal/include $CPPFLAGS"
OPAL_CONFIG_SUBDIR([$opal_pmix_pmix3x_basedir/pmix],
[$opal_pmix_pmix3x_args $opal_subdir_args 'CFLAGS=$CFLAGS' 'CPPFLAGS=$CPPFLAGS'],
[opal_pmix_pmix3x_happy=1], [opal_pmix_pmix3x_happy=0])
CFLAGS=$opal_pmix_pmix3x_save_CFLAGS
CPPFLAGS=$opal_pmix_pmix3x_save_CPPFLAGS
LDFLAGS=$opal_pmix_pmix3x_save_LDFLAGS
LIBS=$opal_pmix_pmix3x_save_LIBS
# If we are not building the internal pmix, then check to see
# if we are linking to an external v3.x library. If not, then
# do not use this component. NOTE: we still did all the
# above configury so that all the proper GNU Autotools
# infrastructure is setup properly (e.g., w.r.t. SUBDIRS=pmix in
# this directory's Makefile.am, we still need the Autotools "make
# distclean" infrastructure to work properly).
AC_MSG_CHECKING([if v3.x component is to be used])
AS_IF([test "$opal_external_pmix_happy" = "yes"],
[AS_IF([test "$opal_external_pmix_version" = "3X"],
[AC_MSG_RESULT([yes - using an external v3.x library])
# Build flags for our Makefile.am
opal_pmix_pmix3x_CPPFLAGS=$opal_external_pmix_CPPFLAGS
opal_pmix_pmix3x_LDFLAGS=$opal_external_pmix_LDFLAGS
opal_pmix_pmix3x_LIBS=$opal_external_pmix_LIBS
opal_pmix_pmix3x_DEPENDENCIES=
# setup wrapper flags
pmix_pmix3x_WRAPPER_EXTRA_LDFLAGS=$opal_external_pmix_LDFLAGS
pmix_pmix3x_WRAPPER_EXTRA_LIBS=$opal_external_pmix_LIBS],
[AC_MSG_RESULT([no - disqualifying this component])
opal_pmix_pmix3x_happy=0])],
[AC_MSG_RESULT([yes - using the internal v3.x library])
# Build flags for our Makefile.am
opal_pmix_pmix3x_LDFLAGS=
opal_pmix_pmix3x_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_pmix_pmix3x_basedir"'/pmix/src/libpmix.la'
opal_pmix_pmix3x_CPPFLAGS='-I$(OPAL_TOP_BUILDDIR)/opal/mca/pmix/pmix3x/pmix/include -I$(OPAL_TOP_BUILDDIR)/opal/mca/pmix/pmix3x/pmix -I$(OPAL_TOP_SRCDIR)/opal/mca/pmix/pmix3x/pmix/include -I$(OPAL_TOP_SRCDIR)/opal/mca/pmix/pmix3x/pmix'
opal_pmix_pmix3x_DEPENDENCIES='$(OPAL_TOP_BUILDDIR)/opal/mca/pmix/pmix3x/pmix/src/libpmix.la'])
AC_SUBST([opal_pmix_pmix3x_LIBS])
AC_SUBST([opal_pmix_pmix3x_CPPFLAGS])
AC_SUBST([opal_pmix_pmix3x_LDFLAGS])
AC_SUBST([opal_pmix_pmix3x_DEPENDENCIES])
AS_IF([test $opal_pmix_pmix3x_happy -eq 1],
[$1],
[$2])
OPAL_VAR_SCOPE_POP
])dnl

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -3,7 +3,7 @@
# Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
# Copyright (c) 2013 Mellanox Technologies, Inc.
# All rights reserved.
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
# Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
# This is the VERSION file for PMIx, describing the precise
# version of PMIx in this distribution. The various components of
@ -13,7 +13,7 @@
# major, minor, and release are generally combined in the form
# <major>.<minor>.<release>.
major=2
major=3
minor=0
release=0

Просмотреть файл

@ -86,7 +86,6 @@ AC_DEFUN([PMIX_SETUP_CORE],[
AC_SUBST(PMIX_RELEASE_DATE)
# Save the breakdown the version information
AC_MSG_CHECKING([for pmix major version])
PMIX_MAJOR_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --major`"
if test "$?" != "0"; then
AC_MSG_ERROR([Cannot continue])
@ -95,7 +94,6 @@ AC_DEFUN([PMIX_SETUP_CORE],[
AC_DEFINE_UNQUOTED([PMIX_MAJOR_VERSION], [$PMIX_MAJOR_VERSION],
[The library major version is always available, contrary to VERSION])
AC_MSG_CHECKING([for pmix minor version])
PMIX_MINOR_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --minor`"
if test "$?" != "0"; then
AC_MSG_ERROR([Cannot continue])
@ -104,7 +102,6 @@ AC_DEFUN([PMIX_SETUP_CORE],[
AC_DEFINE_UNQUOTED([PMIX_MINOR_VERSION], [$PMIX_MINOR_VERSION],
[The library minor version is always available, contrary to VERSION])
AC_MSG_CHECKING([for pmix release version])
PMIX_RELEASE_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --release`"
if test "$?" != "0"; then
AC_MSG_ERROR([Cannot continue])

Просмотреть файл

@ -385,7 +385,7 @@ pmix_status_t PMIx_generate_regex(const char *input, char **regex);
* of ranges. Thus, an input of:
* "1-4;2-5;8,10,11,12;6,7,9"
* would generate a regex of
* "[pmix:2x(3);8,10-12;6-7,9]"
* "[pmix:3x(3);8,10-12;6-7,9]"
*
* Note that the "pmix" at the beginning of each regex indicates
* that the PMIx native parser is to be used by the client for

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше