1
1

ess/alps: add initial alps ess component

Note this alps ess component has nothing to do
with the old CNOS alps component used on
Cray Seastar/Portals3 (Cray XT) systems.

To work properly, changes need to be made to the
open method of the ess/pmi component to keep it
from selecting, and thus initializing, the opal/pmix/cray
component.
Этот коммит содержится в:
Howard Pritchard 2014-11-21 12:26:12 -07:00
родитель 32bf0e7b7e
Коммит a753c3ece0
6 изменённых файлов: 751 добавлений и 0 удалений

50
orte/mca/ess/alps/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,50 @@
#
# 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) 2008-2010 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
sources = \
ess_alps.h \
ess_alps_component.c \
ess_alps_module.c \
ess_alps_utils.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_orte_ess_alps_DSO
component_noinst =
component_install = mca_ess_alps.la
else
component_noinst = libmca_ess_alps.la
component_install =
endif
mcacomponentdir = $(ompilibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_ess_alps_la_SOURCES = $(sources)
mca_ess_alps_la_CPPFLAGS = $(ess_alps_CPPFLAGS) -fno-ident
mca_ess_alps_la_LDFLAGS = -module -avoid-version $(ess_alps_LDFLAGS)
mca_ess_alps_la_LIBADD = $(ess_alps_LDFLAGS)
noinst_LTLIBRARIES = $(component_noinst)
libmca_ess_alps_la_SOURCES =$(sources)
libmca_ess_alps_la_CPPFLAGS = $(ess_alps_CPPFLAGS)
libmca_ess_alps_la_LDFLAGS = -module -avoid-version $(ess_alps_LDFLAGS)
libmca_ess_alps_la_LIBADD = $(ess_alps_LIBS)

52
orte/mca/ess/alps/configure.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,52 @@
# -*- 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) 2009-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2011 Los Alamos National Security, LLC.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_ess_alps_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_orte_ess_alps_CONFIG],[
AC_CONFIG_FILES([orte/mca/ess/alps/Makefile])
ess_alps_lli_happy="no"
ess_alps_util_happy="no"
PKG_CHECK_MODULES([CRAY_ALPS_LLI], [cray-alpslli],
[ess_alps_CPPFLAGS=$CRAY_ALPS_LLI_CFLAGS
ess_alps_LDFLAGS=$CRAY_ALPS_LLI_LIBS
ess_alps_LIBS=$CRAY_ALPS_LLI_LIBS
ess_alps_lli_happy="yes"],
[AC_MSG_RESULT([no])])
PKG_CHECK_MODULES([CRAY_ALPS_UTIL], [cray-alpsutil],
[ess_alps_CPPFLAGS="$ess_alps_CPPFLAGS $CRAY_ALPS_UTIL_CFLAGS"
ess_alps_LDFLAGS="$ess_alps_LDFLAGS $CRAY_ALPS_UTIL_LIBS"
ess_alps_LIBS="$ess_alps_LIBS $CRAY_ALPS_LLI_LIBS"
ess_alps_util_happy="yes"],
[AC_MSG_RESULT([no])])
AS_IF([test "$ess_alps_lli_happy" = "yes" -a "$ess_alps_util_happy" = "yes"],
[$1
AC_SUBST([ess_alps_CPPFLAGS])
AC_SUBST([ess_alps_LDFLAGS])
AC_SUBST([ess_alps_LIBS])],
[$2])
])dnl

56
orte/mca/ess/alps/ess_alps.h Обычный файл
Просмотреть файл

@ -0,0 +1,56 @@
/*
* Copyright (c) 2004-2008 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$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef ORTE_ESS_ALPS_H
#define ORTE_ESS_ALPS_H
#include "orte_config.h"
#include "opal/mca/mca.h"
#include "orte/mca/ess/ess.h"
#include "alps/alps.h"
#include "alps/alps_toolAssist.h"
#include "alps/libalpsutil.h"
#include "alps/libalpslli.h"
BEGIN_C_DECLS
/*
* Module open / close
*/
int orte_ess_alps_component_open(void);
int orte_ess_alps_component_close(void);
int orte_ess_alps_component_query(mca_base_module_t **module, int *priority);
/*
* alps component internal utility functions
*/
int orte_ess_alps_get_first_rank_on_node(int *first_rank);
int orte_ess_alps_sync_start(void);
int orte_ess_alps_sync_complete(void);
/*
* ODLS Alps module
*/
extern orte_ess_base_module_t orte_ess_alps_module;
ORTE_MODULE_DECLSPEC extern orte_ess_base_component_t mca_ess_alps_component;
END_C_DECLS
#endif /* ORTE_ESS_ALPS_H */

123
orte/mca/ess/alps/ess_alps_component.c Обычный файл
Просмотреть файл

@ -0,0 +1,123 @@
/*
* Copyright (c) 2004-2008 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-2012 Los Alamos National Security, LLC.
* 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 "orte_config.h"
#include "orte/constants.h"
#include "orte/runtime/orte_globals.h"
#include "orte/util/proc_info.h"
#include "orte/mca/ess/ess.h"
#include "orte/mca/ess/base/base.h"
#include "orte/mca/ess/alps/ess_alps.h"
#include <sys/syscall.h>
/*
* Instantiate the public struct with all of our public information
* and pointers to our public functions in it
*/
orte_ess_base_component_t mca_ess_alps_component = {
/* First, the mca_component_t struct containing meta information
about the component itself */
{
ORTE_ESS_BASE_VERSION_3_0_0,
/* Component name and version */
"alps",
ORTE_MAJOR_VERSION,
ORTE_MINOR_VERSION,
ORTE_RELEASE_VERSION,
/* Component open and close functions */
orte_ess_alps_component_open,
orte_ess_alps_component_close,
orte_ess_alps_component_query
},
{
/* The component is not checkpoint ready */
MCA_BASE_METADATA_PARAM_NONE
}
};
int
orte_ess_alps_component_open(void)
{
return ORTE_SUCCESS;
}
int orte_ess_alps_component_query(mca_base_module_t **module, int *priority)
{
int rc = ORTE_SUCCESS;
const char proc_job_file[]="/proc/job";
FILE *fd = NULL, *fd_task_is_app = NULL;
char task_is_app_fname[PATH_MAX];
/*
* don't use the alps ess component if an app proc
*/
if (ORTE_PROC_IS_APP) {
*priority = 0;
*module = NULL;
return ORTE_ERROR;
}
/*
* make sure we're in a Cray PAGG container, and that we are also on
* a compute node (i.e. we are thought of as an application task by
* the cray job kernel module - the thing that creates the PAGG)
*/
/* disqualify ourselves if not running in a Cray PAGG container */
fd = fopen(proc_job_file, "r");
if (fd == NULL) {
*priority = 0;
*module = NULL;
rc = ORTE_ERROR;
} else {
snprintf(task_is_app_fname,sizeof(task_is_app_fname),
"/proc/self/task/%ld/task_is_app",syscall(SYS_gettid));
fd_task_is_app = fopen(task_is_app_fname, "r");
if (fd_task_is_app != NULL) { /* okay we're in a PAGG container,
and we are an app task (not just a process
running on a mom node, for example),
so we should give cray pmi a shot. */
*priority = 35; /* take precendence over base */
*module = (mca_base_module_t *) &orte_ess_alps_module;
fclose(fd_task_is_app);
}
fclose(fd);
}
return rc;
}
int
orte_ess_alps_component_close(void)
{
return ORTE_SUCCESS;
}

229
orte/mca/ess/alps/ess_alps_module.c Обычный файл
Просмотреть файл

@ -0,0 +1,229 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2011 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 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/
#include "orte_config.h"
#include "orte/constants.h"
#include "orte/util/show_help.h"
#include "opal/util/argv.h"
#include "orte/util/proc_info.h"
#include "orte/mca/errmgr/base/base.h"
#include "orte/util/name_fns.h"
#include "orte/util/nidmap.h"
#include "orte/util/regex.h"
#include "orte/runtime/orte_globals.h"
#include "orte/mca/ess/ess.h"
#include "orte/mca/ess/base/base.h"
#include "orte/mca/ess/alps/ess_alps.h"
#include <errno.h>
static int alps_set_name(void);
static int rte_init(void);
static int rte_finalize(void);
orte_ess_base_module_t orte_ess_alps_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
NULL /* ft_event */
};
/* Local variables */
static orte_vpid_t starting_vpid = 0;
static int rte_init(void)
{
int ret, i;
char *error = NULL;
char **hosts = NULL;
OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output,
"ess:alps in rte_init"));
/*
* shouldn't have been able to open this ess component if
* process is app proc
*/
if (ORTE_PROC_IS_APP) {
error = "mpi rank invoking alps rte_init";
ret = ORTE_ERR_NOT_SUPPORTED;
goto fn_fail;
}
/* run the prolog */
if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog())) {
error = "orte_ess_base_std_prolog";
goto fn_fail;
}
if (ORTE_SUCCESS != (ret = alps_set_name())) {
error = "alps_set_name";
goto fn_fail;
}
/*
* if I am a daemon, complete my setup using the
* default procedure
*/
if (ORTE_PROC_IS_DAEMON) {
if (NULL != orte_node_regex) {
/* extract the nodes */
if (ORTE_SUCCESS != (ret =
orte_regex_extract_node_names(orte_node_regex, &hosts)) ||
NULL == hosts) {
error = "orte_regex_extract_node_names";
goto fn_fail;
}
/* find our host in the list */
for (i=0; NULL != hosts[i]; i++) {
if (0 == strncmp(hosts[i], orte_process_info.nodename,
strlen(hosts[i]))) {
/* correct our vpid - this is probably not necessary with aprun*/
ORTE_PROC_MY_NAME->vpid = starting_vpid + i;
OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output,
"ess:alps reset name to %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
break;
}
}
}
if (ORTE_SUCCESS != (ret = orte_ess_base_orted_setup(hosts))) {
ORTE_ERROR_LOG(ret);
error = "orte_ess_base_orted_setup";
goto fn_fail;
}
if (NULL != hosts) {
opal_argv_free(hosts);
}
/*
* now synchronize with aprun.
*/
if (ORTE_SUCCESS != (ret = orte_ess_alps_sync_start())) {
error = "orte_ess_alps_sync";
goto fn_fail;
}
ret = ORTE_SUCCESS;
goto fn_exit;
}
if (ORTE_PROC_IS_TOOL) {
/* otherwise, if I am a tool proc, use that procedure */
if (ORTE_SUCCESS != (ret = orte_ess_base_tool_setup())) {
ORTE_ERROR_LOG(ret);
error = "orte_ess_base_tool_setup";
goto fn_fail;
}
/* as a tool, I don't need a nidmap - so just return now */
ret = ORTE_SUCCESS;
goto fn_exit;
}
fn_exit:
return ret;
fn_fail:
if (ORTE_ERR_SILENT != ret && !orte_report_silent_errors) {
orte_show_help("help-orte-runtime.txt",
"orte_init:startup:internal-failure",
true, error, ORTE_ERROR_NAME(ret), ret);
}
goto fn_exit;
}
static int rte_finalize(void)
{
int ret = ORTE_SUCCESS;
/* if I am a daemon, finalize using the default procedure */
if (ORTE_PROC_IS_DAEMON) {
if (ORTE_SUCCESS != (ret = orte_ess_base_orted_finalize())) {
ORTE_ERROR_LOG(ret);
goto fn_exit;
}
/* notify alps that we're done */
if (ORTE_SUCCESS != (ret = orte_ess_alps_sync_complete())) {
ORTE_ERROR_LOG(ret);
}
} else if (ORTE_PROC_IS_TOOL) {
/* otherwise, if I am a tool proc, use that procedure */
if (ORTE_SUCCESS != (ret = orte_ess_base_tool_finalize())) {
ORTE_ERROR_LOG(ret);
}
}
fn_exit:
return ret;
}
static int alps_set_name(void)
{
int rc;
int rank;
orte_jobid_t jobid;
if (NULL == orte_ess_base_jobid) {
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
return ORTE_ERR_NOT_FOUND;
}
if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, orte_ess_base_jobid))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (NULL == orte_ess_base_vpid) {
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
return ORTE_ERR_NOT_FOUND;
}
if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&starting_vpid,
orte_ess_base_vpid))) {
ORTE_ERROR_LOG(rc);
return(rc);
}
ORTE_PROC_MY_NAME->jobid = jobid;
if (ORTE_SUCCESS != (rc = orte_ess_alps_get_first_rank_on_node(&rank))) {
ORTE_ERROR_LOG(rc);
return(rc);
}
ORTE_PROC_MY_NAME->vpid = (orte_vpid_t)rank + starting_vpid;
/* get the num procs as provided in the cmd line param */
if (ORTE_SUCCESS != (rc = orte_ess_env_get())) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}

241
orte/mca/ess/alps/ess_alps_utils.c Обычный файл
Просмотреть файл

@ -0,0 +1,241 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2011 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 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/
#include "orte_config.h"
#include "orte/constants.h"
#include "orte/util/show_help.h"
#include "opal/util/argv.h"
#include "orte/util/proc_info.h"
#include "orte/mca/errmgr/base/base.h"
#include "orte/util/name_fns.h"
#include "orte/util/nidmap.h"
#include "orte/util/regex.h"
#include "orte/runtime/orte_globals.h"
#include "orte/mca/ess/ess.h"
#include "orte/mca/ess/base/base.h"
#include "orte/mca/ess/alps/ess_alps.h"
/*
* use the Alps placement file to obtain
* the global rank of the "first" local rank
* on the node.
*/
int
orte_ess_alps_get_first_rank_on_node(int *first_rank)
{
int alps_status = 0;
uint64_t apid;
size_t alps_count;
int ret = ORTE_SUCCESS;
int lli_ret = 0, place_ret;
alpsAppLayout_t orted_layout;
if (first_rank == NULL) {
ret = ORTE_ERR_BAD_PARAM;
goto fn_exit;
}
/*
* First get our apid
*/
lli_ret = alps_app_lli_lock();
if (0 != ret) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_lock returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), lli_ret));
ret = ORTE_ERR_FILE_WRITE_FAILURE;
goto fn_exit;
}
lli_ret = alps_app_lli_put_request(ALPS_APP_LLI_ALPS_REQ_APID, NULL, 0);
if (ALPS_APP_LLI_ALPS_STAT_OK != lli_ret) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_put_request - APID returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), lli_ret));
ret = ORTE_ERR_FILE_WRITE_FAILURE;
goto fn_exit_w_lock;
}
lli_ret = alps_app_lli_get_response (&alps_status, &alps_count);
if (ALPS_APP_LLI_ALPS_STAT_OK != alps_status) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_get_response returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), alps_status));
ret = ORTE_ERR_FILE_READ_FAILURE;
goto fn_exit_w_lock;
}
lli_ret = alps_app_lli_get_response_bytes (&apid, sizeof(apid));
if (ALPS_APP_LLI_ALPS_STAT_OK != lli_ret) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_get_response_bytes returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), lli_ret));
ret = ORTE_ERR_FILE_READ_FAILURE;
goto fn_exit_w_lock;
}
place_ret = alps_get_placement_info(apid,
&orted_layout,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (1 != place_ret) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_get_placement_info returned %d (%s)",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), place_ret, strerror(errno)));
ret = ORTE_ERROR;
goto fn_exit;
}
OPAL_OUTPUT_VERBOSE((2, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_get_placement_info returned %d first pe on node is %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), place_ret, orted_layout.firstPe));
*first_rank = orted_layout.firstPe;
fn_exit_w_lock:
lli_ret = alps_app_lli_unlock();
if (ALPS_APP_LLI_ALPS_STAT_OK != lli_ret) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_unlock returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), lli_ret));
ret = ORTE_ERR_FILE_WRITE_FAILURE;
}
fn_exit:
return ret;
}
/*
* Function to check in with apshepherd to say we are a parallel application
*/
int
orte_ess_alps_sync_start(void)
{
int ret = ORTE_SUCCESS;
int lli_ret = 0;
int alps_status = 0;
size_t alps_count;
lli_ret = alps_app_lli_lock();
if (0 != ret) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_lock returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), lli_ret));
ret = ORTE_ERR_FILE_WRITE_FAILURE;
goto fn_exit;
}
lli_ret = alps_app_lli_put_request(ALPS_APP_LLI_ALPS_REQ_START, NULL, 0);
if (ALPS_APP_LLI_ALPS_STAT_OK != lli_ret) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_put_request returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), lli_ret));
ret = ORTE_ERR_FILE_WRITE_FAILURE;
goto fn_exit_w_lock;
}
lli_ret = alps_app_lli_get_response (&alps_status, &alps_count);
if (ALPS_APP_LLI_ALPS_STAT_OK != alps_status) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_get_response returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), alps_status));
ret = ORTE_ERR_FILE_READ_FAILURE;
goto fn_exit_w_lock;
}
fn_exit_w_lock:
lli_ret = alps_app_lli_unlock();
if (ALPS_APP_LLI_ALPS_STAT_OK != lli_ret) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_unlock returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), lli_ret));
ret = ORTE_ERR_FILE_WRITE_FAILURE;
}
fn_exit:
return ret;
}
/*
* Function to check in with apshepherd to say we are a parallel application
*/
int
orte_ess_alps_sync_complete(void)
{
int ret = ORTE_SUCCESS;
int lli_ret = 0;
int alps_status = 0;
size_t alps_count;
lli_ret = alps_app_lli_lock();
if (0 != ret) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_lock returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), lli_ret));
ret = ORTE_ERR_FILE_WRITE_FAILURE;
goto fn_exit;
}
lli_ret = alps_app_lli_put_request(ALPS_APP_LLI_ALPS_REQ_EXITING, NULL, 0);
if (ALPS_APP_LLI_ALPS_STAT_OK != lli_ret) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_put_request returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), lli_ret));
ret = ORTE_ERR_FILE_WRITE_FAILURE;
goto fn_exit_w_lock;
}
lli_ret = alps_app_lli_get_response (&alps_status, &alps_count);
if (ALPS_APP_LLI_ALPS_STAT_OK != alps_status) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_get_response returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), alps_status));
ret = ORTE_ERR_FILE_READ_FAILURE;
goto fn_exit_w_lock;
}
fn_exit_w_lock:
lli_ret = alps_app_lli_unlock();
if (ALPS_APP_LLI_ALPS_STAT_OK != lli_ret) {
OPAL_OUTPUT_VERBOSE((20, orte_ess_base_framework.framework_output,
"%s ess:alps: alps_app_lli_unlock returned %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), lli_ret));
ret = ORTE_ERR_FILE_WRITE_FAILURE;
}
fn_exit:
return ret;
}