1
1
Bring Slurm PMI-1 component online
Bring the s2 component online

Little cleanup - let the various PMIx modules set the process name during init, and then just raise it up to the ORTE level. Required as the different PMI environments all pass the jobid in different ways.

Bring the OMPI pubsub/pmi component online

Get comm_spawn working again

Ensure we always provide a cpuset, even if it is NULL

pmix/cray: adjust cray pmix component for pmix

Make changes so cray pmix can work within the integrated
ompi/pmix framework.

Bring singletons back online. Implement the comm_spawn operation using pmix - not tested yet

Cleanup comm_spawn - procs now starting, error in connect_accept

Complete integration
Этот коммит содержится в:
Ralph Castain 2015-06-18 09:53:20 -07:00
родитель 447eb4238a
Коммит cf6137b530
352 изменённых файлов: 52392 добавлений и 13152 удалений

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

@ -300,6 +300,11 @@ opal/mca/hwloc/hwloc*/hwloc/include/private/autogen/config.h
opal/mca/installdirs/config/install_dirs.h
opal/mca/pmix/pmix1xx/pmix/include/pmix/autogen/config.h
opal/mca/pmix/pmix1xx/pmix/include/pmix/pmix_common.h
opal/mca/pmix/pmix1xx/pmix/include/private/autogen/config.h
opal/mca/pmix/pmix1xx/pmix/include/private/autogen/config.h.in
opal/tools/opal-checkpoint/opal-checkpoint
opal/tools/opal-checkpoint/opal-checkpoint.1
opal/tools/opal-restart/opal-restart

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

@ -14,6 +14,7 @@
# Copyright (c) 2010-2011 Sandia National Laboratories. All rights reserved.
# Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2015 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -172,6 +173,7 @@ endif
include class/Makefile.am
include attribute/Makefile.am
include communicator/Makefile.am
include dpm/Makefile.am
include errhandler/Makefile.am
include file/Makefile.am
include group/Makefile.am

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

@ -20,7 +20,7 @@
* All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -34,8 +34,8 @@
#include "ompi/constants.h"
#include "opal/mca/hwloc/base/base.h"
#include "opal/mca/dstore/dstore.h"
#include "opal/dss/dss.h"
#include "opal/mca/pmix/pmix.h"
#include "ompi/proc/proc.h"
#include "opal/threads/mutex.h"
@ -43,7 +43,7 @@
#include "opal/util/output.h"
#include "ompi/mca/topo/topo.h"
#include "ompi/mca/topo/base/base.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/dpm/dpm.h"
#include "ompi/attribute/attribute.h"
#include "ompi/communicator/communicator.h"
@ -202,7 +202,7 @@ int ompi_comm_set_nb ( ompi_communicator_t **ncomm,
Necessary for the disconnect of dynamic communicators. */
if ( 0 < local_size && (OMPI_COMM_IS_INTRA(newcomm) || 0 <remote_size) ) {
ompi_dpm.mark_dyncomm (newcomm);
ompi_dpm_mark_dyncomm (newcomm);
}
/* Set error handler */
@ -1766,8 +1766,6 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
char *recvbuf;
ompi_proc_t **proc_list=NULL;
int i;
opal_list_t myvals;
opal_value_t *kv;
local_rank = ompi_comm_rank (local_comm);
local_size = ompi_comm_size (local_comm);
@ -1780,7 +1778,7 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
}
if(OMPI_GROUP_IS_DENSE(local_comm->c_local_group)) {
rc = ompi_proc_pack(local_comm->c_local_group->grp_proc_pointers,
local_size, true, sbuf);
local_size, sbuf);
}
/* get the proc list for the sparse implementations */
else {
@ -1788,7 +1786,7 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
sizeof (ompi_proc_t *));
for(i=0 ; i<local_comm->c_local_group->grp_proc_count ; i++)
proc_list[i] = ompi_group_peer_lookup(local_comm->c_local_group,i);
rc = ompi_proc_pack (proc_list, local_size, true, sbuf);
rc = ompi_proc_pack (proc_list, local_size, sbuf);
}
if ( OMPI_SUCCESS != rc ) {
goto err_exit;
@ -1867,7 +1865,7 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
}
/* decode the names into a proc-list */
rc = ompi_proc_unpack(rbuf, rsize, &rprocs, true, NULL, NULL);
rc = ompi_proc_unpack(rbuf, rsize, &rprocs, NULL, NULL);
OBJ_RELEASE(rbuf);
if (OMPI_SUCCESS != rc) {
OMPI_ERROR_LOG(rc);
@ -1876,22 +1874,16 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
/* set the locality of the remote procs */
for (i=0; i < rsize; i++) {
/* get the locality information - do not use modex recv for
* this request as that will automatically cause the hostname
* to be loaded as well. All RTEs are required to provide this
* information at startup for procs on our node. Thus, not
* finding the info indicates that the proc is non-local.
*/
OBJ_CONSTRUCT(&myvals, opal_list_t);
if (OMPI_SUCCESS != opal_dstore.fetch(opal_dstore_internal,
&rprocs[i]->super.proc_name,
OPAL_DSTORE_LOCALITY, &myvals)) {
rprocs[i]->super.proc_flags = OPAL_PROC_NON_LOCAL;
/* get the locality information - all RTEs are required
* to provide this information at startup */
uint16_t *u16ptr, u16;
u16ptr = &u16;
OPAL_MODEX_RECV_VALUE(rc, OPAL_PMIX_LOCALITY, &rprocs[i]->super.proc_name, &u16ptr, OPAL_UINT16);
if (OPAL_SUCCESS == rc) {
rprocs[i]->super.proc_flags = u16;
} else {
kv = (opal_value_t*)opal_list_get_first(&myvals);
rprocs[i]->super.proc_flags = kv->data.uint16;
rprocs[i]->super.proc_flags = OPAL_PROC_NON_LOCAL;
}
OPAL_LIST_DESTRUCT(&myvals);
}
/* And now add the information into the database */
@ -2210,7 +2202,7 @@ static int ompi_comm_fill_rest(ompi_communicator_t *comm,
if( MPI_UNDEFINED != my_rank ) {
/* verify whether to set the flag, that this comm
contains process from more than one jobid. */
ompi_dpm.mark_dyncomm (comm);
ompi_dpm_mark_dyncomm (comm);
}
/* set the error handler */

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

@ -164,7 +164,9 @@ int ompi_comm_cid_init (void)
for ( i=0; i<numprocs; i++ ) {
thisproc = procs[i];
OPAL_MODEX_RECV_STRING(ret, "MPI_THREAD_LEVEL", &thisproc->super, (uint8_t**)&tlpointer, &size);
OPAL_MODEX_RECV_STRING(ret, "MPI_THREAD_LEVEL",
&thisproc->super.proc_name,
(uint8_t**)&tlpointer, &size);
if (OMPI_SUCCESS == ret) {
thread_level = *((uint8_t *) tlpointer);
if ( OMPI_THREADLEVEL_IS_MULTIPLE (thread_level) ) {

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

@ -20,6 +20,7 @@
* All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -39,7 +40,7 @@
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
#include "ompi/attribute/attribute.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/dpm/dpm.h"
#include "ompi/memchecker.h"
/*
@ -236,7 +237,7 @@ int ompi_comm_finalize(void)
OBJ_DESTRUCT( &ompi_mpi_comm_self );
/* disconnect all dynamic communicators */
ompi_dpm.dyn_finalize();
ompi_dpm_dyn_finalize();
/* Free the attributes on comm world. This is not done in the
* destructor as we delete attributes in ompi_comm_free (which

18
ompi/dpm/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,18 @@
# -*- makefile -*-
#
# Copyright (c) 2015 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This makefile.am does not stand on its own - it is included from ompi/Makefile.am
headers += \
dpm/dpm.h
libmpi_la_SOURCES += \
dpm/dpm.c

1179
ompi/dpm/dpm.c Обычный файл

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

106
ompi/dpm/dpm.h Обычный файл
Просмотреть файл

@ -0,0 +1,106 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 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) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* Dynamic Process Management Interface
*
*/
#ifndef OMPI_DPM_H
#define OMPI_DPM_H
#include "ompi_config.h"
#include "ompi/info/info.h"
#include "ompi/communicator/communicator.h"
BEGIN_C_DECLS
/*
* Initialize the DPM system
*/
int ompi_dpm_init(void);
/*
* Connect/accept communications
*/
int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root,
const char *port, bool send_first,
ompi_communicator_t **newcomm);
/**
* Executes internally a disconnect on all dynamic communicators
* in case the user did not disconnect them.
*/
int ompi_dpm_disconnect(ompi_communicator_t *comm);
/*
* Dynamically spawn processes
*/
int ompi_dpm_spawn(int count, char const *array_of_commands[],
char **array_of_argv[],
const int array_of_maxprocs[],
const MPI_Info array_of_info[],
const char *port_name);
/*
* This routine checks, whether an application has been spawned
* by another MPI application, or has been independently started.
* If it has been spawned, it establishes the parent communicator.
* Since the routine has to communicate, it should be among the last
* steps in MPI_Init, to be sure that everything is already set up.
*/
int ompi_dpm_dyn_init(void);
/*
* Interface for mpi_finalize to call to ensure dynamically spawned procs
* collectively finalize
*/
int ompi_dpm_dyn_finalize(void);
/* this routine counts the number of different jobids of the processes
given in a certain communicator. If there is more than one jobid,
we mark the communicator as 'dynamic'. This is especially relevant
for the MPI_Comm_disconnect *and* for MPI_Finalize, where we have
to wait for all still connected processes.
*/
void ompi_dpm_mark_dyncomm(ompi_communicator_t *comm);
/*
* Define a rendezvous point for a dynamically spawned job
*/
int ompi_dpm_open_port(char *port_name);
/*
* Unpublish the rendezvous point
*/
int ompi_dpm_close_port(const char *port_name);
/*
* Finalize the DPM
*/
int ompi_dpm_finalize(void);
END_C_DECLS
#endif /* OMPI_DPM_H */

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

@ -1,37 +0,0 @@
#
# Copyright (c) 2004-2007 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) 2010 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# main library setup
noinst_LTLIBRARIES = libmca_dpm.la
libmca_dpm_la_SOURCES =
# local files
headers = dpm.h
libmca_dpm_la_SOURCES += $(headers)
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompidir = $(ompiincludedir)/$(subdir)
nobase_ompi_HEADERS = $(headers)
endif
include base/Makefile.am
distclean-local:
rm -f base/static-components.h

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

@ -1,101 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2007 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) 2012-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef OMPI_MCA_DPM_BASE_H
#define OMPI_MCA_DPM_BASE_H
#include "ompi_config.h"
#include "ompi/constants.h"
#include <time.h>
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include "ompi/mca/dpm/dpm.h"
/*
* Global functions for MCA overall DPM
*/
BEGIN_C_DECLS
struct ompi_dpm_base_disconnect_obj {
ompi_communicator_t *comm;
int size;
struct ompi_request_t **reqs;
int buf;
};
typedef struct ompi_dpm_base_disconnect_obj ompi_dpm_base_disconnect_obj;
/**
* Select an available component.
*
* @retval OMPI_SUCCESS Upon Success
* @retval OMPI_NOT_FOUND If no component can be selected
* @retval OMPI_ERROR Upon other failure
*
*/
OMPI_DECLSPEC int ompi_dpm_base_select(void);
/* Internal support functions */
OMPI_DECLSPEC char* ompi_dpm_base_dyn_init (void);
OMPI_DECLSPEC int ompi_dpm_base_dyn_finalize (void);
OMPI_DECLSPEC void ompi_dpm_base_mark_dyncomm (ompi_communicator_t *comm);
OMPI_DECLSPEC ompi_dpm_base_disconnect_obj *ompi_dpm_base_disconnect_init ( ompi_communicator_t *comm);
OMPI_DECLSPEC int ompi_dpm_base_disconnect_waitall (int count, ompi_dpm_base_disconnect_obj **objs);
/* NULL component functions */
int ompi_dpm_base_null_connect_accept (ompi_communicator_t *comm, int root,
const char *port_string, bool send_first,
ompi_communicator_t **newcomm);
int ompi_dpm_base_null_disconnect(ompi_communicator_t *comm);
int ompi_dpm_base_null_spawn(int count, const char *array_of_commands[],
char **array_of_argv[],
const int array_of_maxprocs[],
const MPI_Info array_of_info[],
const char *port_name);
int ompi_dpm_base_null_dyn_init(void);
int ompi_dpm_base_null_dyn_finalize (void);
void ompi_dpm_base_null_mark_dyncomm (ompi_communicator_t *comm);
int ompi_dpm_base_null_open_port(char *port_name, ompi_rml_tag_t given_tag);
int ompi_dpm_base_null_parse_port(const char *port_name,
char **hnp_uri, char **rml_uri, ompi_rml_tag_t *tag);
int ompi_dpm_base_null_route_to_port(char *rml_uri, ompi_process_name_t *rproc);
int ompi_dpm_base_null_close_port(const char *port_name);
int ompi_dpm_base_null_pconnect(char *port,
struct timeval *timeout,
ompi_dpm_base_paccept_connect_callback_fn_t cbfunc,
void *cbdata);
int ompi_dpm_base_null_paccept(char *port,
ompi_dpm_base_paccept_connect_callback_fn_t cbfunc,
void *cbdata);
void ompi_dpm_base_null_pclose(char *port);
/* useful globals */
OMPI_DECLSPEC extern ompi_dpm_base_component_t ompi_dpm_base_selected_component;
OMPI_DECLSPEC extern ompi_dpm_base_module_t ompi_dpm;
OMPI_DECLSPEC extern mca_base_framework_t ompi_dpm_base_framework;
END_C_DECLS
#endif /* OMPI_MCA_DPM_BASE_H */

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

@ -1,289 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2007 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) 2006-2007 University of Houston. All rights reserved.
* Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved.
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <string.h>
#include <stdio.h>
#include "ompi/request/request.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/mca/pml/pml.h"
#include "ompi/mca/dpm/base/base.h"
char* ompi_dpm_base_dyn_init (void)
{
char *envvarname=NULL, *port_name=NULL, *tmp, *ptr;
/* check for appropriate env variable */
asprintf(&envvarname, "OMPI_PARENT_PORT");
tmp = getenv(envvarname);
free (envvarname);
if (NULL != tmp) {
/* the value passed to us may have quote marks around it to protect
* the value if passed on the command line. We must remove those
* to have a correct string
*/
if ('"' == tmp[0]) {
/* if the first char is a quote, then so will the last one be */
tmp[strlen(tmp)-1] = '\0';
ptr = &tmp[1];
} else {
ptr = &tmp[0];
}
port_name = strdup(ptr);
}
return port_name;
}
/**********************************************************************/
/**********************************************************************/
/**********************************************************************/
/* this routine runs through the list of communicators
and does the disconnect for all dynamic communicators */
int ompi_dpm_base_dyn_finalize (void)
{
int i,j=0, max=0;
ompi_dpm_base_disconnect_obj **objs=NULL;
ompi_communicator_t *comm=NULL;
if ( 1 <ompi_comm_num_dyncomm ) {
objs = (ompi_dpm_base_disconnect_obj **)malloc (ompi_comm_num_dyncomm*
sizeof(ompi_dpm_base_disconnect_obj*));
if ( NULL == objs ) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
max = opal_pointer_array_get_size(&ompi_mpi_communicators);
for ( i=3; i<max; i++ ) {
comm = (ompi_communicator_t*)opal_pointer_array_get_item(&ompi_mpi_communicators,i);
if (NULL != comm && OMPI_COMM_IS_DYNAMIC(comm)) {
objs[j++]=ompi_dpm_base_disconnect_init(comm);
}
}
if ( j != ompi_comm_num_dyncomm+1 ) {
free (objs);
return OMPI_ERROR;
}
ompi_dpm_base_disconnect_waitall (ompi_comm_num_dyncomm, objs);
free (objs);
}
return OMPI_SUCCESS;
}
/* the next two routines implement a kind of non-blocking barrier.
the only difference is, that you can wait for the completion
of more than one initiated ibarrier. This is required for waiting
for all still connected processes in MPI_Finalize.
ompi_comm_disconnect_init returns a handle, which has to be passed in
to ompi_comm_disconnect_waitall. The second routine blocks, until
all non-blocking barriers described by the handles are finished.
The communicators can than be released.
*/
/**********************************************************************/
/**********************************************************************/
/**********************************************************************/
ompi_dpm_base_disconnect_obj *ompi_dpm_base_disconnect_init ( ompi_communicator_t *comm)
{
ompi_dpm_base_disconnect_obj *obj=NULL;
int ret;
int i;
obj = (ompi_dpm_base_disconnect_obj *) calloc(1,sizeof(ompi_dpm_base_disconnect_obj));
if ( NULL == obj ) {
printf("Could not allocate disconnect object\n");
return NULL;
}
if ( OMPI_COMM_IS_INTER(comm) ) {
obj->size = ompi_comm_remote_size (comm);
} else {
obj->size = ompi_comm_size (comm);
}
obj->comm = comm;
obj->reqs = (ompi_request_t **) malloc(2*obj->size*sizeof(ompi_request_t *));
if ( NULL == obj->reqs ) {
printf("Could not allocate request array for disconnect object\n");
free (obj);
return NULL;
}
/* initiate all isend_irecvs. We use a dummy buffer stored on
the object, since we are sending zero size messages anyway. */
for ( i=0; i < obj->size; i++ ) {
ret = MCA_PML_CALL(irecv (&(obj->buf), 0, MPI_INT, i,
OMPI_COMM_BARRIER_TAG, comm,
&(obj->reqs[2*i])));
if ( OMPI_SUCCESS != ret ) {
printf("dpm_base_disconnect_init: error %d in irecv to process %d\n", ret, i);
free (obj->reqs);
free (obj);
return NULL;
}
ret = MCA_PML_CALL(isend (&(obj->buf), 0, MPI_INT, i,
OMPI_COMM_BARRIER_TAG,
MCA_PML_BASE_SEND_SYNCHRONOUS,
comm, &(obj->reqs[2*i+1])));
if ( OMPI_SUCCESS != ret ) {
printf("dpm_base_disconnect_init: error %d in isend to process %d\n", ret, i);
free (obj->reqs);
free (obj);
return NULL;
}
}
/* return handle */
return obj;
}
/**********************************************************************/
/**********************************************************************/
/**********************************************************************/
/* - count how many requests are active
* - generate a request array large enough to hold
all active requests
* - call waitall on the overall request array
* - free the objects
*/
int ompi_dpm_base_disconnect_waitall (int count, ompi_dpm_base_disconnect_obj **objs)
{
ompi_request_t **reqs=NULL;
char *treq=NULL;
int totalcount = 0;
int i;
int ret;
for (i=0; i<count; i++) {
if (NULL == objs[i]) {
printf("Error in comm_disconnect_waitall\n");
return OMPI_ERROR;
}
totalcount += objs[i]->size;
}
reqs = (ompi_request_t **) malloc (2*totalcount*sizeof(ompi_request_t *));
if ( NULL == reqs ) {
printf("ompi_comm_disconnect_waitall: error allocating memory\n");
return OMPI_ERROR;
}
/* generate a single, large array of pending requests */
treq = (char *)reqs;
for (i=0; i<count; i++) {
memcpy (treq, objs[i]->reqs, 2*objs[i]->size * sizeof(ompi_request_t *));
treq += 2*objs[i]->size * sizeof(ompi_request_t *);
}
/* force all non-blocking all-to-alls to finish */
ret = ompi_request_wait_all (2*totalcount, reqs, MPI_STATUSES_IGNORE);
/* Finally, free everything */
for (i=0; i< count; i++ ) {
if (NULL != objs[i]->reqs ) {
free (objs[i]->reqs );
free (objs[i]);
}
}
free (reqs);
return ret;
}
/**********************************************************************/
/**********************************************************************/
/**********************************************************************/
/* All we want to do in this function is determine if the number of
* jobids in the local and/or remote group is > 1. This tells us to
* set the disconnect flag. We don't actually care what the true
* number -is-, only that it is > 1
*/
void ompi_dpm_base_mark_dyncomm (ompi_communicator_t *comm)
{
int i;
int size, rsize;
bool found=false;
ompi_jobid_t thisjobid;
ompi_group_t *grp=NULL;
ompi_proc_t *proc = NULL;
/* special case for MPI_COMM_NULL */
if ( comm == MPI_COMM_NULL ) {
return;
}
size = ompi_comm_size (comm);
rsize = ompi_comm_remote_size(comm);
/* loop over all processes in local group and check for
* a different jobid
*/
grp = comm->c_local_group;
proc = ompi_group_peer_lookup(grp,0);
thisjobid = ((ompi_process_name_t*)&proc->super.proc_name)->jobid;
for (i=1; i< size; i++) {
proc = ompi_group_peer_lookup(grp,i);
if (thisjobid != ((ompi_process_name_t*)&proc->super.proc_name)->jobid) {
/* at least one is different */
found = true;
goto complete;
}
}
/* if inter-comm, loop over all processes in remote_group
* and see if any are different from thisjobid
*/
grp = comm->c_remote_group;
for (i=0; i< rsize; i++) {
proc = ompi_group_peer_lookup(grp,i);
if (thisjobid != ((ompi_process_name_t*)&proc->super.proc_name)->jobid) {
/* at least one is different */
found = true;
break;
}
}
complete:
/* if a different jobid was found, set the disconnect flag*/
if (found) {
ompi_comm_num_dyncomm++;
OMPI_COMM_SET_DYNAMIC(comm);
}
return;
}

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

@ -1,68 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* 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) 2013 Intel, Inc. All rights reserved
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/mca/mca.h"
#include "opal/util/output.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/mca/dpm/base/base.h"
#include "ompi/mca/dpm/base/static-components.h"
/*
* Globals
*/
OMPI_DECLSPEC ompi_dpm_base_module_t ompi_dpm = {
NULL,
ompi_dpm_base_null_connect_accept,
ompi_dpm_base_null_disconnect,
ompi_dpm_base_null_spawn,
ompi_dpm_base_null_dyn_init,
ompi_dpm_base_null_dyn_finalize,
ompi_dpm_base_null_mark_dyncomm,
ompi_dpm_base_null_open_port,
ompi_dpm_base_null_parse_port,
ompi_dpm_base_null_route_to_port,
ompi_dpm_base_null_close_port,
NULL,
ompi_dpm_base_null_pconnect,
ompi_dpm_base_null_paccept,
ompi_dpm_base_null_pclose
};
ompi_dpm_base_component_t ompi_dpm_base_selected_component = {{0}};
static int ompi_dpm_base_close(void)
{
/* Close the selected component */
if( NULL != ompi_dpm.finalize ) {
ompi_dpm.finalize();
}
/* Close all available modules that are open */
return mca_base_framework_components_close(&ompi_dpm_base_framework, NULL);
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, dpm, NULL, NULL, NULL, ompi_dpm_base_close,
mca_dpm_base_static_components, 0);

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

@ -1,113 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2007 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) 2006-2007 University of Houston. All rights reserved.
* Copyright (c) 2006-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013 Intel, Inc. All rights reserved
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <string.h>
#include <stdio.h>
#include <time.h>
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include "ompi/mca/dpm/dpm.h"
#include "ompi/mca/dpm/base/base.h"
int ompi_dpm_base_null_connect_accept (ompi_communicator_t *comm, int root,
const char *port_string, bool send_first,
ompi_communicator_t **newcomm)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int ompi_dpm_base_null_disconnect(ompi_communicator_t *comm)
{
return OMPI_SUCCESS;
}
int ompi_dpm_base_null_spawn(int count, const char *array_of_commands[],
char **array_of_argv[],
const int array_of_maxprocs[],
const MPI_Info array_of_info[],
const char *port_name)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int ompi_dpm_base_null_dyn_init(void)
{
return OMPI_SUCCESS;
}
int ompi_dpm_base_null_dyn_finalize (void)
{
return OMPI_SUCCESS;
}
void ompi_dpm_base_null_mark_dyncomm (ompi_communicator_t *comm)
{
return;
}
int ompi_dpm_base_null_open_port(char *port_name, ompi_rml_tag_t given_tag)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int ompi_dpm_base_null_parse_port(const char *port_name,
char **hnp_uri, char **rml_uri, ompi_rml_tag_t *tag)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int ompi_dpm_base_null_route_to_port(char *rml_uri, ompi_process_name_t *rproc)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int ompi_dpm_base_null_close_port(const char *port_name)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int ompi_dpm_base_null_pconnect(char *port,
struct timeval *timeout,
ompi_dpm_base_paccept_connect_callback_fn_t cbfunc,
void *cbdata)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int ompi_dpm_base_null_paccept(char *port,
ompi_dpm_base_paccept_connect_callback_fn_t cbfunc,
void *cbdata)
{
return OMPI_ERR_NOT_SUPPORTED;
}
void ompi_dpm_base_null_pclose(char *port)
{
return;
}

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

@ -1,61 +0,0 @@
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* 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) 2012 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/mca/dpm/base/base.h"
int ompi_dpm_base_select(void)
{
int ret;
ompi_dpm_base_component_t *best_component = NULL;
ompi_dpm_base_module_t *best_module = NULL;
/*
* Select the best component
*/
if( OPAL_SUCCESS != (ret = mca_base_select("dpm", ompi_dpm_base_framework.framework_output,
&ompi_dpm_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component))) {
/* it is okay not to find any executable components */
if (OMPI_ERR_NOT_FOUND == ret) {
ret = OPAL_SUCCESS;
}
goto cleanup;
}
/* Save the winner */
ompi_dpm = *best_module;
ompi_dpm_base_selected_component = *best_component;
/* init the selected module */
if (NULL != ompi_dpm.init) {
ret = ompi_dpm.init();
}
cleanup:
return ret;
}

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

@ -1,7 +0,0 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: INTEL
status: maintenance

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

@ -1,233 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 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) 2013 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* Dynamic Process Management Interface
*
*/
#ifndef OMPI_MCA_DPM_H
#define OMPI_MCA_DPM_H
#include "ompi_config.h"
#include <time.h>
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include "ompi/mca/mca.h"
#include "opal/mca/base/base.h"
#include "ompi/info/info.h"
#include "ompi/communicator/communicator.h"
BEGIN_C_DECLS
/*
* Initialize a module
*/
typedef int (*ompi_dpm_base_module_init_fn_t)(void);
/*
* Connect/accept communications
*/
typedef int (*ompi_dpm_base_module_connect_accept_fn_t)(ompi_communicator_t *comm, int root,
const char *port, bool send_first,
ompi_communicator_t **newcomm);
/* define a callback function for use by non-blocking persistent connect/accept operations */
typedef void (*ompi_dpm_base_paccept_connect_callback_fn_t)(ompi_communicator_t *newcomm,
ompi_proc_t *remote_proc,
void *cbdata);
/*
* Create a persistent connection point for accepting non-blocking connection requests.
* The accept is persistent and will remain open until explicitly closed, or during
* dpm_framework_close. Any incoming connection request will be used to create a new
* communicator which will be returned via callback, along with the process name.
*
* In both cases, the callback function will return the new communicator plus the
* user's original cbdata.
*
* paccept requires a port (typically obtained by a prior call to MPI_Open_port).
* This must be published so it can be found by processes wanting to
* connect to this process, and is passed by those processes as the "port" argument for
* pconnect.
*
* Calls to pconnect are also non-blocking, with callback upon completion. Periodic
* attempts to complete the connection may be made at the discretion of the implementation.
* Failure to connect will be indicated by a callback returning a NULL communicator. Callers
* should use the cbdata to track the corresponding pconnect request. A timeout
* is provided to avoid hanging should the other process not have an active paccept
* on the specified port (e.g., the process may have closed it). A NULL value for
* the timeout argument indicates that the pconnect operation should not timeout,
* and will regularly retry the connection forever.
*
* Processes may create and publish as many ports, and call paccept as many times, as
* they like. When a process no longer wishes to accept connect requests, it can "close"
* a paccept request by passing in the port used when calling paccept. A call to "close"
* with a NULL argument will close *all* currently registered paccept channels.
*/
typedef int (*ompi_dpm_base_module_paccept_fn_t)(char *port,
ompi_dpm_base_paccept_connect_callback_fn_t cbfunc,
void *cbdata);
typedef int (*ompi_dpm_base_module_pconnect_fn_t)(char *port,
struct timeval *timeout,
ompi_dpm_base_paccept_connect_callback_fn_t cbfunc,
void *cbdata);
typedef void (*ompi_dpm_base_module_pclose_fn_t)(char *port);
/**
* Executes internally a disconnect on all dynamic communicators
* in case the user did not disconnect them.
*/
typedef int (*ompi_dpm_base_module_disconnect_fn_t)(ompi_communicator_t *comm);
/*
* Dynamically spawn processes
*/
typedef int (*ompi_dpm_base_module_spawn_fn_t)(int count, char const *array_of_commands[],
char **array_of_argv[],
const int array_of_maxprocs[],
const MPI_Info array_of_info[],
const char *port_name);
/*
* This routine checks, whether an application has been spawned
* by another MPI application, or has been independently started.
* If it has been spawned, it establishes the parent communicator.
* Since the routine has to communicate, it should be among the last
* steps in MPI_Init, to be sure that everything is already set up.
*/
typedef int (*ompi_dpm_base_module_dyn_init_fn_t)(void);
/*
* Interface for mpi_finalize to call to ensure dynamically spawned procs
* collectively finalize
*/
typedef int (*ompi_dpm_base_module_dyn_finalize_fn_t)(void);
/* this routine counts the number of different jobids of the processes
given in a certain communicator. If there is more than one jobid,
we mark the communicator as 'dynamic'. This is especially relevant
for the MPI_Comm_disconnect *and* for MPI_Finalize, where we have
to wait for all still connected processes.
*/
typedef void (*ompi_dpm_base_module_mark_dyncomm_fn_t)(ompi_communicator_t *comm);
/*
* Open a port to interface to a dynamically spawned job - if the
* specified tag is valid, then it will be used to form the port. Otherwise,
* a dynamically assigned tag that is unique to this request will be provided
*/
typedef int (*ompi_dpm_base_module_open_port_fn_t)(char *port_name, ompi_rml_tag_t tag);
/*
* Converts an opaque port string to a RML process nane and tag.
*/
typedef int (*ompi_dpm_base_module_parse_port_name_t)(const char *port_name,
char **hnp_uri, char **rml_uri,
ompi_rml_tag_t *tag);
/*
* Update the routed component to make sure that the RML can send messages to
* the remote port
*/
typedef int (*ompi_dpm_base_module_route_to_port_t)(char *rml_uri, ompi_process_name_t *rproc);
/*
* Close a port
*/
typedef int (*ompi_dpm_base_module_close_port_fn_t)(const char *port_name);
/*
* Finalize a module
*/
typedef int (*ompi_dpm_base_module_finalize_fn_t)(void);
/**
* Structure for DPM modules
*/
struct ompi_dpm_base_module_1_0_0_t {
/** Initialization Function */
ompi_dpm_base_module_init_fn_t init;
/* connect/accept */
ompi_dpm_base_module_connect_accept_fn_t connect_accept;
/* disconnect */
ompi_dpm_base_module_disconnect_fn_t disconnect;
/* spawn processes */
ompi_dpm_base_module_spawn_fn_t spawn;
/* dyn_init */
ompi_dpm_base_module_dyn_init_fn_t dyn_init;
/* dyn_finalize */
ompi_dpm_base_module_dyn_finalize_fn_t dyn_finalize;
/* mark dyncomm */
ompi_dpm_base_module_mark_dyncomm_fn_t mark_dyncomm;
/* open port */
ompi_dpm_base_module_open_port_fn_t open_port;
/* parse port string */
ompi_dpm_base_module_parse_port_name_t parse_port;
/* update route to a port */
ompi_dpm_base_module_route_to_port_t route_to_port;
/* close port */
ompi_dpm_base_module_close_port_fn_t close_port;
/* finalize */
ompi_dpm_base_module_finalize_fn_t finalize;
/* pconnect/accept */
ompi_dpm_base_module_pconnect_fn_t pconnect;
ompi_dpm_base_module_paccept_fn_t paccept;
ompi_dpm_base_module_pclose_fn_t pclose;
};
typedef struct ompi_dpm_base_module_1_0_0_t ompi_dpm_base_module_1_0_0_t;
typedef struct ompi_dpm_base_module_1_0_0_t ompi_dpm_base_module_t;
OMPI_DECLSPEC extern ompi_dpm_base_module_t ompi_dpm;
/**
* Structure for DPM components.
*/
struct ompi_dpm_base_component_2_0_0_t {
/** MCA base component */
mca_base_component_t base_version;
/** MCA base data */
mca_base_component_data_t base_data;
};
typedef struct ompi_dpm_base_component_2_0_0_t ompi_dpm_base_component_2_0_0_t;
typedef struct ompi_dpm_base_component_2_0_0_t ompi_dpm_base_component_t;
/**
* Macro for use in components that are of type DPM
*/
#define OMPI_DPM_BASE_VERSION_2_0_0 \
OMPI_MCA_BASE_VERSION_2_1_0("dpm", 2, 0, 0)
END_C_DECLS
#endif /* OMPI_MCA_DPM_H */

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

@ -1,43 +0,0 @@
#
# Copyright (c) 2004-2006 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2009 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
dist_ompidata_DATA = help-ompi-dpm-orte.txt
# 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_ompi_dpm_orte_DSO
component_noinst =
component_install = mca_dpm_orte.la
else
component_noinst = libmca_dpm_orte.la
component_install =
endif
local_sources = \
dpm_orte.c \
dpm_orte.h \
dpm_orte_component.c
mcacomponentdir = $(ompilibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_dpm_orte_la_SOURCES = $(local_sources)
mca_dpm_orte_la_LDFLAGS = -module -avoid-version $(dpm_orte_LDFLAGS)
noinst_LTLIBRARIES = $(component_noinst)
libmca_dpm_orte_la_SOURCES = $(local_sources)
libmca_dpm_orte_la_LIBADD = $(dpm_orte_LIBS)
libmca_dpm_orte_la_LDFLAGS = -module -avoid-version $(dpm_orte_LDFLAGS)

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

@ -1,25 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2011 Los Alamos National Security, LLC.
# All rights reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_dpm_orte_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_ompi_dpm_orte_CONFIG],[
AC_CONFIG_FILES([ompi/mca/dpm/orte/Makefile])
AC_ARG_WITH([orte],
AC_HELP_STRING([--with-orte],
[Use ORTE run-time environment (default: yes)]))
AS_IF([test "$with_orte" != "no"],
[$1],
[$2])
])

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

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

@ -1,36 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2006 The Trustees of the University of Tennessee.
* 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) 2007 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef OMPI_DPM_ORTE_H
#define OMPI_DPM_ORTE_H
#include "ompi_config.h"
#include "ompi/mca/dpm/dpm.h"
BEGIN_C_DECLS
/* access to module */
extern ompi_dpm_base_module_t ompi_dpm_orte_module;
OMPI_MODULE_DECLSPEC extern ompi_dpm_base_component_t mca_dpm_orte_component;
END_C_DECLS
#endif /* OMPI_DPM_ORTE_H */

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

@ -1,67 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 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-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/constants.h"
#include "dpm_orte.h"
static int dpm_orte_component_open(void);
static int dpm_orte_component_close(void);
static int dpm_orte_component_query(mca_base_module_t **module, int *priority);
ompi_dpm_base_component_t mca_dpm_orte_component = {
/* First, the mca_base_component_t struct containing meta
information about the component itself */
.base_version = {
OMPI_DPM_BASE_VERSION_2_0_0,
.mca_component_name = "orte",
MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
OMPI_RELEASE_VERSION),
.mca_open_component = dpm_orte_component_open,
.mca_close_component = dpm_orte_component_close,
.mca_query_component = dpm_orte_component_query,
},
.base_data = {
/* This component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
};
int dpm_orte_component_open(void)
{
return OMPI_SUCCESS;
}
int dpm_orte_component_close(void)
{
return OMPI_SUCCESS;
}
static int dpm_orte_component_query(mca_base_module_t **module, int *priority)
{
*priority = 50;
*module = (mca_base_module_t *) &ompi_dpm_orte_module;
return OMPI_SUCCESS;
}

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

@ -1,43 +0,0 @@
# -*- text -*-
#
# 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) 2007 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This is the US/English general help file for Open MPI.
#
[dpm-orte:no-server]
Process rank %ld attempted to %s a global ompi_server that
could not be contacted. This is typically caused by either not
specifying the contact info for the server, or by the server not
currently executing. If you did specify the contact info for a
server, please check to see that the server is running and start
it again (or have your sys admin start it) if it isn't.
[dpm-orte:unknown-order]
Process rank %ld attempted to lookup a value but provided an
unrecognized order parameter. Order parameters are used to tell Open
MPI if it should first look for the requested value locally (i.e., from
the current job) or from a global ompi_server. Accepted order
parameters are "local" and "global", respectively.
[dpm-orte:too-many-orders]
Process rank %ld attempted to lookup a value but provided too many
order parameters (%ld found). Order parameters are used to tell
Open MPI if it should first look for the requested value locally
(i.e., from the current job) or from a global ompi_server. Accepted
order parameters are "local" and "global", respectively, and each can
only be specified once.

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

@ -1,7 +0,0 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: INTEL
status: maintenance

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

@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (C) 2001-2011 Mellanox Technologies Ltd. ALL RIGHTS RESERVED.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
@ -177,7 +177,7 @@ static int ompi_mtl_mxm_send_ep_address(void *address, size_t address_len)
/* Send address length */
sprintf(modex_name, "%s-len", modex_component_name);
OPAL_MODEX_SEND_STRING(rc, PMIX_SYNC_REQD, PMIX_GLOBAL,
OPAL_MODEX_SEND_STRING(rc, OPAL_PMIX_GLOBAL,
modex_name, &address_len, sizeof(address_len));
if (OMPI_SUCCESS != rc) {
MXM_ERROR("failed to send address length");
@ -192,7 +192,7 @@ static int ompi_mtl_mxm_send_ep_address(void *address, size_t address_len)
while (modex_buf_size) {
sprintf(modex_name, "%s-%d", modex_component_name, modex_name_id);
modex_cur_size = (modex_buf_size < modex_max_size) ? modex_buf_size : modex_max_size;
OPAL_MODEX_SEND_STRING(rc, PMIX_SYNC_REQD, PMIX_GLOBAL,
OPAL_MODEX_SEND_STRING(rc, OPAL_PMIX_GLOBAL,
modex_name, modex_buf_ptr, modex_cur_size);
if (OMPI_SUCCESS != rc) {
MXM_ERROR("Open MPI couldn't distribute EP connection details");
@ -232,7 +232,7 @@ static int ompi_mtl_mxm_recv_ep_address(ompi_proc_t *source_proc, void **address
/* Receive address length */
sprintf(modex_name, "%s-len", modex_component_name);
OPAL_MODEX_RECV_STRING(rc, modex_name, &source_proc->super,
OPAL_MODEX_RECV_STRING(rc, modex_name, &source_proc->super.proc_name,
(char**)&address_len_buf_ptr,
&modex_cur_size);
if (OMPI_SUCCESS != rc) {
@ -253,7 +253,7 @@ static int ompi_mtl_mxm_recv_ep_address(ompi_proc_t *source_proc, void **address
modex_buf_size = 0;
while (modex_buf_size < *address_len_p) {
sprintf(modex_name, "%s-%d", modex_component_name, modex_name_id);
OPAL_MODEX_RECV_STRING(rc, modex_name, &source_proc->super,
OPAL_MODEX_RECV_STRING(rc, modex_name, &source_proc->super.proc_name,
(char**)&modex_buf_ptr,
&modex_cur_size);
if (OMPI_SUCCESS != rc) {

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

@ -21,14 +21,14 @@
#if (OPAL_MAJOR_VERSION >= 2)
#include "opal/mca/pmix/pmix.h"
#include "opal/mca/pmix/pmix_types.h"
#define OFI_COMPAT_MODEX_RECV(ret, mtl_version, proc, ep_name, size) \
OPAL_MODEX_RECV((ret), (mtl_version), &(proc)->super, (ep_name), (size));
OPAL_MODEX_RECV((ret), (mtl_version), &(proc)->super.proc_name, (ep_name), (size));
#define OFI_COMPAT_MODEX_SEND(ret, mtl_version, ep_name, namelen) \
OPAL_MODEX_SEND((ret), \
PMIX_SYNC_REQD, \
PMIX_GLOBAL, \
OPAL_PMIX_GLOBAL, \
(mtl_version), \
(ep_name)[0], \
(namelen));

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

@ -281,7 +281,7 @@ ompi_mtl_portals4_add_procs(struct mca_mtl_base_module_t *mtl,
}
OPAL_MODEX_RECV(ret, &mca_mtl_portals4_component.mtl_version,
&procs[i]->super, (uint8_t**)&modex_id, &size);
&procs[i]->super.proc_name, (uint8_t**)&modex_id, &size);
if (OMPI_SUCCESS != ret) {
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
"%s:%d: ompi_modex_recv failed: %d\n",

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

@ -313,7 +313,7 @@ ompi_mtl_portals4_component_init(bool enable_progress_threads,
goto error;
}
OPAL_MODEX_SEND(ret, PMIX_SYNC_REQD, PMIX_GLOBAL,
OPAL_MODEX_SEND(ret, OPAL_PMIX_GLOBAL,
&mca_mtl_portals4_component.mtl_version,
&id, sizeof(id));
if (OMPI_SUCCESS != ret) {

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

@ -174,7 +174,7 @@ int ompi_mtl_psm_module_init(int local_rank, int num_local_procs) {
ompi_mtl_psm.epid = epid;
ompi_mtl_psm.mq = mq;
OPAL_MODEX_SEND(rc, PMIX_SYNC_REQD, PMIX_GLOBAL,
OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL,
&mca_mtl_psm_component.super.mtl_version,
&ompi_mtl_psm.epid,
sizeof(psm_epid_t));
@ -296,7 +296,7 @@ ompi_mtl_psm_add_procs(struct mca_mtl_base_module_t *mtl,
}
OPAL_MODEX_RECV(rc, &mca_mtl_psm_component.super.mtl_version,
&procs[i]->super, (void**)&epid, &size);
&procs[i]->super.proc_name, (void**)&epid, &size);
if (rc != OMPI_SUCCESS || size != sizeof(psm_epid_t)) {
rc = OMPI_ERROR;
goto bail;

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

@ -157,7 +157,7 @@ int ompi_mtl_psm2_module_init(int local_rank, int num_local_procs) {
ompi_mtl_psm2.epid = epid;
ompi_mtl_psm2.mq = mq;
OPAL_MODEX_SEND(rc, PMIX_SYNC_REQD, PMIX_GLOBAL,
OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL,
&mca_mtl_psm2_component.super.mtl_version,
&ompi_mtl_psm2.epid,
sizeof(psm_epid_t));
@ -280,7 +280,7 @@ ompi_mtl_psm2_add_procs(struct mca_mtl_base_module_t *mtl,
}
OPAL_MODEX_RECV(rc, &mca_mtl_psm2_component.super.mtl_version,
&procs[i]->super, (void**)&epid, &size);
&procs[i]->super.proc_name, (void**)&epid, &size);
if (rc != OMPI_SUCCESS || size != sizeof(psm_epid_t)) {
return OMPI_ERROR;
}

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

@ -312,7 +312,7 @@ mca_pml_base_pml_selected(const char *name)
{
int rc;
OPAL_MODEX_SEND(rc, PMIX_SYNC_REQD, PMIX_GLOBAL, &pml_base_component, name, strlen(name) + 1);
OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL, &pml_base_component, name, strlen(name) + 1);
return rc;
}
@ -343,7 +343,7 @@ mca_pml_base_pml_check_selected(const char *my_pml,
/* get the name of the PML module selected by rank=0 */
OPAL_MODEX_RECV(ret, &pml_base_component,
&procs[0]->super, (void**) &remote_pml, &size);
&procs[0]->super.proc_name, (void**) &remote_pml, &size);
/* if this key wasn't found, then just assume all is well... */
if (OMPI_SUCCESS != ret) {

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

@ -68,7 +68,7 @@ static int send_ep_address(void)
return OMPI_ERROR;
}
OPAL_MODEX_SEND(rc, PMIX_SYNC_REQD, PMIX_GLOBAL,
OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL,
&mca_pml_yalla_component.pmlm_version, address, addrlen);
if (OMPI_SUCCESS != rc) {
PML_YALLA_ERROR("Open MPI couldn't distribute EP connection details");
@ -82,7 +82,7 @@ static int recv_ep_address(ompi_proc_t *proc, void **address_p, size_t *addrlen_
{
int rc;
OPAL_MODEX_RECV(rc, &mca_pml_yalla_component.pmlm_version, &proc->super,
OPAL_MODEX_RECV(rc, &mca_pml_yalla_component.pmlm_version, &proc->super.proc_name,
address_p, addrlen_p);
if (rc < 0) {
PML_YALLA_ERROR("Failed to receive EP address");

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

@ -1,37 +0,0 @@
#
# Copyright (c) 2004-2007 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) 2010 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# main library setup
noinst_LTLIBRARIES = libmca_pubsub.la
libmca_pubsub_la_SOURCES =
# local files
headers = pubsub.h
libmca_pubsub_la_SOURCES += $(headers)
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompidir = $(ompiincludedir)/$(subdir)
nobase_ompi_HEADERS = $(headers)
endif
include base/Makefile.am
distclean-local:
rm -f base/static-components.h

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

@ -1,54 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2007 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) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef OMPI_MCA_PUBSUB_BASE_H
#define OMPI_MCA_PUBSUB_BASE_H
#include "ompi_config.h"
#include "ompi/constants.h"
#include "ompi/mca/pubsub/pubsub.h"
/*
* Global functions for MCA overall PUBSUB
*/
BEGIN_C_DECLS
/*
* MCA framework
*/
OMPI_DECLSPEC extern mca_base_framework_t ompi_pubsub_base_framework;
/*
* Select an available component.
*/
OMPI_DECLSPEC int ompi_pubsub_base_select(void);
/* NULL functions */
OMPI_DECLSPEC int ompi_pubsub_base_null_publish(const char *service, ompi_info_t *info, const char *port);
OMPI_DECLSPEC int ompi_pubsub_base_null_unpublish(const char *service, ompi_info_t *info);
OMPI_DECLSPEC char* ompi_pubsub_base_null_lookup(const char *service, ompi_info_t *info);
/* useful globals */
OMPI_DECLSPEC extern ompi_pubsub_base_module_t ompi_pubsub;
END_C_DECLS
#endif /* OMPI_MCA_PUBSUB_BASE_H */

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

@ -1,7 +0,0 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: INTEL
status: maintenance

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

@ -1,64 +0,0 @@
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* 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) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/mca/mca.h"
#include "opal/util/output.h"
#include "opal/mca/base/base.h"
#include "ompi/mca/pubsub/pubsub.h"
#include "ompi/mca/pubsub/base/base.h"
#include "ompi/mca/pubsub/base/static-components.h"
/*
* Globals
*/
OMPI_DECLSPEC ompi_pubsub_base_module_t ompi_pubsub={
NULL,
ompi_pubsub_base_null_publish,
ompi_pubsub_base_null_unpublish,
ompi_pubsub_base_null_lookup,
NULL
};
static int ompi_pubsub_base_close(void)
{
/* Close the selected component */
if( NULL != ompi_pubsub.finalize ) {
ompi_pubsub.finalize();
}
return mca_base_framework_components_close(&ompi_pubsub_base_framework, NULL);
}
/**
* Function for finding and opening either all MCA components,
* or the one that was specifically requested via a MCA parameter.
*/
static int ompi_pubsub_base_open(mca_base_open_flag_t flags)
{
/* Open up all available components */
return mca_base_framework_components_open(&ompi_pubsub_base_framework, flags);
}
MCA_BASE_FRAMEWORK_DECLARE(ompi, pubsub, "OMPI Publish-Subscribe Subsystem", NULL,
ompi_pubsub_base_open, ompi_pubsub_base_close,
mca_pubsub_base_static_components, 0);

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

@ -1,38 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* 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) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/mca/pubsub/pubsub.h"
#include "ompi/mca/pubsub/base/base.h"
int ompi_pubsub_base_null_publish(const char *service, ompi_info_t *info, const char *port)
{
return OMPI_ERR_NOT_SUPPORTED;
}
int ompi_pubsub_base_null_unpublish(const char *service, ompi_info_t *info)
{
return OMPI_ERR_NOT_SUPPORTED;
}
char* ompi_pubsub_base_null_lookup(const char *service, ompi_info_t *info)
{
return NULL;
}

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

@ -1,60 +0,0 @@
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* 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) 2012-2013 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h"
#include "ompi/mca/pubsub/pubsub.h"
#include "ompi/mca/pubsub/base/base.h"
int ompi_pubsub_base_select(void)
{
int ret;
ompi_pubsub_base_component_t *best_component = NULL;
ompi_pubsub_base_module_t *best_module = NULL;
/*
* Select the best component
*/
if( OPAL_SUCCESS != (ret = mca_base_select("pubsub", ompi_pubsub_base_framework.framework_output,
&ompi_pubsub_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component))) {
/* it is okay not to find any executable components */
if (OMPI_ERR_NOT_FOUND == ret) {
ret = OPAL_SUCCESS;
}
goto cleanup;
}
/* Save the winner */
ompi_pubsub = *best_module;
/* init the selected module */
if (NULL != ompi_pubsub.init) {
ret = ompi_pubsub.init();
}
cleanup:
return ret;
}

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

@ -1,42 +0,0 @@
#
# Copyright (c) 2004-2006 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2009 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
dist_ompidata_DATA = help-ompi-pubsub-orte.txt
# 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_ompi_pubsub_orte_DSO
component_noinst =
component_install = mca_pubsub_orte.la
else
component_noinst = libmca_pubsub_orte.la
component_install =
endif
local_sources = \
pubsub_orte.c \
pubsub_orte.h \
pubsub_orte_component.c
mcacomponentdir = $(ompilibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_pubsub_orte_la_SOURCES = $(local_sources)
mca_pubsub_orte_la_LDFLAGS = -module -avoid-version $(pubsub_orte_LDFLAGS)
noinst_LTLIBRARIES = $(component_noinst)
libmca_pubsub_orte_la_SOURCES = $(local_sources)
libmca_pubsub_orte_la_LIBADD = $(pubsub_orte_LIBS)
libmca_pubsub_orte_la_LDFLAGS = -module -avoid-version $(pubsub_orte_LDFLAGS)

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

@ -1,24 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2011 Los Alamos National Security, LLC.
# All rights reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_pubsub_orte_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_ompi_pubsub_orte_CONFIG],[
AC_CONFIG_FILES([ompi/mca/pubsub/orte/Makefile])
AC_ARG_WITH([orte],
AC_HELP_STRING([--with-orte],
[Use ORTE run-time environment (default: yes)]))
AS_IF([test "$with_orte" != "no"],
[$1],
[$2])
])

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

@ -1,43 +0,0 @@
# -*- text -*-
#
# 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) 2007 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This is the US/English general help file for Open MPI.
#
[pubsub-orte:no-server]
Process rank %ld attempted to %s a global ompi_server that
could not be contacted. This is typically caused by either not
specifying the contact info for the server, or by the server not
currently executing. If you did specify the contact info for a
server, please check to see that the server is running and start
it again (or have your sys admin start it) if it isn't.
[pubsub-orte:unknown-order]
Process rank %ld attempted to lookup a value but provided an
unrecognized order parameter. Order parameters are used to tell Open
MPI if it should first look for the requested value locally (i.e., from
the current job) or from a global ompi_server. Accepted order
parameters are "local" and "global", respectively.
[pubsub-orte:too-many-orders]
Process rank %ld attempted to lookup a value but provided too many
order parameters (%ld found). Order parameters are used to tell
Open MPI if it should first look for the requested value locally
(i.e., from the current job) or from a global ompi_server. Accepted
order parameters are "local" and "global", respectively, and each can
only be specified once.

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

@ -1,7 +0,0 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: INTEL
status: maintenance

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

@ -1,582 +0,0 @@
/*
* 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) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/constants.h"
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "opal/util/show_help.h"
#include "opal/util/argv.h"
#include "opal/dss/dss.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/rml/rml.h"
#include "orte/mca/rml/rml_types.h"
#include "orte/mca/rml/base/rml_contact.h"
#include "orte/mca/routed/routed.h"
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_globals.h"
#include "orte/runtime/orte_data_server.h"
#include "ompi/info/info.h"
#include "ompi/mca/rte/rte.h"
#include "ompi/mca/pubsub/base/base.h"
#include "pubsub_orte.h"
/* Establish contact with the server
*
* NOTE: we do not do this automatically during init to avoid
* forcing every process to pay the time penalty during MPI_Init
* when only a few, if any, will ever call pub/lookup/unpub. In
* addition, those that -do- call these functions may well only
* use local (as opposed to global) storage, and hence will have
* no need to talk to the server, even though a sys admin may
* have set one up. So we do a lazy setup of the server contact
* info - it only gets setup the first time we call a function
* that wants to talk to the global server
*/
static bool server_setup=false;
static void setup_server(void)
{
opal_buffer_t buf;
int rc;
OPAL_OUTPUT_VERBOSE((1, ompi_pubsub_base_framework.framework_output,
"%s pubsub:orte: setting up server at URI %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
(NULL == mca_pubsub_orte_component.server_uri) ? "NULL" : mca_pubsub_orte_component.server_uri));
/* flag setup as completed so we only pass through here once */
server_setup = true;
if (NULL == mca_pubsub_orte_component.server_uri) {
/* if the contact info for the server is NULL, then there
* is nothing we can do - there is no path to the server
*/
mca_pubsub_orte_component.server_found = false;
return;
}
/* init the route to the server - init_routes wants a buffer
* passed to it, so we have to package the server's contact
* info into a buffer
*/
OBJ_CONSTRUCT(&buf, opal_buffer_t);
opal_dss.pack(&buf, &mca_pubsub_orte_component.server_uri, 1, OPAL_STRING);
/* extract the server's name so we have its jobid */
if (ORTE_SUCCESS != (rc = orte_rml_base_parse_uris(mca_pubsub_orte_component.server_uri,
&mca_pubsub_orte_component.server, NULL))) {
ORTE_ERROR_LOG(rc);
OBJ_DESTRUCT(&buf);
mca_pubsub_orte_component.server_found = false;
return;
}
/* init routes to the server's job */
if (ORTE_SUCCESS != (rc = orte_routed.init_routes(mca_pubsub_orte_component.server.jobid, &buf))) {
ORTE_ERROR_LOG(rc);
mca_pubsub_orte_component.server_found = false;
OBJ_DESTRUCT(&buf);
return;
}
OBJ_DESTRUCT(&buf);
/* flag the server as found */
mca_pubsub_orte_component.server_found = true;
OPAL_OUTPUT_VERBOSE((1, ompi_pubsub_base_framework.framework_output,
"%s pubsub:orte: server %s setup",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(&mca_pubsub_orte_component.server)));
}
/*
* Init the module
*/
static int init(void)
{
return OMPI_SUCCESS;
}
/*
* publish the port_name for the specified service_name. This will
* be published under our process name, so only we will be allowed
* to remove it later.
*/
static int publish ( const char *service_name, ompi_info_t *info, const char *port_name )
{
int rc, ret, flag;
bool global_scope = false;
orte_process_name_t *info_host;
opal_buffer_t *buf;
orte_data_server_cmd_t cmd=ORTE_DATA_SERVER_PUBLISH;
orte_std_cntr_t cnt;
orte_rml_recv_cb_t xfer;
bool unique=false;
ompi_info_get_bool(info, "ompi_global_scope", &global_scope, &flag);
if (0 == flag) {
/* scope was not defined - see if server exists */
if (!server_setup) {
setup_server();
}
if (mca_pubsub_orte_component.server_found) {
/* server was found - use it as our default store */
info_host = &mca_pubsub_orte_component.server;
global_scope = true;
} else {
/* server was not found - use our HNP as default store */
info_host = ORTE_PROC_MY_HNP;
}
} else if (!global_scope) {
/* if the scope is not global, then store the value on the HNP */
info_host = ORTE_PROC_MY_HNP;
} else {
/* has the server been setup yet? */
if (!server_setup) {
setup_server();
}
/* store the value on the global ompi_server, but error
* if that server wasn't contacted
*/
if (!mca_pubsub_orte_component.server_found) {
opal_show_help("help-ompi-pubsub-orte.txt", "pubsub-orte:no-server",
true, (long)ORTE_PROC_MY_NAME->vpid, "publish to");
return OMPI_ERR_NOT_FOUND;
}
info_host = &mca_pubsub_orte_component.server;
}
OPAL_OUTPUT_VERBOSE((1, ompi_pubsub_base_framework.framework_output,
"%s pubsub:orte: publishing service %s scope %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
service_name, global_scope ? "Global" : "Local"));
ompi_info_get_bool(info, "ompi_unique", &unique, &flag);
if (0 == flag) {
/* uniqueness not specified - overwrite by default */
unique = false;
}
/* construct the buffer */
buf = OBJ_NEW(opal_buffer_t);
/* pack the publish command */
if (OPAL_SUCCESS != (rc = opal_dss.pack(buf, &cmd, 1, ORTE_DATA_SERVER_CMD))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(buf);
goto CLEANUP;
}
/* pack the service name */
if (OPAL_SUCCESS != (rc = opal_dss.pack(buf, &service_name, 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(buf);
goto CLEANUP;
}
/* pack the port name */
if (OPAL_SUCCESS != (rc = opal_dss.pack(buf, &port_name, 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(buf);
goto CLEANUP;
}
/* pack the uniqueness flag */
if (OPAL_SUCCESS != (rc = opal_dss.pack(buf, &unique, 1, OPAL_BOOL))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(buf);
goto CLEANUP;
}
/* send the data */
if (0 > (rc = orte_rml.send_buffer_nb(info_host, buf,
ORTE_RML_TAG_DATA_SERVER,
orte_rml_send_callback, NULL))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(buf);
goto CLEANUP;
}
/* get the answer */
OBJ_CONSTRUCT(&xfer, orte_rml_recv_cb_t);
xfer.active = true;
orte_rml.recv_buffer_nb(ORTE_NAME_WILDCARD,
ORTE_RML_TAG_DATA_CLIENT,
ORTE_RML_NON_PERSISTENT,
orte_rml_recv_callback, &xfer);
OMPI_WAIT_FOR_COMPLETION(xfer.active);
/* unpack the result */
cnt = 1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(&xfer.data, &ret, &cnt, OPAL_INT))) {
ORTE_ERROR_LOG(rc);
}
rc = ret;
OBJ_DESTRUCT(&xfer);
CLEANUP:
return rc;
}
enum { NONE, LOCAL, GLOBAL };
static char* lookup ( const char *service_name, ompi_info_t *info )
{
orte_process_name_t *info_host;
opal_buffer_t *buf;
orte_data_server_cmd_t cmd=ORTE_DATA_SERVER_LOOKUP;
orte_std_cntr_t cnt=0;
char *port_name=NULL;
int ret, rc, flag, i;
char value[256], **tokens, *ptr;
int lookup[2] = { GLOBAL, LOCAL };
size_t num_tokens;
orte_rml_recv_cb_t xfer;
/* Look in the MPI_Info (ompi_info_t*) for the key
* "ompi_lookup_order". Acceptable values are:
*
* - "local" -- only check the local scope
* - "global" -- only check the global scope
* - "local,global" -- check the local scope first, then check the
* global scope
* - "global,local" -- check the global scope first, then check the
* local scope
*
* Give a little leeway in terms of whitespace in the value.
*
* The lookup[2] array will contain the results: lookup[0] is the
* first scope to check, lookup[1] is the 2nd. Either value may
* be NONE, LOCAL, or GLOBAL. If both are NONE, clearly that's an
* error. :-)
*/
ompi_info_get(info, "ompi_lookup_order", sizeof(value) - 1, value, &flag);
if (flag) {
ptr = &value[0];
while (isspace(*ptr) && (ptr - value) < (int)sizeof(value)) {
++ptr;
}
if (ptr - value < (int)sizeof(value)) {
tokens = opal_argv_split(ptr, ',');
if (NULL != tokens) {
if ((num_tokens = opal_argv_count(tokens)) > 2) {
/* too many values in the comma-delimited list */
opal_show_help("help-ompi-pubsub-orte.txt",
"pubsub-orte:too-many-orders",
true, (long)ORTE_PROC_MY_NAME->vpid,
(long)num_tokens);
opal_argv_free(tokens);
return NULL;
}
for (i = 0; i < 2; ++i) {
if (NULL != tokens[i]) {
if (0 == strcasecmp(tokens[i], "local")) {
lookup[i] = LOCAL;
} else if (0 == strcasecmp(tokens[i], "global")) {
lookup[i] = GLOBAL;
} else {
/* unrecognized value -- that's an error */
opal_show_help("help-ompi-pubsub-orte.txt",
"pubsub-orte:unknown-order",
true, (long)ORTE_PROC_MY_NAME->vpid);
opal_argv_free(tokens);
return NULL;
}
} else {
lookup[i] = NONE;
}
}
opal_argv_free(tokens);
}
}
if (NONE == lookup[0]) {
/* if the user provided an info key, then we at least must
* be given one place to look
*/
opal_show_help("help-ompi-pubsub-orte.txt",
"pubsub-orte:unknown-order",
true, (long)ORTE_PROC_MY_NAME->vpid);
return NULL;
}
} else {
/* if no info key was provided, then we default to the global
* server IF it is active
*/
if (!server_setup) {
setup_server();
}
lookup[1] = NONE;
if (mca_pubsub_orte_component.server_found) {
lookup[0] = GLOBAL;
} else {
/* global server was not found - just look local */
lookup[0] = LOCAL;
}
}
OPAL_OUTPUT_VERBOSE((1, ompi_pubsub_base_framework.framework_output,
"%s pubsub:orte: lookup service %s scope %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
service_name, lookup[0]));
/* go find the value */
for (i=0; i < 2; i++) {
if (LOCAL == lookup[i]) {
/* if the scope is local, then lookup the value on the HNP */
info_host = ORTE_PROC_MY_HNP;
} else if (GLOBAL == lookup[i]) {
/* has the server been setup yet? */
if (!server_setup) {
setup_server();
}
/* lookup the value on the global ompi_server, but error
* if that server wasn't contacted
*/
if (!mca_pubsub_orte_component.server_found) {
opal_show_help("help-ompi-pubsub-orte.txt",
"pubsub-orte:no-server",
true, (long)ORTE_PROC_MY_NAME->vpid,
"lookup from");
return NULL;
}
info_host = &mca_pubsub_orte_component.server;
} else if (NONE == lookup[i]) {
continue;
} else {
/* unknown host! */
opal_show_help("help-ompi-pubsub-orte.txt",
"pubsub-orte:unknown-order",
true, (long)ORTE_PROC_MY_NAME->vpid);
return NULL;
}
/* go look it up */
/* construct the buffer */
buf = OBJ_NEW(opal_buffer_t);
/* pack the lookup command */
if (OPAL_SUCCESS != (ret = opal_dss.pack(buf, &cmd, 1, ORTE_DATA_SERVER_CMD))) {
ORTE_ERROR_LOG(ret);
OBJ_RELEASE(buf);
goto CLEANUP;
}
/* pack the service name */
if (OPAL_SUCCESS != (ret = opal_dss.pack(buf, &service_name, 1, OPAL_STRING))) {
ORTE_ERROR_LOG(ret);
OBJ_RELEASE(buf);
goto CLEANUP;
}
/* send the cmd */
if (0 > (ret = orte_rml.send_buffer_nb(info_host, buf,
ORTE_RML_TAG_DATA_SERVER,
orte_rml_send_callback, NULL))) {
ORTE_ERROR_LOG(ret);
OBJ_RELEASE(buf);
goto CLEANUP;
}
/* get the answer */
OBJ_CONSTRUCT(&xfer, orte_rml_recv_cb_t);
xfer.active = true;
orte_rml.recv_buffer_nb(ORTE_NAME_WILDCARD,
ORTE_RML_TAG_DATA_CLIENT,
ORTE_RML_NON_PERSISTENT,
orte_rml_recv_callback, &xfer);
OMPI_WAIT_FOR_COMPLETION(xfer.active);
/* unpack the return code */
cnt = 1;
if (OPAL_SUCCESS != (ret = opal_dss.unpack(&xfer.data, &rc, &cnt, OPAL_INT))) {
ORTE_ERROR_LOG(ret);
goto CLEANUP;
}
OPAL_OUTPUT_VERBOSE((1, ompi_pubsub_base_framework.framework_output,
"%s pubsub:orte: lookup returned status %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), rc));
if (ORTE_SUCCESS == rc) {
/* the server was able to lookup the port - unpack the port name */
cnt=1;
if (OPAL_SUCCESS != (ret = opal_dss.unpack(&xfer.data, &port_name, &cnt, OPAL_STRING))) {
ORTE_ERROR_LOG(ret);
OBJ_DESTRUCT(&xfer);
goto CLEANUP;
}
OPAL_OUTPUT_VERBOSE((1, ompi_pubsub_base_framework.framework_output,
"%s pubsub:orte: lookup returned port %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
(NULL == port_name) ? "NULL" : port_name));
if (NULL != port_name) {
/* got an answer - return it */
OBJ_DESTRUCT(&xfer);
return port_name;
}
}
/* if we didn't get a port_name, then continue */
OBJ_DESTRUCT(&xfer);
}
/* only get here if we tried both options and failed - since the
* buffer will already have been cleaned up, just return
*/
CLEANUP:
return NULL;
}
/*
* delete the entry. Only the process who has published
* the service_name has the right to remove this
* service - the server will verify and report the result
*/
static int unpublish ( const char *service_name, ompi_info_t *info )
{
int rc, ret, flag;
bool global_scope;
orte_process_name_t *info_host;
opal_buffer_t *buf;
orte_data_server_cmd_t cmd=ORTE_DATA_SERVER_UNPUBLISH;
orte_std_cntr_t cnt;
orte_rml_recv_cb_t xfer;
ompi_info_get_bool(info, "ompi_global_scope", &global_scope, &flag);
if (0 == flag) {
/* scope was not defined - see if server exists */
if (!server_setup) {
setup_server();
}
if (mca_pubsub_orte_component.server_found) {
/* server was found - use it as our default store */
info_host = &mca_pubsub_orte_component.server;
global_scope = true;
} else {
/* server was not found - use our HNP as default store */
info_host = ORTE_PROC_MY_HNP;
}
} else if (!global_scope) {
/* if the scope is not global, then unpublish the value from the HNP */
info_host = ORTE_PROC_MY_HNP;
} else {
/* has the server been setup yet? */
if (!server_setup) {
setup_server();
}
/* unpublish the value from the global ompi_server, but error
* if that server wasn't contacted
*/
if (!mca_pubsub_orte_component.server_found) {
opal_show_help("help-ompi-pubsub-orte.txt", "pubsub-orte:no-server",
true, (long)ORTE_PROC_MY_NAME->vpid, "unpublish from");
return OMPI_ERR_NOT_FOUND;
}
info_host = &mca_pubsub_orte_component.server;
}
OPAL_OUTPUT_VERBOSE((1, ompi_pubsub_base_framework.framework_output,
"%s pubsub:orte: unpublish service %s scope %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
service_name, global_scope ? "Global" : "Local"));
/* construct the buffer */
buf = OBJ_NEW(opal_buffer_t);
/* pack the unpublish command */
if (OPAL_SUCCESS != (rc = opal_dss.pack(buf, &cmd, 1, ORTE_DATA_SERVER_CMD))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(buf);
goto CLEANUP;
}
/* pack the service name */
if (OPAL_SUCCESS != (rc = opal_dss.pack(buf, &service_name, 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(buf);
goto CLEANUP;
}
/* send the command */
if (0 > (rc = orte_rml.send_buffer_nb(info_host, buf, ORTE_RML_TAG_DATA_SERVER,
orte_rml_send_callback, NULL))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(buf);
goto CLEANUP;
}
/* get the answer */
OBJ_CONSTRUCT(&xfer, orte_rml_recv_cb_t);
xfer.active = true;
orte_rml.recv_buffer_nb(ORTE_NAME_WILDCARD, ORTE_RML_TAG_DATA_CLIENT,
ORTE_RML_NON_PERSISTENT,
orte_rml_recv_callback, &xfer);
OMPI_WAIT_FOR_COMPLETION(xfer.active);
/* unpack the result */
cnt = 1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(&xfer.data, &ret, &cnt, OPAL_INT))) {
ORTE_ERROR_LOG(rc);
OBJ_DESTRUCT(&xfer);
goto CLEANUP;
}
OBJ_DESTRUCT(&xfer);
rc = ret;
CLEANUP:
return rc;
}
/*
* finalize the module
*/
static int finalize(void)
{
return OMPI_SUCCESS;
}
/*
* instantiate the module
*/
ompi_pubsub_base_module_t ompi_pubsub_orte_module = {
init,
publish,
unpublish,
lookup,
finalize
};

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

@ -1,51 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2006 The Trustees of the University of Tennessee.
* 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) 2007 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef OMPI_PUBSUB_ORTE_H
#define OMPI_PUBSUB_ORTE_H
#include "ompi_config.h"
#include "orte/types.h"
#include "ompi/mca/pubsub/pubsub.h"
BEGIN_C_DECLS
/*
* Extend the pubsub component to hold some useful
* values for this component
*/
typedef struct {
ompi_pubsub_base_component_t super;
orte_process_name_t server;
char *server_uri;
bool server_found;
} ompi_pubsub_orte_component_t;
/* access to module */
extern ompi_pubsub_base_module_t ompi_pubsub_orte_module;
/* access to component so we can get to the locally
* global values
*/
OMPI_MODULE_DECLSPEC extern ompi_pubsub_orte_component_t mca_pubsub_orte_component;
END_C_DECLS
#endif /* OMPI_PUBSUB_ORTE_H */

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

@ -1,95 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 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-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/constants.h"
#include "pubsub_orte.h"
static int pubsub_orte_component_register(void);
static int pubsub_orte_component_open(void);
static int pubsub_orte_component_close(void);
static int pubsub_orte_component_query(mca_base_module_t **module, int *priority);
static int my_priority = 50;
ompi_pubsub_orte_component_t mca_pubsub_orte_component = {
{
/* First, the mca_base_component_t struct containing meta
information about the component itself */
.base_version = {
OMPI_PUBSUB_BASE_VERSION_2_0_0,
.mca_component_name = "orte",
MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
OMPI_RELEASE_VERSION),
.mca_open_component = pubsub_orte_component_open,
.mca_close_component = pubsub_orte_component_close,
.mca_query_component = pubsub_orte_component_query,
.mca_register_component_params = pubsub_orte_component_register,
},
.base_data = {
/* This component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
}
};
static int pubsub_orte_component_register(void)
{
my_priority = 50;
(void) mca_base_component_var_register(&mca_pubsub_orte_component.super.base_version,
"priority", "Priority of the pubsub pmi component",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&my_priority);
mca_pubsub_orte_component.server_uri = NULL;
(void) mca_base_component_var_register(&mca_pubsub_orte_component.super.base_version,
"server", "Contact info for ompi_server for publish/subscribe operations",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_pubsub_orte_component.server_uri);
return OMPI_SUCCESS;
}
static int pubsub_orte_component_open(void)
{
return OMPI_SUCCESS;
}
static int pubsub_orte_component_close(void)
{
return OMPI_SUCCESS;
}
static int pubsub_orte_component_query(mca_base_module_t **module, int *priority)
{
mca_pubsub_orte_component.server_found = false;
*priority = my_priority;
*module = (mca_base_module_t *) &ompi_pubsub_orte_module;
return OMPI_SUCCESS;
}

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

@ -1,40 +0,0 @@
#
# Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
AM_CPPFLAGS = $(pubsub_pmi_CPPFLAGS)
# 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_ompi_pubsub_pmi_DSO
component_noinst =
component_install = mca_pubsub_pmi.la
else
component_noinst = libmca_pubsub_pmi.la
component_install =
endif
local_sources = \
pubsub_pmi.c \
pubsub_pmi.h \
pubsub_pmi_component.c
mcacomponentdir = $(ompilibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_pubsub_pmi_la_SOURCES = $(local_sources)
mca_pubsub_pmi_la_LDFLAGS = -module -avoid-version $(pubsub_pmi_LDFLAGS)
mca_pubsub_pmi_la_LIBADD = $(pubsub_pmi_LIBS)
noinst_LTLIBRARIES = $(component_noinst)
libmca_pubsub_pmi_la_SOURCES = $(local_sources)
libmca_pubsub_pmi_la_LIBADD = $(pubsub_pmi_LIBS)
libmca_pubsub_pmi_la_LDFLAGS = -module -avoid-version $(pubsub_pmi_LDFLAGS)

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

@ -1,27 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_ompi_pubsub_pmi_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_ompi_pubsub_pmi_CONFIG], [
AC_CONFIG_FILES([ompi/mca/pubsub/pmi/Makefile])
OPAL_CHECK_PMI([pubsub_pmi], [pubsub_pmi_good=1], [pubsub_pmi_good=0])
# Evaluate succeed / fail
AS_IF([test "$pubsub_pmi_good" = 1],
[$1],
[$2])
# set build flags to use in makefile
AC_SUBST([pubsub_pmi_CPPFLAGS])
AC_SUBST([pubsub_pmi_LDFLAGS])
AC_SUBST([pubsub_pmi_LIBS])
])

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

@ -1,7 +0,0 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: INTEL
status: maintenance

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

@ -1,128 +0,0 @@
/*
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "ompi/constants.h"
#include "opal/mca/pmix/pmix.h"
#include "ompi/info/info.h"
#include "ompi/mca/rte/rte.h"
#include "ompi/mca/pubsub/base/base.h"
#include "pubsub_pmi.h"
/*
* Init the module
*/
static int init(void)
{
// did the pmix.init in the component
return OMPI_SUCCESS;
}
/*
* publish the port_name for the specified service_name.
*/
static int publish(const char *service_name, ompi_info_t *info, const char *port_name)
{
pmix_info_t *p;
opal_list_t xfer;
ompi_info_entry_t *ie;
int rc;
/* transfer the ompi_info_t data to an array of pmix_info_t structs */
OBJ_CONSTRUCT(&xfer, opal_list_t);
OPAL_LIST_FOREACH(ie, &info->super, ompi_info_entry_t) {
p = OBJ_NEW(pmix_info_t);
strncpy(p->key, ie->ie_key, PMIX_MAX_INFO_KEY);
strncpy(p->value, ie->ie_value, PMIX_MAX_INFO_VAL);
opal_list_append(&xfer, &p->super);
}
rc = opal_pmix.publish(service_name, &xfer, port_name);
OPAL_LIST_DESTRUCT(&xfer);
return rc;
}
static char* lookup(const char *service_name, ompi_info_t *info)
{
char port[PMIX_MAX_VALLEN], *ret;
pmix_info_t *p;
opal_list_t xfer;
ompi_info_entry_t *ie;
int rc;
/* transfer the ompi_info_t data to an array of pmix_info_t structs */
OBJ_CONSTRUCT(&xfer, opal_list_t);
OPAL_LIST_FOREACH(ie, &info->super, ompi_info_entry_t) {
p = OBJ_NEW(pmix_info_t);
strncpy(p->key, ie->ie_key, PMIX_MAX_INFO_KEY);
strncpy(p->value, ie->ie_value, PMIX_MAX_INFO_VAL);
opal_list_append(&xfer, &p->super);
}
rc = opal_pmix.lookup(service_name, &xfer, port, PMIX_MAX_VALLEN);
OPAL_LIST_DESTRUCT(&xfer);
/* in error case port will be set to NULL
* this is what our callers expect to see
* In future maybe some error handling need?
*/
if( rc != OPAL_SUCCESS ){
// improve error processing
return NULL;
}
ret = strdup(port);
return ret;
}
/*
* delete the entry */
static int unpublish(const char *service_name, ompi_info_t *info)
{
pmix_info_t *p;
opal_list_t xfer;
ompi_info_entry_t *ie;
int rc;
/* transfer the ompi_info_t data to an array of pmix_info_t structs */
OBJ_CONSTRUCT(&xfer, opal_list_t);
OPAL_LIST_FOREACH(ie, &info->super, ompi_info_entry_t) {
p = OBJ_NEW(pmix_info_t);
strncpy(p->key, ie->ie_key, PMIX_MAX_INFO_KEY);
strncpy(p->value, ie->ie_value, PMIX_MAX_INFO_VAL);
opal_list_append(&xfer, &p->super);
}
rc = opal_pmix.unpublish(service_name, &xfer);
OPAL_LIST_DESTRUCT(&xfer);
return rc;
}
/*
* finalize the module
*/
static int finalize(void)
{
return OMPI_SUCCESS;
}
/*
* instantiate the module
*/
ompi_pubsub_base_module_t ompi_pubsub_pmi_module = {
init,
publish,
unpublish,
lookup,
finalize
};

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

@ -1,25 +0,0 @@
/*
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef OMPI_PUBSUB_PMI_H
#define OMPI_PUBSUB_PMI_H
#include "ompi/mca/pubsub/pubsub.h"
BEGIN_C_DECLS
/* access to module */
extern ompi_pubsub_base_module_t ompi_pubsub_pmi_module;
/* access to component */
OMPI_MODULE_DECLSPEC extern ompi_pubsub_base_component_t mca_pubsub_pmi_component;
END_C_DECLS
#endif /* OMPI_PUBSUB_PMI_H */

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

@ -1,90 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "opal/runtime/opal_params.h"
#include "opal/mca/pmix/pmix.h"
#include "ompi/constants.h"
#include "ompi/mca/rte/rte.h"
#include "pubsub_pmi.h"
static int pubsub_pmi_component_register(void);
static int pubsub_pmi_component_open(void);
static int pubsub_pmi_component_close(void);
static int pubsub_pmi_component_query(mca_base_module_t **module, int *priority);
static int my_priority = 100; /* must be above "orte" component */
ompi_pubsub_base_component_t mca_pubsub_pmi_component = {
.base_version = {
OMPI_PUBSUB_BASE_VERSION_2_0_0,
.mca_component_name = "pmi",
MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
OMPI_RELEASE_VERSION),
.mca_open_component = pubsub_pmi_component_open,
.mca_close_component = pubsub_pmi_component_close,
.mca_query_component = pubsub_pmi_component_query,
.mca_register_component_params = pubsub_pmi_component_register,
},
.base_data = {
/* This component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
};
static int pubsub_pmi_component_register(void)
{
my_priority = 100;
(void) mca_base_component_var_register(&mca_pubsub_pmi_component.base_version,
"priority", "Priority of the pubsub pmi component",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&my_priority);
return OMPI_SUCCESS;
}
static int pubsub_pmi_component_open(void)
{
return OMPI_SUCCESS;
}
static int pubsub_pmi_component_close(void)
{
if (NULL != opal_pmix.finalize) {
opal_pmix.finalize();
}
return OMPI_SUCCESS;
}
static int pubsub_pmi_component_query(mca_base_module_t **module, int *priority)
{
if (NULL != opal_pmix.init) {
if (OPAL_SUCCESS == opal_pmix.init()) {
*priority = my_priority;
*module = (mca_base_module_t *)&ompi_pubsub_pmi_module;
return OMPI_SUCCESS;
}
}
/* we can't run */
*priority = -1;
*module = NULL;
return OMPI_ERROR;
}

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

@ -1,108 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* 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) 2013-2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* Dynamic Process Management Interface
*
*/
#ifndef OMPI_MCA_PUBSUB_H
#define OMPI_MCA_PUBSUB_H
#include "ompi_config.h"
#include "ompi/mca/mca.h"
#include "opal/mca/base/base.h"
#include "ompi/info/info.h"
BEGIN_C_DECLS
/*
* Initialize a module
*/
typedef int (*ompi_pubsub_base_module_init_fn_t)(void);
/*
* Publish a data item
*/
typedef int (*ompi_pubsub_base_module_publish_fn_t)(const char *service, ompi_info_t *info, const char *port);
/*
* Unpublish a data item
*/
typedef int (*ompi_pubsub_base_module_unpublish_fn_t)(const char *service, ompi_info_t *info);
/*
* Lookup a data item
*/
typedef char* (*ompi_pubsub_base_module_lookup_fn_t)(const char *service, ompi_info_t *info);
/*
* Finalize a module
*/
typedef int (*ompi_pubsub_base_module_finalize_fn_t)(void);
/**
* Structure for PUBSUB modules
*/
struct ompi_pubsub_base_module_1_0_0_t {
/** Initialization Function */
ompi_pubsub_base_module_init_fn_t init;
/* Publish */
ompi_pubsub_base_module_publish_fn_t publish;
/* Unpublish */
ompi_pubsub_base_module_unpublish_fn_t unpublish;
/* Lookup */
ompi_pubsub_base_module_lookup_fn_t lookup;
/* finalize */
ompi_pubsub_base_module_finalize_fn_t finalize;
};
typedef struct ompi_pubsub_base_module_1_0_0_t ompi_pubsub_base_module_1_0_0_t;
typedef struct ompi_pubsub_base_module_1_0_0_t ompi_pubsub_base_module_t;
OMPI_DECLSPEC extern ompi_pubsub_base_module_t ompi_pubsub;
/**
* Structure for PUBSUB components.
*/
struct ompi_pubsub_base_component_2_0_0_t {
/** MCA base component */
mca_base_component_t base_version;
/** MCA base data */
mca_base_component_data_t base_data;
};
typedef struct ompi_pubsub_base_component_2_0_0_t ompi_pubsub_base_component_2_0_0_t;
typedef struct ompi_pubsub_base_component_2_0_0_t ompi_pubsub_base_component_t;
/**
* Macro for use in components that are of type PUBSUB
*/
#define OMPI_PUBSUB_BASE_VERSION_2_0_0 \
OMPI_MCA_BASE_VERSION_2_1_0("pubsub", 2, 0, 0)
END_C_DECLS
#endif /* OMPI_MCA_PUBSUB_H */

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

@ -1,7 +1,7 @@
/*
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
@ -50,6 +50,8 @@ typedef orte_ns_cmp_bitmask_t ompi_rte_cmp_bitmask_t;
#define OMPI_PROC_MY_NAME ORTE_PROC_MY_NAME
#define OMPI_NAME_PRINT(a) ORTE_NAME_PRINT((const orte_process_name_t*)a)
#define ompi_rte_compare_name_fields(a, b, c) orte_util_compare_name_fields(a, (const orte_process_name_t*)(b), (const orte_process_name_t*)(c))
#define ompi_rte_convert_string_to_process_name(a,b) orte_util_convert_string_to_process_name(a,b)
#define ompi_rte_convert_process_name_to_string(a,b) orte_util_convert_process_name_to_string(a,b)
#define OMPI_NAME_WILDCARD ORTE_NAME_WILDCARD
#define OMPI_NODE_RANK_INVALID ORTE_NODE_RANK_INVALID
#define OMPI_LOCAL_RANK_INVALID ORTE_LOCAL_RANK_INVALID

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

@ -1,7 +1,7 @@
/*
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2012-2014 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
@ -19,7 +19,6 @@
#include "opal/util/argv.h"
#include "opal/util/proc.h"
#include "opal/util/opal_getcwd.h"
#include "opal/mca/dstore/dstore.h"
#include "opal/mca/pmix/pmix.h"
#include "opal/threads/threads.h"
#include "opal/class/opal_list.h"

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

@ -4,6 +4,7 @@
* reserved.
* Copyright (c) 2011-2015 INRIA. All rights reserved.
* Copyright (c) 2012-2015 Bordeaux Poytechnic Institute
* Copyright (c) 2015 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -27,7 +28,7 @@
#include "ompi/mca/pml/pml.h"
#include "opal/mca/dstore/dstore.h"
#include "opal/mca/pmix/pmix.h"
#define ERR_EXIT(ERR) \
do { free(local_pattern); \
@ -178,7 +179,7 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
for(i = 0; i < size ; i++) {
proc = ompi_group_peer_lookup(comm_old->c_local_group, i);
pval = &val;
OPAL_MODEX_RECV_VALUE(err, OPAL_DSTORE_NODEID, &(proc->super), &pval, OPAL_UINT32);
OPAL_MODEX_RECV_VALUE(err, OPAL_PMIX_NODEID, &(proc->super.proc_name), &pval, OPAL_UINT32);
if( OPAL_SUCCESS != err ) {
opal_output(0, "Unable to extract peer %s nodeid from the modex.\n",
OMPI_NAME_PRINT(&(proc->super)));
@ -863,20 +864,20 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
#endif
OBJ_CONSTRUCT(&kv, opal_value_t);
kv.key = strdup(OPAL_DSTORE_CPUSET);
kv.key = strdup(OPAL_PMIX_CPUSET);
kv.type = OPAL_STRING;
kv.data.string = strdup(set_as_string);
(void)opal_dstore.store(opal_dstore_internal, (opal_process_name_t*)ORTE_PROC_MY_NAME, &kv);
(void)opal_pmix.store_local((opal_process_name_t*)ORTE_PROC_MY_NAME, &kv);
OBJ_DESTRUCT(&kv);
locality = opal_hwloc_base_get_relative_locality(opal_hwloc_topology,
orte_process_info.cpuset,set_as_string);
OBJ_CONSTRUCT(&kv, opal_value_t);
kv.key = strdup(OPAL_DSTORE_LOCALITY);
kv.key = strdup(OPAL_PMIX_LOCALITY);
kv.type = OPAL_UINT16;
kv.data.uint16 = locality;
(void)opal_dstore.store(opal_dstore_internal, (opal_process_name_t*)ORTE_PROC_MY_NAME, &kv);
(void)opal_pmix.store_local((opal_process_name_t*)ORTE_PROC_MY_NAME, &kv);
OBJ_DESTRUCT(&kv);
if( OMPI_SUCCESS != (err = ompi_comm_create(comm_old,

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

@ -3,6 +3,7 @@
* All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -12,55 +13,35 @@
#include "ompi_config.h"
#include "vprotocol_pessimist_eventlog.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/mca/pubsub/pubsub.h"
#include "opal/mca/pmix/pmix.h"
#include "ompi/dpm/dpm.h"
int vprotocol_pessimist_event_logger_connect(int el_rank, ompi_communicator_t **el_comm)
{
int rc;
opal_buffer_t *buffer;
char *port;
ompi_process_name_t el_proc;
char *hnp_uri, *rml_uri;
ompi_rml_tag_t el_tag;
char name[MPI_MAX_PORT_NAME];
int rank;
vprotocol_pessimist_clock_t connect_info[2];
opal_list_t results;
opal_pmix_pdata_t *pdat;
snprintf(name, MPI_MAX_PORT_NAME, VPROTOCOL_EVENT_LOGGER_NAME_FMT, el_rank);
port = ompi_pubsub.lookup(name, MPI_INFO_NULL);
if(NULL == port)
{
OBJ_CONSTRUCT(&results, opal_list_t);
pdat = OBJ_NEW(opal_pmix_pdata_t);
asprintf(&pdat->key, VPROTOCOL_EVENT_LOGGER_NAME_FMT, el_rank);
opal_list_append(&results, &pdat->super);
rc = opal_pmix.lookup(OPAL_PMIX_NAMESPACE, &results);
if (OPAL_SUCCESS != rc ||
OPAL_STRING != pdat->value.type ||
NULL == pdat->value.data.string) {
OPAL_LIST_DESTRUCT(&results);
return OMPI_ERR_NOT_FOUND;
}
port = strdup(pdat->value.data.string);
OPAL_LIST_DESTRUCT(&results);
V_OUTPUT_VERBOSE(45, "Found port < %s >", port);
/* separate the string into the HNP and RML URI and tag */
if (OMPI_SUCCESS != (rc = ompi_dpm.parse_port(port, &hnp_uri, &rml_uri, &el_tag))) {
OMPI_ERROR_LOG(rc);
return rc;
}
/* extract the originating proc's name */
if (OMPI_SUCCESS != (rc = ompi_rte_parse_uris(rml_uri, &el_proc, NULL))) {
OMPI_ERROR_LOG(rc);
free(rml_uri); free(hnp_uri);
return rc;
}
/* make sure we can route rml messages to the destination */
if (OMPI_SUCCESS != (rc = ompi_dpm.route_to_port(hnp_uri, &el_proc))) {
OMPI_ERROR_LOG(rc);
free(rml_uri); free(hnp_uri);
return rc;
}
free(rml_uri); free(hnp_uri);
/* Send an rml message to tell the remote end to wake up and jump into
* connect/accept */
buffer = OBJ_NEW(opal_buffer_t);
ompi_rte_send_buffer_nb(&el_proc, buffer, el_tag+1, NULL, NULL);
rc = ompi_dpm.connect_accept(MPI_COMM_SELF, 0, port, true, el_comm);
rc = ompi_dpm_connect_accept(MPI_COMM_SELF, 0, port, true, el_comm);
if(OMPI_SUCCESS != rc) {
OMPI_ERROR_LOG(rc);
}
@ -86,7 +67,7 @@ int vprotocol_pessimist_event_logger_connect(int el_rank, ompi_communicator_t **
int vprotocol_pessimist_event_logger_disconnect(ompi_communicator_t *el_comm)
{
ompi_dpm.disconnect(el_comm);
ompi_dpm_disconnect(el_comm);
return OMPI_SUCCESS;
}

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

@ -12,6 +12,7 @@
* All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -25,7 +26,7 @@
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/dpm/dpm.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
@ -53,7 +54,7 @@ int MPI_Close_port(const char *port_name)
FUNC_NAME);
}
ret = ompi_dpm.close_port(port_name);
ret = ompi_dpm_close_port(port_name);
OMPI_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, ret, FUNC_NAME);
}

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

@ -14,6 +14,7 @@
* Copyright (c) 2008 University of Houston, Inc. All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -28,7 +29,7 @@
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/info/info.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/dpm/dpm.h"
#include "ompi/memchecker.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
@ -95,11 +96,11 @@ int MPI_Comm_accept(const char *port_name, MPI_Info info, int root,
OPAL_CR_ENTER_LIBRARY();
if ( rank == root ) {
rc = ompi_dpm.connect_accept (comm, root, port_name, send_first,
rc = ompi_dpm_connect_accept (comm, root, port_name, send_first,
&newcomp);
}
else {
rc = ompi_dpm.connect_accept (comm, root, NULL, send_first,
rc = ompi_dpm_connect_accept (comm, root, NULL, send_first,
&newcomp);
}

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

@ -14,6 +14,7 @@
* Copyright (c) 2008 University of Houston. All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -28,7 +29,7 @@
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/info/info.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/dpm/dpm.h"
#include "ompi/memchecker.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
@ -97,11 +98,11 @@ int MPI_Comm_connect(const char *port_name, MPI_Info info, int root,
OPAL_CR_ENTER_LIBRARY();
if ( rank == root ) {
rc = ompi_dpm.connect_accept (comm, root, port_name, send_first,
rc = ompi_dpm_connect_accept (comm, root, port_name, send_first,
&newcomp);
}
else {
rc = ompi_dpm.connect_accept (comm, root, NULL, send_first,
rc = ompi_dpm_connect_accept (comm, root, NULL, send_first,
&newcomp);
}

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

@ -10,6 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -33,7 +34,7 @@
#include "ompi/mpi/c/profile/defines.h"
#endif
#include "ompi/mca/dpm/dpm.h"
#include "ompi/dpm/dpm.h"
static const char FUNC_NAME[] = "MPI_Comm_disconnect";
@ -62,7 +63,7 @@ int MPI_Comm_disconnect(MPI_Comm *comm)
OPAL_CR_ENTER_LIBRARY();
if ( OMPI_COMM_IS_DYNAMIC(*comm)) {
if (OMPI_SUCCESS != ompi_dpm.disconnect (*comm)) {
if (OMPI_SUCCESS != ompi_dpm_disconnect (*comm)) {
ret = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
}
}

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

@ -38,7 +38,7 @@
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/dpm/dpm.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
@ -59,7 +59,6 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
int rc;
uint32_t len, rlen, llen, lrlen;
int send_first=0;
char *rport;
ompi_process_name_t rname, tmp_name;
ompi_communicator_t *newcomp;
@ -76,12 +75,6 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
OPAL_CR_ENTER_LIBRARY();
/* open a port using the specified tag */
if (OMPI_SUCCESS != (rc = ompi_dpm.open_port(port_name, OMPI_COMM_JOIN_TAG))) {
OPAL_CR_EXIT_LIBRARY();
return rc;
}
/* send my process name */
tmp_name = *OMPI_PROC_MY_NAME;
OMPI_PROCESS_NAME_HTON(tmp_name);
@ -107,34 +100,30 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
send_first = true;
}
/* sendrecv port-name through the socket connection.
Need to determine somehow how to avoid a potential deadlock
here. */
llen = (uint32_t)(strlen(port_name)+1);
len = htonl(llen);
ompi_socket_send( fd, (char *) &len, sizeof(uint32_t));
ompi_socket_recv (fd, (char *) &rlen, sizeof(uint32_t));
lrlen = ntohl(rlen);
rport = (char *) malloc (lrlen);
if ( NULL == rport ) {
*intercomm = MPI_COMM_NULL;
OPAL_CR_EXIT_LIBRARY();
return MPI_ERR_INTERN;
}
/* Assumption: socket_send should not block, even if the socket
is not configured to be non-blocking, because the message length are
so short. */
/* we will only use the send_first proc's port name,
* so pass it to the recv_first participant */
if (send_first) {
/* open a port */
if (OMPI_SUCCESS != (rc = ompi_dpm_open_port(port_name))) {
OPAL_CR_EXIT_LIBRARY();
return rc;
}
llen = (uint32_t)(strlen(port_name)+1);
len = htonl(llen);
ompi_socket_send( fd, (char *) &len, sizeof(uint32_t));
ompi_socket_send (fd, port_name, llen);
ompi_socket_recv (fd, rport, lrlen);
} else {
ompi_socket_recv (fd, (char *) &rlen, sizeof(uint32_t));
lrlen = ntohl(rlen);
ompi_socket_recv (fd, port_name, lrlen);
}
/* use the port we received to connect/accept */
rc = ompi_dpm.connect_accept (MPI_COMM_SELF, 0, rport, send_first, &newcomp);
free ( rport );
/* use the port to connect/accept */
rc = ompi_dpm_connect_accept (MPI_COMM_SELF, 0, port_name, send_first, &newcomp);
*intercomm = newcomp;
OMPI_ERRHANDLER_RETURN (rc, MPI_COMM_SELF, rc, FUNC_NAME);

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

@ -14,6 +14,7 @@
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -28,7 +29,7 @@
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/dpm/dpm.h"
#include "ompi/memchecker.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
@ -109,7 +110,7 @@ int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info inf
if (!non_mpi) {
/* Open a port. The port_name is passed as an environment
variable to the children. */
if (OMPI_SUCCESS != (rc = ompi_dpm.open_port (port_name, OMPI_RML_TAG_INVALID))) {
if (OMPI_SUCCESS != (rc = ompi_dpm_open_port (port_name))) {
goto error;
}
} else if (1 < ompi_comm_size(comm)) {
@ -117,7 +118,7 @@ int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info inf
rc = OMPI_ERR_NOT_SUPPORTED;
goto error;
}
if (OMPI_SUCCESS != (rc = ompi_dpm.spawn (1, &command, &argv, &maxprocs,
if (OMPI_SUCCESS != (rc = ompi_dpm_spawn (1, &command, &argv, &maxprocs,
&info, port_name))) {
goto error;
}
@ -126,7 +127,7 @@ int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info inf
if (non_mpi) {
newcomp = MPI_COMM_NULL;
} else {
rc = ompi_dpm.connect_accept (comm, root, port_name, send_first, &newcomp);
rc = ompi_dpm_connect_accept (comm, root, port_name, send_first, &newcomp);
}
error:
@ -134,7 +135,7 @@ error:
/* close the port */
if (rank == root && !non_mpi) {
ompi_dpm.close_port(port_name);
ompi_dpm_close_port(port_name);
}
/* set error codes */

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

@ -14,6 +14,7 @@
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -28,7 +29,7 @@
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/info/info.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/dpm/dpm.h"
#include "ompi/memchecker.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
@ -149,7 +150,7 @@ int MPI_Comm_spawn_multiple(int count, char *array_of_commands[], char **array_o
if (!non_mpi) {
/* Open a port. The port_name is passed as an environment
variable to the children. */
if (OMPI_SUCCESS != (rc = ompi_dpm.open_port (port_name, OMPI_RML_TAG_INVALID))) {
if (OMPI_SUCCESS != (rc = ompi_dpm_open_port (port_name))) {
goto error;
}
} else if (1 < ompi_comm_size(comm)) {
@ -157,7 +158,7 @@ int MPI_Comm_spawn_multiple(int count, char *array_of_commands[], char **array_o
rc = OMPI_ERR_NOT_SUPPORTED;
goto error;
}
if (OMPI_SUCCESS != (rc = ompi_dpm.spawn(count, (const char **) array_of_commands,
if (OMPI_SUCCESS != (rc = ompi_dpm_spawn(count, (const char **) array_of_commands,
array_of_argv, array_of_maxprocs,
array_of_info, port_name))) {
goto error;
@ -167,7 +168,7 @@ int MPI_Comm_spawn_multiple(int count, char *array_of_commands[], char **array_o
if (non_mpi) {
newcomp = MPI_COMM_NULL;
} else {
rc = ompi_dpm.connect_accept (comm, root, port_name, send_first, &newcomp);
rc = ompi_dpm_connect_accept (comm, root, port_name, send_first, &newcomp);
}
error:
@ -175,7 +176,7 @@ error:
/* close the port */
if (rank == root && !non_mpi) {
ompi_dpm.close_port(port_name);
ompi_dpm_close_port(port_name);
}
/* set array of errorcodes */

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

@ -12,6 +12,7 @@
* All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -21,12 +22,14 @@
#include "ompi_config.h"
#include "opal/class/opal_list.h"
#include "opal/mca/pmix/pmix.h"
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/info/info.h"
#include "ompi/communicator/communicator.h"
#include "ompi/mca/pubsub/pubsub.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Lookup_name = PMPI_Lookup_name
@ -41,7 +44,12 @@ static const char FUNC_NAME[] = "MPI_Lookup_name";
int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name)
{
char *tmp;
char range[OPAL_MAX_INFO_VAL];
int flag=0, ret;
opal_pmix_data_range_t rng;
bool range_given = false;
opal_list_t results;
opal_pmix_pdata_t *pdat;
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
@ -62,22 +70,44 @@ int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name)
OPAL_CR_ENTER_LIBRARY();
/*
* No predefined info-objects for this function in MPI-2,
* therefore, we do not parse the info-object at the moment.
*/
/* OMPI supports info keys to pass the range to
* be searched for the given key */
if (MPI_INFO_NULL != info) {
ompi_info_get (info, "range", sizeof(range) - 1, range, &flag);
if (flag) {
range_given = true;
if (0 == strcmp(range, "nspace")) {
rng = OPAL_PMIX_NAMESPACE; // share only with procs in same nspace
} else if (0 == strcmp(range, "session")) {
rng = OPAL_PMIX_SESSION; // share only with procs in same session
} else {
/* unrecognized scope */
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME);
}
}
}
if (!range_given) {
/* default to nspace */
rng = OPAL_PMIX_NAMESPACE;
}
/*
* if multiple entries found, this implementation uses
* at the moment the first entry.
*/
tmp = (char *) ompi_pubsub.lookup(service_name, info);
if ( NULL == tmp ) {
/* collect the findings */
OBJ_CONSTRUCT(&results, opal_list_t);
pdat = OBJ_NEW(opal_pmix_pdata_t);
pdat->key = strdup(service_name);
opal_list_append(&results, &pdat->super);
ret = opal_pmix.lookup(rng, &results);
if (OPAL_SUCCESS != ret ||
OPAL_STRING != pdat->value.type ||
NULL == pdat->value.data.string) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NAME,
FUNC_NAME);
}
strncpy ( port_name, tmp, MPI_MAX_PORT_NAME );
strncpy ( port_name, pdat->value.data.string, MPI_MAX_PORT_NAME );
OPAL_LIST_DESTRUCT(&results);
OPAL_CR_EXIT_LIBRARY();
return MPI_SUCCESS;

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -23,7 +24,7 @@
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/info/info.h"
#include "ompi/mca/dpm/dpm.h"
#include "ompi/dpm/dpm.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Open_port = PMPI_Open_port
@ -66,7 +67,7 @@ int MPI_Open_port(MPI_Info info, char *port_name)
OPAL_CR_ENTER_LIBRARY();
rc = ompi_dpm.open_port(port_name, OMPI_RML_TAG_INVALID);
rc = ompi_dpm_open_port(port_name);
OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}

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

@ -12,7 +12,8 @@
* All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
@ -21,12 +22,14 @@
#include "ompi_config.h"
#include <stdio.h>
#include "opal/class/opal_list.h"
#include "opal/mca/pmix/pmix.h"
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/info/info.h"
#include "ompi/communicator/communicator.h"
#include "ompi/mca/pubsub/pubsub.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Publish_name = PMPI_Publish_name
@ -43,6 +46,14 @@ int MPI_Publish_name(const char *service_name, MPI_Info info,
const char *port_name)
{
int rc;
char range[OPAL_MAX_INFO_VAL];
int flag=0;
opal_pmix_data_range_t rng;
bool range_given = false;
opal_pmix_persistence_t persist;
bool persistence_given = false;
opal_list_t values;
opal_pmix_info_t *pinfo;
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
@ -63,15 +74,62 @@ int MPI_Publish_name(const char *service_name, MPI_Info info,
OPAL_CR_ENTER_LIBRARY();
/*
* No predefined info-objects for this function in MPI-2,
* therefore, we do not parse the info-object at the moment.
*/
/* OMPI supports info keys to pass the range and persistence to
* be used for the given key */
if (MPI_INFO_NULL != info) {
ompi_info_get (info, "range", sizeof(range) - 1, range, &flag);
if (flag) {
range_given = true;
if (0 == strcmp(range, "nspace")) {
rng = OPAL_PMIX_NAMESPACE; // share only with procs in same nspace
} else if (0 == strcmp(range, "session")) {
rng = OPAL_PMIX_SESSION; // share only with procs in same session
} else {
/* unrecognized range */
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME);
}
}
ompi_info_get (info, "persistence", sizeof(range) - 1, range, &flag);
if (flag) {
persistence_given = true;
if (0 == strcmp(range, "indef")) {
persist = OPAL_PMIX_PERSIST_INDEF; // retain until specifically deleted
} else if (0 == strcmp(range, "proc")) {
persist = OPAL_PMIX_PERSIST_PROC; // retain until publishing process terminates
} else if (0 == strcmp(range, "app")) {
persist = OPAL_PMIX_PERSIST_APP; // retain until application terminates
} else if (0 == strcmp(range, "session")) {
persist = OPAL_PMIX_PERSIST_SESSION; // retain until session/allocation terminates
} else {
/* unrecognized persistence */
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME);
}
}
}
if (!range_given) {
/* default to nspace */
rng = OPAL_PMIX_NAMESPACE;
}
if (!persistence_given) {
persist = OPAL_PMIX_PERSIST_APP;
}
/* publish the values */
OBJ_CONSTRUCT(&values, opal_list_t);
pinfo = OBJ_NEW(opal_pmix_info_t);
pinfo->key = strdup(service_name);
pinfo->value.type = OPAL_STRING;
pinfo->value.data.string = strdup(port_name);
opal_list_append(&values, &pinfo->super);
rc = opal_pmix.publish(rng, persist, &values);
OPAL_LIST_DESTRUCT(&values);
rc = ompi_pubsub.publish (service_name, info, port_name);
OPAL_CR_EXIT_LIBRARY();
if ( OMPI_SUCCESS != rc ) {
if (OMPI_EXISTS == rc) {
if ( OPAL_SUCCESS != rc ) {
if (OPAL_EXISTS == rc) {
/* already exists - can't publish it */
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_FILE_EXISTS,
FUNC_NAME);

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

@ -12,6 +12,7 @@
* All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -21,12 +22,15 @@
#include "ompi_config.h"
#include <stdio.h>
#include "opal/class/opal_list.h"
#include "opal/mca/pmix/pmix.h"
#include "opal/util/argv.h"
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/info/info.h"
#include "ompi/mca/pubsub/pubsub.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Unpublish_name = PMPI_Unpublish_name
@ -43,6 +47,11 @@ int MPI_Unpublish_name(const char *service_name, MPI_Info info,
const char *port_name)
{
int rc;
char range[OPAL_MAX_INFO_VAL];
int flag=0;
opal_pmix_data_range_t rng;
bool range_given = false;
char **keys = NULL;
if ( MPI_PARAM_CHECK ) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
@ -63,19 +72,42 @@ int MPI_Unpublish_name(const char *service_name, MPI_Info info,
OPAL_CR_ENTER_LIBRARY();
/*
* No predefined info-objects for this function in MPI-2,
* therefore, we do not parse the info-object at the moment.
*/
rc = ompi_pubsub.unpublish(service_name, info);
if ( OMPI_SUCCESS != rc ) {
if (OMPI_ERR_NOT_FOUND == rc) {
/* OMPI supports info keys to pass the range to
* be searched for the given key */
if (MPI_INFO_NULL != info) {
ompi_info_get (info, "range", sizeof(range) - 1, range, &flag);
if (flag) {
range_given = true;
if (0 == strcmp(range, "nspace")) {
rng = OPAL_PMIX_NAMESPACE; // share only with procs in same nspace
} else if (0 == strcmp(range, "session")) {
rng = OPAL_PMIX_SESSION; // share only with procs in same session
} else {
/* unrecognized range */
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME);
}
}
}
if (!range_given) {
/* default to nspace */
rng = OPAL_PMIX_NAMESPACE;
}
/* unpublish the service_name */
opal_argv_append_nosize(&keys, service_name);
rc = opal_pmix.unpublish(rng, keys);
opal_argv_free(keys);
if ( OPAL_SUCCESS != rc ) {
if (OPAL_ERR_NOT_FOUND == rc) {
/* service couldn't be found */
OPAL_CR_EXIT_LIBRARY();
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_SERVICE,
FUNC_NAME);
}
if (OMPI_ERR_PERM == rc) {
if (OPAL_ERR_PERM == rc) {
/* this process didn't own the specified service */
OPAL_CR_EXIT_LIBRARY();
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ACCESS,

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

@ -12,7 +12,7 @@
* Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
@ -33,7 +33,6 @@
#include "opal/dss/dss.h"
#include "opal/util/arch.h"
#include "opal/util/show_help.h"
#include "opal/mca/dstore/dstore.h"
#include "opal/mca/hwloc/base/base.h"
#include "opal/mca/pmix/pmix.h"
@ -115,8 +114,8 @@ int ompi_proc_init(void)
opal_proc_local_set(&proc->super);
#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
/* add our arch to the modex */
OPAL_MODEX_SEND_VALUE(ret, PMIX_SYNC_REQD, PMIX_GLOBAL,
OPAL_DSTORE_ARCH, &opal_local_arch, OPAL_UINT32);
OPAL_MODEX_SEND_VALUE(ret, OPAL_PMIX_GLOBAL,
OPAL_PMIX_ARCH, &opal_local_arch, OPAL_UINT32);
if (OPAL_SUCCESS != ret) {
return ret;
}
@ -141,29 +140,21 @@ int ompi_proc_complete_init(void)
{
ompi_proc_t *proc;
int ret, errcode = OMPI_SUCCESS;
opal_list_t myvals;
opal_value_t *kv;
uint16_t u16, *u16ptr;
OPAL_THREAD_LOCK(&ompi_proc_lock);
u16ptr = &u16;
OPAL_LIST_FOREACH(proc, &ompi_proc_list, ompi_proc_t) {
if (OMPI_CAST_RTE_NAME(&proc->super.proc_name)->vpid != OMPI_PROC_MY_NAME->vpid) {
/* get the locality information - do not use modex recv for
* this request as that will automatically cause the hostname
* to be loaded as well. All RTEs are required to provide this
* information at startup for procs on our node. Thus, not
* finding the info indicates that the proc is non-local.
*/
OBJ_CONSTRUCT(&myvals, opal_list_t);
if (OMPI_SUCCESS != (ret = opal_dstore.fetch(opal_dstore_internal,
&proc->super.proc_name,
OPAL_DSTORE_LOCALITY, &myvals))) {
/* get the locality information - all RTEs are required
* to provide this information at startup */
OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCALITY, &proc->super.proc_name, &u16ptr, OPAL_UINT16);
if (OPAL_SUCCESS != ret) {
proc->super.proc_flags = OPAL_PROC_NON_LOCAL;
} else {
kv = (opal_value_t*)opal_list_get_first(&myvals);
proc->super.proc_flags = kv->data.uint16;
proc->super.proc_flags = u16;
}
OPAL_LIST_DESTRUCT(&myvals);
if (ompi_process_info.num_procs < ompi_direct_modex_cutoff) {
/* IF the number of procs falls below the specified cutoff,
@ -172,7 +163,7 @@ int ompi_proc_complete_init(void)
* ALL modex info for this proc) will have no appreciable
* impact on launch scaling
*/
OPAL_MODEX_RECV_VALUE(ret, OPAL_DSTORE_HOSTNAME, (opal_proc_t*)&proc->super,
OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_HOSTNAME, &proc->super.proc_name,
(char**)&(proc->super.proc_hostname), OPAL_STRING);
if (OPAL_SUCCESS != ret) {
errcode = ret;
@ -194,7 +185,7 @@ int ompi_proc_complete_init(void)
{
uint32_t *ui32ptr;
ui32ptr = &(proc->super.proc_arch);
OPAL_MODEX_RECV_VALUE(ret, OPAL_DSTORE_ARCH, (opal_proc_t*)&proc->super,
OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_ARCH, &proc->super.proc_name,
(void**)&ui32ptr, OPAL_UINT32);
if (OPAL_SUCCESS == ret) {
/* if arch is different than mine, create a new convertor for this proc */
@ -393,8 +384,7 @@ int ompi_proc_refresh(void)
opal_list_item_t *item = NULL;
ompi_vpid_t i = 0;
int ret=OMPI_SUCCESS;
opal_list_t myvals;
opal_value_t *kv;
uint16_t u16, *u16ptr;
OPAL_THREAD_LOCK(&ompi_proc_lock);
@ -405,6 +395,7 @@ int ompi_proc_refresh(void)
/* Does not change: proc->super.proc_name.vpid */
OMPI_CAST_RTE_NAME(&proc->super.proc_name)->jobid = OMPI_PROC_MY_NAME->jobid;
u16ptr = &u16;
/* Make sure to clear the local flag before we set it below */
proc->super.proc_flags = 0;
@ -416,22 +407,14 @@ int ompi_proc_refresh(void)
proc->super.proc_arch = opal_local_arch;
opal_proc_local_set(&proc->super);
} else {
/* get the locality information - do not use modex recv for
* this request as that will automatically cause the hostname
* to be loaded as well. All RTEs are required to provide this
* information at startup for procs on our node. Thus, not
* finding the info indicates that the proc is non-local.
*/
OBJ_CONSTRUCT(&myvals, opal_list_t);
if (OMPI_SUCCESS != (ret = opal_dstore.fetch(opal_dstore_internal,
&proc->super.proc_name,
OPAL_DSTORE_LOCALITY, &myvals))) {
/* get the locality information - all RTEs are required
* to provide this information at startup */
OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCALITY, &proc->super.proc_name, &u16ptr, OPAL_UINT16);
if (OPAL_SUCCESS != ret) {
proc->super.proc_flags = OPAL_PROC_NON_LOCAL;
} else {
kv = (opal_value_t*)opal_list_get_first(&myvals);
proc->super.proc_flags = kv->data.uint16;
proc->super.proc_flags = u16;
}
OPAL_LIST_DESTRUCT(&myvals);
if (ompi_process_info.num_procs < ompi_direct_modex_cutoff) {
/* IF the number of procs falls below the specified cutoff,
@ -440,7 +423,7 @@ int ompi_proc_refresh(void)
* ALL modex info for this proc) will have no appreciable
* impact on launch scaling
*/
OPAL_MODEX_RECV_VALUE(ret, OPAL_DSTORE_HOSTNAME, (opal_proc_t*)&proc->super,
OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_HOSTNAME, &proc->super.proc_name,
(char**)&(proc->super.proc_hostname), OPAL_STRING);
if (OMPI_SUCCESS != ret) {
break;
@ -459,7 +442,7 @@ int ompi_proc_refresh(void)
{
/* get the remote architecture */
uint32_t* uiptr = &(proc->super.proc_arch);
OPAL_MODEX_RECV_VALUE(ret, OPAL_DSTORE_ARCH, (opal_proc_t*)&proc->super,
OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_ARCH, &proc->super.proc_name,
(void**)&uiptr, OPAL_UINT32);
if (OMPI_SUCCESS != ret) {
break;
@ -484,7 +467,6 @@ int ompi_proc_refresh(void)
int
ompi_proc_pack(ompi_proc_t **proclist, int proclistsize,
bool full_info,
opal_buffer_t* buf)
{
int i, rc;
@ -510,46 +492,6 @@ ompi_proc_pack(ompi_proc_t **proclist, int proclistsize,
OPAL_THREAD_UNLOCK(&ompi_proc_lock);
return rc;
}
if (full_info) {
int32_t num_entries;
opal_value_t *kv;
opal_list_t data;
/* fetch all info we know about the peer - while
* the remote procs may already know some of it, we cannot
* be certain they do. So we must include a full dump of
* everything we know about this proc
*/
OBJ_CONSTRUCT(&data, opal_list_t);
rc = opal_dstore.fetch(opal_dstore_internal,
&proclist[i]->super.proc_name,
NULL, &data);
if (OPAL_SUCCESS != rc) {
OMPI_ERROR_LOG(rc);
num_entries = 0;
} else {
/* count the number of entries we will send */
num_entries = opal_list_get_size(&data);
}
/* put the number of entries into the buffer */
rc = opal_dss.pack(buf, &num_entries, 1, OPAL_INT32);
if (OPAL_SUCCESS != rc) {
OMPI_ERROR_LOG(rc);
break;
}
/* if there are entries, store them */
while (NULL != (kv = (opal_value_t*)opal_list_remove_first(&data))) {
if (OPAL_SUCCESS != (rc = opal_dss.pack(buf, &kv, 1, OPAL_VALUE))) {
OMPI_ERROR_LOG(rc);
break;
}
OBJ_RELEASE(kv);
}
OBJ_DESTRUCT(&data);
} else {
rc = opal_dss.pack(buf, &(proclist[i]->super.proc_arch), 1, OPAL_UINT32);
if(rc != OPAL_SUCCESS) {
OMPI_ERROR_LOG(rc);
@ -563,12 +505,11 @@ ompi_proc_pack(ompi_proc_t **proclist, int proclistsize,
return rc;
}
}
}
OPAL_THREAD_UNLOCK(&ompi_proc_lock);
return OMPI_SUCCESS;
}
static ompi_proc_t *
ompi_proc_t *
ompi_proc_find_and_add(const ompi_process_name_t * name, bool* isnew)
{
ompi_proc_t *proc, *rproc = NULL;
@ -610,14 +551,11 @@ ompi_proc_find_and_add(const ompi_process_name_t * name, bool* isnew)
int
ompi_proc_unpack(opal_buffer_t* buf,
int proclistsize, ompi_proc_t ***proclist,
bool full_info,
int *newproclistsize, ompi_proc_t ***newproclist)
{
int i;
size_t newprocs_len = 0;
ompi_proc_t **plist=NULL, **newprocs = NULL;
opal_list_t myvals;
opal_value_t *kv;
/* do not free plist *ever*, since it is used in the remote group
structure of a communicator */
@ -635,7 +573,7 @@ ompi_proc_unpack(opal_buffer_t* buf,
/* cycle through the array of provided procs and unpack
* their info - as packed by ompi_proc_pack
*/
for ( i=0; i<proclistsize; i++ ){
for (i=0; i<proclistsize; i++){
int32_t count=1;
ompi_process_name_t new_name;
uint32_t new_arch;
@ -650,7 +588,6 @@ ompi_proc_unpack(opal_buffer_t* buf,
free(newprocs);
return rc;
}
if (!full_info) {
rc = opal_dss.unpack(buf, &new_arch, &count, OPAL_UINT32);
if (rc != OPAL_SUCCESS) {
OMPI_ERROR_LOG(rc);
@ -665,7 +602,6 @@ ompi_proc_unpack(opal_buffer_t* buf,
free(newprocs);
return rc;
}
}
/* see if this proc is already on our ompi_proc_list */
plist[i] = ompi_proc_find_and_add(&new_name, &isnew);
if (isnew) {
@ -675,74 +611,6 @@ ompi_proc_unpack(opal_buffer_t* buf,
*/
newprocs[newprocs_len++] = plist[i];
if (full_info) {
int32_t num_recvd_entries;
int32_t cnt;
int32_t j;
/* unpack the number of entries for this proc */
cnt = 1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buf, &num_recvd_entries, &cnt, OPAL_INT32))) {
OMPI_ERROR_LOG(rc);
break;
}
/*
* Extract the attribute names and values
*/
for (j = 0; j < num_recvd_entries; j++) {
cnt = 1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buf, &kv, &cnt, OPAL_VALUE))) {
OMPI_ERROR_LOG(rc);
break;
}
/* if this is me, ignore the data - we already have it in the db */
if (OPAL_EQUAL != ompi_rte_compare_name_fields(OMPI_RTE_CMP_ALL,
OMPI_PROC_MY_NAME, &new_name)) {
/* store it in the database */
if (OPAL_SUCCESS != (rc = opal_dstore.store(opal_dstore_internal,
&new_name, kv))) {
OMPI_ERROR_LOG(rc);
}
}
OBJ_RELEASE(kv);
}
/* RHC: compute locality */
#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
OBJ_CONSTRUCT(&myvals, opal_list_t);
rc = opal_dstore.fetch(opal_dstore_internal,
&new_name,
OPAL_DSTORE_ARCH, &myvals);
if( OPAL_SUCCESS == rc ) {
kv = (opal_value_t*)opal_list_get_first(&myvals);
new_arch = kv->data.uint32;
} else {
new_arch = opal_local_arch;
}
OPAL_LIST_DESTRUCT(&myvals);
#else
new_arch = opal_local_arch;
#endif
if (ompi_process_info.num_procs < ompi_direct_modex_cutoff) {
/* retrieve the hostname */
OBJ_CONSTRUCT(&myvals, opal_list_t);
rc = opal_dstore.fetch(opal_dstore_internal,
&new_name,
OPAL_DSTORE_HOSTNAME, &myvals);
if( OPAL_SUCCESS == rc ) {
kv = (opal_value_t*)opal_list_get_first(&myvals);
new_hostname = strdup(kv->data.string);
} else {
new_hostname = NULL;
}
OPAL_LIST_DESTRUCT(&myvals);
} else {
/* just set the hostname to NULL for now - we'll fill it in
* as modex_recv's are called for procs we will talk to
*/
new_hostname = NULL;
}
}
/* update all the values */
plist[i]->super.proc_arch = new_arch;
/* if arch is different than mine, create a new convertor for this proc */
@ -770,28 +638,6 @@ ompi_proc_unpack(opal_buffer_t* buf,
/* Save the hostname */
plist[i]->super.proc_hostname = new_hostname;
}
} else {
if (full_info) {
int32_t num_recvd_entries;
int32_t j, cnt;
/* discard all keys: they are already locally known */
cnt = 1;
if (OPAL_SUCCESS == (rc = opal_dss.unpack(buf, &num_recvd_entries, &cnt, OPAL_INT32))) {
for (j = 0; j < num_recvd_entries; j++) {
opal_value_t *kv;
cnt = 1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buf, &kv, &cnt, OPAL_VALUE))) {
OMPI_ERROR_LOG(rc);
continue;
}
OBJ_RELEASE(kv);
}
} else {
OMPI_ERROR_LOG(rc);
}
}
}
}

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

@ -219,6 +219,8 @@ static inline ompi_proc_t* ompi_proc_local(void)
*/
OMPI_DECLSPEC ompi_proc_t * ompi_proc_find ( const ompi_process_name_t* name );
OMPI_DECLSPEC ompi_proc_t * ompi_proc_find_and_add(const ompi_process_name_t * name, bool* isnew);
/**
* Pack proc list into portable buffer
*
@ -237,8 +239,8 @@ OMPI_DECLSPEC ompi_proc_t * ompi_proc_find ( const ompi_process_name_t* name );
* @retval OMPI_SUCCESS Success
* @retval OMPI_ERROR Unspecified error
*/
OMPI_DECLSPEC int ompi_proc_pack(ompi_proc_t **proclist, int proclistsize,
bool full_info,
OMPI_DECLSPEC int ompi_proc_pack(ompi_proc_t **proclist,
int proclistsize,
opal_buffer_t *buf);
@ -282,9 +284,10 @@ OMPI_DECLSPEC int ompi_proc_pack(ompi_proc_t **proclist, int proclistsize,
* OMPI_ERROR else
*/
OMPI_DECLSPEC int ompi_proc_unpack(opal_buffer_t *buf,
int proclistsize, ompi_proc_t ***proclist,
bool full_info,
int *newproclistsize, ompi_proc_t ***newproclist);
int proclistsize,
ompi_proc_t ***proclist,
int *newproclistsize,
ompi_proc_t ***newproclist);
/**
* Refresh the OMPI process subsystem

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

@ -16,7 +16,7 @@
* Copyright (c) 2006 University of Houston. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
*
* $COPYRIGHT$
*
@ -78,8 +78,7 @@
#include "ompi/mca/io/base/base.h"
#include "ompi/mca/pml/base/pml_base_bsend.h"
#include "ompi/runtime/params.h"
#include "ompi/mca/dpm/base/base.h"
#include "ompi/mca/pubsub/base/base.h"
#include "ompi/dpm/dpm.h"
#include "ompi/mpiext/mpiext.h"
#if OPAL_ENABLE_FT_CR == 1
@ -343,13 +342,8 @@ int ompi_mpi_finalize(void)
return ret;
}
/* finalize the pubsub functions */
if (OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_pubsub_base_framework) ) ) {
return ret;
}
/* finalize the DPM framework */
if ( OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_dpm_base_framework))) {
/* finalize the DPM subsystem */
if ( OMPI_SUCCESS != (ret = ompi_dpm_finalize())) {
return ret;
}

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

@ -17,7 +17,7 @@
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
* Copyright (c) 2012-2013 Inria. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
@ -89,8 +89,7 @@
#include "ompi/debuggers/debuggers.h"
#include "ompi/proc/proc.h"
#include "ompi/mca/pml/base/pml_base_bsend.h"
#include "ompi/mca/dpm/base/base.h"
#include "ompi/mca/pubsub/base/base.h"
#include "ompi/dpm/dpm.h"
#include "ompi/mpiext/mpiext.h"
#if OPAL_ENABLE_FT_CR == 1
@ -298,6 +297,19 @@ _process_name_compare(const opal_process_name_t p1, const opal_process_name_t p2
return ompi_rte_compare_name_fields(OMPI_RTE_CMP_ALL, o1, o2);
}
static int _convert_string_to_process_name(opal_process_name_t *name,
const char* name_string)
{
return ompi_rte_convert_string_to_process_name(name, name_string);
}
static int _convert_process_name_to_string(char** name_string,
const opal_process_name_t *name)
{
return ompi_rte_convert_process_name_to_string(name_string, name);
}
void ompi_mpi_thread_level(int requested, int *provided)
{
/**
@ -386,6 +398,8 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
/* Convince OPAL to use our naming scheme */
opal_process_name_print = _process_name_print_for_opal;
opal_compare_proc = _process_name_compare;
opal_convert_string_to_process_name = _convert_string_to_process_name;
opal_convert_process_name_to_string = _convert_process_name_to_string;
/* Register MCA variables */
if (OPAL_SUCCESS != (ret = ompi_register_mca_variables())) {
@ -492,7 +506,7 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
#if OMPI_ENABLE_THREAD_MULTIPLE
/* add this bitflag to the modex */
OPAL_MODEX_SEND_STRING(ret, PMIX_SYNC_REQD, PMIX_GLOBAL,
OPAL_MODEX_SEND_STRING(ret, OPAL_PMIX_GLOBAL,
"MPI_THREAD_LEVEL", &threadlevel_bf, sizeof(uint8_t));
if (OPAL_SUCCESS != ret) {
error = "ompi_mpi_init: modex send thread level";
@ -608,9 +622,9 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
/* exchange connection info - this function may also act as a barrier
* if data exchange is required. The modex occurs solely across procs
* in our job, so no proc array is passed. If a barrier is required,
* the "fence" function will perform it internally
* the "modex" function will perform it internally
*/
OPAL_FENCE(NULL, 0, NULL, NULL);
OPAL_MODEX(NULL, 1);
OPAL_TIMING_MNEXT((&tm,"time from modex to first barrier"));
@ -792,23 +806,9 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
goto error;
}
/* Setup the publish/subscribe (PUBSUB) framework */
if (OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_pubsub_base_framework, 0))) {
error = "mca_pubsub_base_open() failed";
goto error;
}
if (OMPI_SUCCESS != (ret = ompi_pubsub_base_select())) {
error = "ompi_pubsub_base_select() failed";
goto error;
}
/* Setup the dynamic process management (DPM) framework */
if (OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_dpm_base_framework, 0))) {
error = "ompi_dpm_base_open() failed";
goto error;
}
if (OMPI_SUCCESS != (ret = ompi_dpm_base_select())) {
error = "ompi_dpm_base_select() failed";
/* Setup the dynamic process management (DPM) subsystem */
if (OMPI_SUCCESS != (ret = ompi_dpm_init())) {
error = "ompi_dpm_init() failed";
goto error;
}
@ -843,8 +843,8 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
/* Check whether we have been spawned or not. We introduce that
at the very end, since we need collectives, datatypes, ptls
etc. up and running here.... */
if (OMPI_SUCCESS != (ret = ompi_dpm.dyn_init())) {
error = "ompi_comm_dyn_init() failed";
if (OMPI_SUCCESS != (ret = ompi_dpm_dyn_init())) {
error = "ompi_dpm_dyn_init() failed";
goto error;
}

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

@ -290,9 +290,8 @@ static inline void opal_hotel_checkout_and_return_occupant(opal_hotel_t *hotel,
hotel->unoccupied_rooms[hotel->last_unoccupied_room] = room_num;
}
else {
opal_output( 0, " OOPS there is no occupant in room_num %d", room_num);
*occupant = NULL;
}
}
/**
@ -309,6 +308,33 @@ static inline bool opal_hotel_is_empty (opal_hotel_t *hotel)
return false;
}
/**
* Access the occupant of a room, but leave them checked into their room.
*
* @param hotel Pointer to hotel (IN)
* @param room Room number to checkout (IN)
* @param void * occupant (OUT)
*
* This accessor function is typically used to cycle across the occupants
* to check for someone already present that matches a description.
*/
static inline void opal_hotel_knock(opal_hotel_t *hotel, int room_num, void **occupant)
{
opal_hotel_room_t *room;
/* Bozo check */
assert(room_num < hotel->num_rooms);
*occupant = NULL;
/* If there's an occupant in the room, have them come to the door */
room = &(hotel->rooms[room_num]);
if (OPAL_LIKELY(NULL != room->occupant)) {
opal_output (10, "occupant %p in room num %d responded to knock", room->occupant, room_num);
*occupant = room->occupant;
}
}
END_C_DECLS
#endif /* OPAL_HOTEL_H */

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

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
@ -50,8 +50,12 @@ int opal_dss_unload(opal_buffer_t *buffer, void **payload,
}
/* okay, we have something to provide - pass it back */
*payload = buffer->base_ptr;
*bytes_used = buffer->bytes_used;
*bytes_used = buffer->bytes_used - (buffer->unpack_ptr - buffer->base_ptr);
if (0 == (*bytes_used)) {
*payload = NULL;
} else {
*payload = buffer->unpack_ptr;
}
/* dereference everything in buffer */
buffer->base_ptr = NULL;

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

@ -79,7 +79,8 @@ enum {
OPAL_ERR_CONNECTION_FAILED = (OPAL_ERR_BASE - 49),
OPAL_ERR_AUTHENTICATION_FAILED = (OPAL_ERR_BASE - 50),
OPAL_ERR_COMM_FAILURE = (OPAL_ERR_BASE - 51),
OPAL_ERR_SERVER_NOT_AVAIL = (OPAL_ERR_BASE - 52)
OPAL_ERR_SERVER_NOT_AVAIL = (OPAL_ERR_BASE - 52),
OPAL_ERR_IN_PROCESS = (OPAL_ERR_BASE - 53)
};
#define OPAL_ERR_MAX (OPAL_ERR_BASE - 100)

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

@ -18,7 +18,7 @@
* Copyright (c) 2009-2012 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011-2015 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2012 Oak Ridge National Laboratory. All rights reserved
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Bull SAS. All rights reserved.
@ -451,7 +451,7 @@ static int btl_openib_modex_send(void)
}
/* All done -- send it! */
OPAL_MODEX_SEND(rc, PMIX_SYNC_REQD, PMIX_GLOBAL,
OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL,
&mca_btl_openib_component.super.btl_version,
message, msg_size);
free(message);

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

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2007 Voltaire All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$
@ -148,7 +148,7 @@ mca_btl_openib_proc_t* mca_btl_openib_proc_create(opal_proc_t* proc)
/* query for the peer address info */
OPAL_MODEX_RECV(rc, &mca_btl_openib_component.super.btl_version,
proc, &message, &msg_size);
&proc->proc_name, &message, &msg_size);
if (OPAL_SUCCESS != rc) {
BTL_VERBOSE(("[%s:%d] opal_modex_recv failed for peer %s",
__FILE__, __LINE__,

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

@ -11,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Bull SAS. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
@ -422,7 +422,7 @@ static mca_btl_base_module_t** mca_btl_portals4_component_init(int *num_btls,
ptl_process_ids[interface].rank,
ptl_process_ids[interface].phys.nid, ptl_process_ids[interface].phys.pid));
}
OPAL_MODEX_SEND(ret, PMIX_SYNC_REQD, PMIX_GLOBAL,
OPAL_MODEX_SEND(ret, OPAL_PMIX_GLOBAL,
&mca_btl_portals4_component.super.btl_version,
ptl_process_ids, mca_btl_portals4_component.num_btls * sizeof(ptl_process_t));
if (OPAL_SUCCESS != ret) {

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

@ -4,7 +4,7 @@
* reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -216,7 +216,7 @@ static int mca_btl_scif_modex_send (void)
memset(&modex, 0, sizeof(mca_btl_scif_modex_t));
modex.port_id = mca_btl_scif_module.port_id;
OPAL_MODEX_SEND(rc, PMIX_SYNC_REQD, PMIX_LOCAL,
OPAL_MODEX_SEND(rc, OPAL_PMIX_LOCAL,
&mca_btl_scif_component.super.btl_version,
&modex, sizeof (modex));
return rc;

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

@ -16,7 +16,7 @@
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2015 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
@ -917,7 +917,7 @@ static int mca_btl_tcp_component_exchange(void)
}
} /* end of for opal_ifbegin() */
} /* end of for tcp_num_btls */
OPAL_MODEX_SEND(rc, PMIX_SYNC_REQD, PMIX_GLOBAL,
OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL,
&mca_btl_tcp_component.super.btl_version,
addrs, xfer_size);
free(addrs);

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

@ -11,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
@ -133,7 +133,7 @@ mca_btl_tcp_proc_t* mca_btl_tcp_proc_create(opal_proc_t* proc)
/* lookup tcp parameters exported by this proc */
OPAL_MODEX_RECV(rc, &mca_btl_tcp_component.super.btl_version,
proc, (uint8_t**)&btl_proc->proc_addrs, &size);
&proc->proc_name, (uint8_t**)&btl_proc->proc_addrs, &size);
if(rc != OPAL_SUCCESS) {
if(OPAL_ERR_NOT_FOUND != rc)
BTL_ERROR(("opal_modex_recv: failed with return value=%d", rc));

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

@ -3,7 +3,7 @@
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2011 UT-Battelle, LLC. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -18,7 +18,7 @@
#include "btl_ugni_smsg.h"
#include "opal/include/opal/align.h"
#include "opal/mca/dstore/dstore.h"
#include "opal/mca/pmix/pmix.h"
#define INITIAL_GNI_EPS 10000
@ -289,11 +289,10 @@ static int
mca_btl_ugni_setup_mpools (mca_btl_ugni_module_t *ugni_module)
{
struct mca_mpool_base_resources_t mpool_resources;
unsigned int mbox_increment, nprocs;
unsigned int mbox_increment;
uint32_t nprocs, *u32;
const char *mpool_name;
int rc;
opal_list_t vals;
opal_value_t *kv;
rc = opal_pointer_array_init (&ugni_module->pending_smsg_frags_bb, 0,
1 << 30, 32768);
@ -302,16 +301,13 @@ mca_btl_ugni_setup_mpools (mca_btl_ugni_module_t *ugni_module)
}
/* determine how many procs are in the job (might want to check universe size here) */
OBJ_CONSTRUCT(&vals, opal_list_t);
if (OPAL_SUCCESS == opal_dstore.fetch(opal_dstore_internal, &OPAL_PROC_MY_NAME,
OPAL_DSTORE_UNIV_SIZE, &vals)) {
/* the number of procs in the job is in the uint32 field */
kv = (opal_value_t*)opal_list_get_first(&vals);
nprocs = kv->data.uint32;
} else {
u32 = &nprocs;
OPAL_MODEX_RECV_VALUE(rc, OPAL_PMIX_UNIV_SIZE, &OPAL_PROC_MY_NAME,
&u32, OPAL_UINT32);
if (OPAL_SUCCESS != rc) {
/* take a wild conservative guess */
nprocs = 512;
}
OPAL_LIST_DESTRUCT(&vals);
rc = mca_btl_ugni_smsg_setup (nprocs);
if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) {

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

@ -1,5 +1,6 @@
/*
* Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -41,7 +42,7 @@ void usnic_compat_modex_send(int *rc,
opal_btl_usnic_modex_t *modexes,
size_t size)
{
OPAL_MODEX_SEND(*rc, PMIX_SYNC_REQD, PMIX_REMOTE, component,
OPAL_MODEX_SEND(*rc, OPAL_PMIX_REMOTE, component,
modexes, size);
}
@ -770,25 +771,6 @@ opal_btl_usnic_put(struct mca_btl_base_module_t *base_module,
sfrag->sf_size = size;
sfrag->sf_ack_bytes_left = size;
/* JMS NOTE: This is currently broken, and is deactivated by
removing the MCA_BTL_FLAGS_PUT from .btl_flags in btl_module.c.
Overwriting the uf_local_seg values is not a good idea, and
doesn't do anything to actually send the data in the
progression past finish_put_or_send().
The proper fix is to change the plumbing here to eventually
call fi_sendv() with an iov[0] = the internal buffer that's
already allocated, and iov[1] = the user's buffer. The usnic
provider in fi_sendv() will be smart enough to figure out which
is more performance: memcpy'ing the 2 buffers together and
doing a single xfer down to the hardware, or actually doing a
SG list down to the hardware. */
opal_btl_usnic_frag_t *frag;
frag = &sfrag->sf_base;
frag->uf_local_seg[0].seg_len = size;

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

@ -15,7 +15,7 @@
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
@ -327,7 +327,7 @@ static int mca_btl_base_vader_modex_send (void)
}
#endif
OPAL_MODEX_SEND(rc, PMIX_SYNC_REQD, PMIX_LOCAL,
OPAL_MODEX_SEND(rc, OPAL_PMIX_LOCAL,
&mca_btl_vader_component.super.btl_version, &modex, modex_size);
return rc;

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

@ -14,7 +14,7 @@
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
@ -162,7 +162,8 @@ static int init_vader_endpoint (struct mca_btl_base_endpoint_t *ep, struct opal_
ep->peer_smp_rank = remote_rank;
if (remote_rank != MCA_BTL_VADER_LOCAL_RANK) {
OPAL_MODEX_RECV(rc, &component->super.btl_version, proc, (void **) &modex, &msg_size);
OPAL_MODEX_RECV(rc, &component->super.btl_version,
&proc->proc_name, (void **) &modex, &msg_size);
if (OPAL_SUCCESS != rc) {
return rc;
}

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

@ -3,7 +3,7 @@
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2011 UT-Battelle, LLC. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
@ -193,7 +193,7 @@ static int opal_common_ugni_send_modex (int my_cdm_id)
* new ranks started on the same nodes as the spawnee ranks, etc.
*/
OPAL_MODEX_SEND(rc, PMIX_ASYNC_RDY, PMIX_GLOBAL,
OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL,
&opal_common_ugni_component,
modex_msg, total_msg_size);

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

@ -3,7 +3,7 @@
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2011 UT-Battelle, LLC. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -34,7 +34,7 @@ int opal_common_ugni_endpoint_for_proc (opal_common_ugni_device_t *dev, opal_pro
/* Receive the modex */
OPAL_MODEX_RECV(rc, &opal_common_ugni_component,
peer_proc, (void **)&modex, &msg_size);
&peer_proc->proc_name, (void **)&modex, &msg_size);
if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) {
OPAL_OUTPUT((-1, "btl/ugni error receiving modex"));
return rc;

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

@ -1,32 +0,0 @@
#
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
AM_CPPFLAGS = $(LTDLINCL)
# main library setup
noinst_LTLIBRARIES = libmca_dstore.la
libmca_dstore_la_SOURCES =
# pkgdata setup
dist_opaldata_DATA =
# local files
headers = dstore.h dstore_types.h
libmca_dstore_la_SOURCES += $(headers)
# Conditionally install the header files
if WANT_INSTALL_HEADERS
opaldir = $(opalincludedir)/$(subdir)
nobase_opal_HEADERS = $(headers)
endif
include base/Makefile.am
distclean-local:
rm -f base/static-components.h

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

@ -1,20 +0,0 @@
#
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
dist_opaldata_DATA += base/help-dstore-base.txt
headers += \
base/base.h
libmca_dstore_la_SOURCES += \
base/dstore_base_frame.c \
base/dstore_base_select.c \
base/dstore_base_stubs.c

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

@ -1,131 +0,0 @@
/*
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*/
#ifndef MCA_DSTORE_BASE_H
#define MCA_DSTORE_BASE_H
#include "opal_config.h"
#include "opal/types.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/mca_base_framework.h"
#include "opal/mca/event/event.h"
#include "opal/class/opal_hash_table.h"
#include "opal/class/opal_list.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/dss/dss.h"
#include "opal/util/proc.h"
#include "opal/mca/dstore/dstore.h"
BEGIN_C_DECLS
OPAL_DECLSPEC extern mca_base_framework_t opal_dstore_base_framework;
/**
* Select a dstore module
*/
OPAL_DECLSPEC int opal_dstore_base_select(void);
/* DSTORE is an oddball framework in that it:
*
* has an active storage component that issues handle-specific
* modules. This is done to provide separate storage areas that
* are isolated from each other, and thus don't have to worry
* about overlapping keys
*
* a backfill module used to attempt to retrieve data that has
* been requested, but that the handle-specific storage module
* does not contain. This is used in situations where data has
* not been provided at startup, and we need to retrieve it
* solely on-demand
*/
typedef struct {
opal_dstore_base_component_t *storage_component;
opal_dstore_base_module_t *backfill_module;
opal_pointer_array_t handles; // array of open datastore handles
opal_list_t available_components;
} opal_dstore_base_t;
OPAL_DECLSPEC extern opal_dstore_base_t opal_dstore_base;
typedef struct {
opal_object_t super;
char *name;
opal_dstore_base_module_t *module;
opal_dstore_base_component_t *storage_component;
} opal_dstore_handle_t;
OBJ_CLASS_DECLARATION(opal_dstore_handle_t);
/**
* Data for a particular opal process
* The name association is maintained in the
* proc_data hash table.
*/
typedef struct {
/** Structure can be put on lists (including in hash tables) */
opal_list_item_t super;
bool loaded;
/* List of opal_value_t structures containing all data
received from this process, sorted by key. */
opal_list_t data;
} opal_dstore_proc_data_t;
OBJ_CLASS_DECLARATION(opal_dstore_proc_data_t);
/**
* Attribute structure to update tracker object
* (used in dstore sm component)
*/
typedef struct {
opal_list_item_t super;
uint32_t jobid;
char *connection_info;
} opal_dstore_attr_t;
OBJ_CLASS_DECLARATION(opal_dstore_attr_t);
typedef struct {
int32_t seg_index;
uint32_t offset;
int32_t data_size;
} meta_info;
#define META_OFFSET 65536
OPAL_DECLSPEC int opal_dstore_base_open(const char *name, char* desired_components, opal_list_t *attrs);
OPAL_DECLSPEC int opal_dstore_base_update(int dstorehandle, opal_list_t *attrs);
OPAL_DECLSPEC int opal_dstore_base_close(int dstorehandle);
OPAL_DECLSPEC int opal_dstore_base_store(int dstorehandle,
const opal_process_name_t *id,
opal_value_t *kv);
OPAL_DECLSPEC int opal_dstore_base_fetch(int dstorehandle,
const opal_process_name_t *id,
const char *key,
opal_list_t *kvs);
OPAL_DECLSPEC int opal_dstore_base_remove_data(int dstorehandle,
const opal_process_name_t *id,
const char *key);
OPAL_DECLSPEC int opal_dstore_base_get_handle(int dstorehandle, void **dhdl);
/* support */
OPAL_DECLSPEC opal_dstore_proc_data_t* opal_dstore_base_lookup_proc(opal_proc_table_t *jtable,
opal_process_name_t id, bool create);
OPAL_DECLSPEC opal_value_t* opal_dstore_base_lookup_keyval(opal_dstore_proc_data_t *proc_data,
const char *key);
END_C_DECLS
#endif

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

@ -1,150 +0,0 @@
/*
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "opal_config.h"
#include "opal/constants.h"
#include "opal/mca/mca.h"
#include "opal/util/output.h"
#include "opal/mca/base/base.h"
#include "opal/dss/dss_types.h"
#include "opal/mca/dstore/base/base.h"
/*
* The following file was created by configure. It contains extern
* dstorements and the definition of an array of pointers to each
* module's public mca_base_module_t struct.
*/
#include "opal/mca/dstore/base/static-components.h"
opal_dstore_base_API_t opal_dstore = {
opal_dstore_base_open,
opal_dstore_base_update,
opal_dstore_base_close,
opal_dstore_base_store,
opal_dstore_base_fetch,
opal_dstore_base_remove_data,
opal_dstore_base_get_handle
};
opal_dstore_base_t opal_dstore_base = {0};
int opal_dstore_internal = -1;
static int opal_dstore_base_frame_close(void)
{
opal_dstore_handle_t *hdl;
opal_list_item_t *item;
int i;
/* cycle across all the active dstore handles and let them cleanup - order
* doesn't matter in this case
*/
for (i=0; i < opal_dstore_base.handles.size; i++) {
if (NULL != (hdl = (opal_dstore_handle_t*)opal_pointer_array_get_item(&opal_dstore_base.handles, i))) {
OBJ_RELEASE(hdl);
}
}
OBJ_DESTRUCT(&opal_dstore_base.handles);
for (item = opal_list_remove_first(&opal_dstore_base.available_components);
NULL != item;
item = opal_list_remove_first(&opal_dstore_base.available_components)) {
OBJ_RELEASE(item);
}
OBJ_DESTRUCT(&opal_dstore_base.available_components);
/* let the backfill module finalize, should it wish to do so */
if (NULL != opal_dstore_base.backfill_module && NULL != opal_dstore_base.backfill_module->finalize) {
opal_dstore_base.backfill_module->finalize((struct opal_dstore_base_module_t*)opal_dstore_base.backfill_module);
}
return mca_base_framework_components_close(&opal_dstore_base_framework, NULL);
}
static int opal_dstore_base_frame_open(mca_base_open_flag_t flags)
{
OBJ_CONSTRUCT(&opal_dstore_base.handles, opal_pointer_array_t);
opal_pointer_array_init(&opal_dstore_base.handles, 5, INT_MAX, 1);
OBJ_CONSTRUCT(&opal_dstore_base.available_components, opal_list_t);
/* Open up all available components */
return mca_base_framework_components_open(&opal_dstore_base_framework, flags);
}
MCA_BASE_FRAMEWORK_DECLARE(opal, dstore, NULL, NULL,
opal_dstore_base_frame_open,
opal_dstore_base_frame_close,
mca_dstore_base_static_components, 0);
/*** CLASS INSTANCES ***/
static void hdl_con(opal_dstore_handle_t *p)
{
p->name = NULL;
p->module = NULL;
p->storage_component = NULL;
}
static void hdl_des(opal_dstore_handle_t *p)
{
opal_dstore_base_module_t *mod;
if (NULL != p->name) {
free(p->name);
}
if (NULL != p->module) {
mod = (opal_dstore_base_module_t*)p->module;
if (NULL != mod->finalize) {
mod->finalize((struct opal_dstore_base_module_t*)mod);
}
free(mod);
}
}
OBJ_CLASS_INSTANCE(opal_dstore_handle_t,
opal_object_t,
hdl_con, hdl_des);
static void proc_data_construct(opal_dstore_proc_data_t *ptr)
{
ptr->loaded = false;
OBJ_CONSTRUCT(&ptr->data, opal_list_t);
}
static void proc_data_destruct(opal_dstore_proc_data_t *ptr)
{
OPAL_LIST_DESTRUCT(&ptr->data);
}
OBJ_CLASS_INSTANCE(opal_dstore_proc_data_t,
opal_list_item_t,
proc_data_construct,
proc_data_destruct);
static void attr_construct(opal_dstore_attr_t *attr)
{
attr->connection_info = NULL;
}
static void attr_destruct(opal_dstore_attr_t *attr)
{
if (NULL != attr->connection_info) {
free(attr->connection_info);
}
}
OBJ_CLASS_INSTANCE(opal_dstore_attr_t,
opal_list_item_t,
attr_construct, attr_destruct);

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

@ -1,105 +0,0 @@
/*
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "opal_config.h"
#include "opal/constants.h"
#include "opal/class/opal_list.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h"
#include "opal/util/output.h"
#include "opal/mca/dstore/base/base.h"
static bool selected = false;
int
opal_dstore_base_select(void)
{
mca_base_component_list_item_t *cli, *copy_cli;
mca_base_component_t *cmp;
mca_base_module_t *md;
int priority, cmp_pri, mod_pri;
opal_dstore_base_module_t *mod=NULL;
opal_dstore_base_component_t *comp=NULL;
if (selected) {
/* ensure we don't do this twice */
return OPAL_SUCCESS;
}
selected = true;
/* Query all available components and ask if they have a module */
cmp_pri = -100000;
mod_pri = -100000;
OPAL_LIST_FOREACH(cli, &opal_dstore_base_framework.framework_components, mca_base_component_list_item_t) {
cmp = (mca_base_component_t*)cli->cli_component;
opal_output_verbose(5, opal_dstore_base_framework.framework_output,
"mca:dstore:select: checking available component %s",
cmp->mca_component_name);
/* If there's no query function, skip it */
if (NULL == cmp->mca_query_component) {
opal_output_verbose(5, opal_dstore_base_framework.framework_output,
"mca:dstore:select: Skipping component [%s]. It does not implement a query function",
cmp->mca_component_name );
continue;
}
/* Query the component */
opal_output_verbose(5, opal_dstore_base_framework.framework_output,
"mca:dstore:select: Querying component [%s]",
cmp->mca_component_name);
/* If the component reports failure, then skip component - however,
* it is okay to return a NULL module */
if (OPAL_SUCCESS != cmp->mca_query_component(&md, &priority)) {
opal_output_verbose(5, opal_dstore_base_framework.framework_output,
"mca:dstore:select: Skipping component [%s] - not available",
cmp->mca_component_name );
continue;
}
copy_cli = OBJ_NEW(mca_base_component_list_item_t);
if (NULL != copy_cli) {
copy_cli->cli_component = cmp;
opal_list_append(&opal_dstore_base.available_components, (opal_list_item_t *)copy_cli);
}
/* track the highest priority component that returned a NULL module - this
* will become our storage element */
if (NULL == md) {
if (0 < priority && priority > cmp_pri) {
comp = (opal_dstore_base_component_t*)cmp;
cmp_pri = priority;
}
} else {
/* track the highest priority module that was returned - this
* will become our backfill element */
if (priority > mod_pri) {
mod = (opal_dstore_base_module_t*)md;
mod_pri = priority;
}
}
}
if (NULL == comp) {
/* no components available - that's bad */
return OPAL_ERROR;
}
opal_dstore_base.storage_component = comp;
/* it's okay not to have a backfill module */
opal_dstore_base.backfill_module = mod;
return OPAL_SUCCESS;;
}

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

@ -1,276 +0,0 @@
/*
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2013-2015 Intel Inc. All rights reserved
* Copyright (c) 2014 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "opal_config.h"
#include "opal/constants.h"
#include "opal_stdint.h"
#include "opal/mca/mca.h"
#include "opal/util/argv.h"
#include "opal/util/error.h"
#include "opal/util/output.h"
#include "opal/mca/base/base.h"
#include "opal/dss/dss_types.h"
#include "opal/mca/dstore/base/base.h"
int opal_dstore_base_open(const char *name, char* desired_components, opal_list_t *attrs)
{
opal_dstore_handle_t *hdl;
int index;
opal_dstore_base_module_t *mod;
int i;
mca_base_component_list_item_t* cli;
char** tokens;
if (NULL != desired_components) {
tokens = opal_argv_split(desired_components, ',');
for (i = 0; NULL != tokens[i]; i++) {
OPAL_LIST_FOREACH(cli, &opal_dstore_base.available_components, mca_base_component_list_item_t) {
if (0 == strncmp(tokens[i], cli->cli_component->mca_component_name, strlen(tokens[i]))) {
if (NULL != ((opal_dstore_base_component_t*)cli->cli_component)->create_handle && NULL != (mod = ((opal_dstore_base_component_t*)cli->cli_component)->create_handle(attrs))) {
/* have our module, so create a new dstore_handle */
hdl = OBJ_NEW(opal_dstore_handle_t);
if (NULL != name) {
hdl->name = strdup(name);
}
hdl->module = mod;
hdl->storage_component = (opal_dstore_base_component_t*)cli->cli_component;
if (0 > (index = opal_pointer_array_add(&opal_dstore_base.handles, hdl))) {
OPAL_ERROR_LOG(index);
OBJ_RELEASE(hdl);
}
opal_argv_free(tokens);
opal_output_verbose(1, opal_dstore_base_framework.framework_output,
"Created handle for %s dstore to component %s",
(NULL == hdl->name) ? "NULL" : hdl->name,
cli->cli_component->mca_component_name);
return index;
}
}
}
}
opal_argv_free(tokens);
} else {
OPAL_LIST_FOREACH(cli, &opal_dstore_base.available_components, mca_base_component_list_item_t) {
if (NULL != ((opal_dstore_base_component_t*)cli->cli_component)->create_handle && NULL != (mod = ((opal_dstore_base_component_t*)cli->cli_component)->create_handle(attrs))) {
/* have our module, so create a new dstore_handle */
hdl = OBJ_NEW(opal_dstore_handle_t);
if (NULL != name) {
hdl->name = strdup(name);
}
hdl->module = mod;
hdl->storage_component = (opal_dstore_base_component_t*)cli->cli_component;
if (0 > (index = opal_pointer_array_add(&opal_dstore_base.handles, hdl))) {
OPAL_ERROR_LOG(index);
OBJ_RELEASE(hdl);
}
opal_output_verbose(1, opal_dstore_base_framework.framework_output,
"Created handle for %s dstore to component %s",
(NULL == hdl->name) ? "NULL" : hdl->name,
cli->cli_component->mca_component_name);
return index;
}
}
}
/* if we get here, then we were unable to create a module
* for this scope
*/
return OPAL_ERROR;
}
int opal_dstore_base_update(int dstorehandle, opal_list_t *attrs)
{
int rc;
opal_dstore_handle_t *hdl;
if (dstorehandle < 0) {
return OPAL_ERR_NOT_INITIALIZED;
}
if (NULL == (hdl = (opal_dstore_handle_t*)opal_pointer_array_get_item(&opal_dstore_base.handles, dstorehandle))) {
OPAL_ERROR_LOG(OPAL_ERR_NOT_FOUND);
return OPAL_ERR_NOT_FOUND;
}
if (NULL == hdl->storage_component->update_handle) {
return OPAL_SUCCESS;
}
if (OPAL_SUCCESS != (rc = hdl->storage_component->update_handle(dstorehandle, attrs))) {
OPAL_ERROR_LOG(rc);
}
return rc;
}
int opal_dstore_base_close(int dstorehandle)
{
opal_dstore_handle_t *hdl;
int i;
/* if the handle is -1, then close all handles */
if (dstorehandle < 0) {
for (i=0; i < opal_dstore_base.handles.size; i++) {
if (NULL != (hdl = (opal_dstore_handle_t*)opal_pointer_array_get_item(&opal_dstore_base.handles, i))) {
OBJ_RELEASE(hdl);
opal_pointer_array_set_item(&opal_dstore_base.handles, i, NULL);
}
}
return OPAL_SUCCESS;
}
/* get the datastore handle */
if (NULL == (hdl = (opal_dstore_handle_t*)opal_pointer_array_get_item(&opal_dstore_base.handles, dstorehandle))) {
return OPAL_ERR_NOT_FOUND;
}
opal_pointer_array_set_item(&opal_dstore_base.handles, dstorehandle, NULL);
/* release the handle - this will also finalize and free the module */
OBJ_RELEASE(hdl);
return OPAL_SUCCESS;
}
int opal_dstore_base_store(int dstorehandle,
const opal_process_name_t *id,
opal_value_t *kv)
{
opal_dstore_handle_t *hdl;
if (dstorehandle < 0) {
return OPAL_ERR_NOT_INITIALIZED;
}
if (NULL == (hdl = (opal_dstore_handle_t*)opal_pointer_array_get_item(&opal_dstore_base.handles, dstorehandle))) {
OPAL_ERROR_LOG(OPAL_ERR_NOT_FOUND);
return OPAL_ERR_NOT_FOUND;
}
opal_output_verbose(1, opal_dstore_base_framework.framework_output,
"storing data in %s dstore", (NULL == hdl->name) ? "NULL" : hdl->name);
return hdl->module->store((struct opal_dstore_base_module_t*)hdl->module, id, kv);
}
int opal_dstore_base_fetch(int dstorehandle,
const opal_process_name_t *id,
const char *key,
opal_list_t *kvs)
{
opal_dstore_handle_t *hdl;
int rc;
if (dstorehandle < 0) {
return OPAL_ERR_NOT_INITIALIZED;
}
if (NULL == (hdl = (opal_dstore_handle_t*)opal_pointer_array_get_item(&opal_dstore_base.handles, dstorehandle))) {
OPAL_ERROR_LOG(OPAL_ERR_NOT_FOUND);
return OPAL_ERR_NOT_FOUND;
}
opal_output_verbose(1, opal_dstore_base_framework.framework_output,
"fetching data from %s dstore", (NULL == hdl->name) ? "NULL" : hdl->name);
if (OPAL_SUCCESS == (rc = hdl->module->fetch((struct opal_dstore_base_module_t*)hdl->module, id, key, kvs))) {
/* found the data, so we can just return it */
return rc;
}
/* if the storage module didn't find it, then let the backfill module try
* to retrieve it if we have one */
if (NULL != opal_dstore_base.backfill_module) {
rc = opal_dstore_base.backfill_module->fetch((struct opal_dstore_base_module_t*)opal_dstore_base.backfill_module, id, key, kvs);
}
return rc;
}
int opal_dstore_base_remove_data(int dstorehandle,
const opal_process_name_t *id,
const char *key)
{
opal_dstore_handle_t *hdl;
if (dstorehandle < 0) {
return OPAL_ERR_NOT_INITIALIZED;
}
if (NULL == (hdl = (opal_dstore_handle_t*)opal_pointer_array_get_item(&opal_dstore_base.handles, dstorehandle))) {
OPAL_ERROR_LOG(OPAL_ERR_NOT_FOUND);
return OPAL_ERR_NOT_FOUND;
}
opal_output_verbose(1, opal_dstore_base_framework.framework_output,
"removing data from %s dstore", (NULL == hdl->name) ? "NULL" : hdl->name);
return hdl->module->remove((struct opal_dstore_base_module_t*)hdl->module, id, key);
}
int opal_dstore_base_get_handle(int dstorehandle, void **dhdl)
{
opal_dstore_handle_t *hdl;
if (NULL == (hdl = (opal_dstore_handle_t*)opal_pointer_array_get_item(&opal_dstore_base.handles, dstorehandle))) {
OPAL_ERROR_LOG(OPAL_ERR_NOT_FOUND);
return OPAL_ERR_NOT_FOUND;
}
*dhdl = (void*)hdl;
return OPAL_SUCCESS;
}
/**
* Find data for a given key in a given proc_data_t
* container.
*/
opal_value_t* opal_dstore_base_lookup_keyval(opal_dstore_proc_data_t *proc_data,
const char *key)
{
opal_value_t *kv;
OPAL_LIST_FOREACH(kv, &proc_data->data, opal_value_t) {
if (0 == strcmp(key, kv->key)) {
return kv;
}
}
return NULL;
}
/**
* Find proc_data_t container associated with given
* opal_process_name_t.
*/
opal_dstore_proc_data_t* opal_dstore_base_lookup_proc(opal_proc_table_t *ptable,
opal_process_name_t id, bool create)
{
opal_dstore_proc_data_t *proc_data = NULL;
opal_proc_table_get_value(ptable, id, (void**)&proc_data);
if (NULL == proc_data && create) {
proc_data = OBJ_NEW(opal_dstore_proc_data_t);
if (NULL == proc_data) {
opal_output(0, "dstore:hash:lookup_opal_proc: unable to allocate proc_data_t\n");
return NULL;
}
opal_proc_table_set_value(ptable, id, proc_data);
}
return proc_data;
}

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

@ -1,19 +0,0 @@
-*- text -*-
#
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This is the US/English general help file for OPAL Errmgr HNP module.
#
[errmgr-hnp:unknown-job-error]
An error has occurred in an unknown job. This generally should not happen
except due to an internal OPAL error.
Job state: %s
This information should probably be repopald to the OMPI developers.

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

@ -1,7 +0,0 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: project
status: active

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

@ -1,222 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2014 Los Alamos National Security, Inc. All rights
* reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Database Framework - used for internal storage of
* information relating to modex and other OMPI operations
*
*/
#ifndef OPAL_DB_H
#define OPAL_DB_H
#include "opal_config.h"
#include "opal/types.h"
#include "opal/mca/mca.h"
#include "opal/mca/event/event.h"
#include "opal/dss/dss_types.h"
#include "opal/util/proc.h"
#include "opal/mca/dstore/dstore_types.h"
/**
* DATABASE DESIGN
*
* Each API function is treated as blocking.
*
*/
BEGIN_C_DECLS
/* declare a global handle until such time
* as someone figures out how to separate the various
* datastore channels
*/
OPAL_DECLSPEC extern int opal_dstore_peer;
OPAL_DECLSPEC extern int opal_dstore_internal;
OPAL_DECLSPEC extern int opal_dstore_nonpeer;
/**** DEFINE THE PUBLIC API'S ****/
/*
* Open a database
*
* Open a database for access. The name field is purely for
* debug purposes and has no implementation relevance.
* Just like the standard POSIX file open, the call will return
* a unique "handle" that must be provided with any subsequent
* call to store or fetch data from this database.
*
* The attributes parameter can be used to pass any desired
* optional directives to the active storage component. These
* are passed as a list of opal_value_t's.
*
* NOTE: calls to these APIs must be thread-protected as there
* is NO internal thread safety.
*/
typedef int (*opal_dstore_base_API_open_fn_t)(const char *name, char* desired_components,
opal_list_t *attributes);
/*
* Update an existing handle
*
* Sometimes an existing handle requires an update to its attributes, so
* provide an API for doing so
*/
typedef int (*opal_dstore_base_API_update_fn_t)(int dstorehandle,
opal_list_t *attributes);
/*
* Close a database handle
*
* Close the specified database handle. A -1 handle indicates
* that ALL open database handles are to be closed.
*/
typedef int (*opal_dstore_base_API_close_fn_t)(int dstorehandle);
/*
* Store a data value against the primary key - overwrites any data
* of matching key that is already present. The data is copied into the database
* and therefore does not need to be preserved by the caller.
*/
typedef int (*opal_dstore_base_API_store_fn_t)(int dstorehandle,
const opal_process_name_t *id,
opal_value_t *kv);
/*
* Retrieve data
*
* Retrieve data for the given primary key associated with the specified key. Wildcards
* are supported here as well. Caller is responsible for releasing the returned list
* of opal_value_t objects.
*/
typedef int (*opal_dstore_base_API_fetch_fn_t)(int dstorehandle,
const opal_process_name_t *id,
const char *key,
opal_list_t *kvs);
/*
* Delete data
*
* Delete the data for the given primary key that is associated with the specified key.
* If a NULL key is provided, all data for the given primary key will be deleted.
*/
typedef int (*opal_dstore_base_API_remove_fn_t)(int dstorehandle,
const opal_process_name_t *id,
const char *key);
/*
* Get active dstore handle
* Get dstore handle asocciated with the passed id.
*/
typedef int (*opal_dstore_base_API_get_handle_fn_t)(int dstorehandle, void **dhdl);
/*
* the standard public API data structure
*/
typedef struct {
opal_dstore_base_API_open_fn_t open;
opal_dstore_base_API_update_fn_t update;
opal_dstore_base_API_close_fn_t close;
opal_dstore_base_API_store_fn_t store;
opal_dstore_base_API_fetch_fn_t fetch;
opal_dstore_base_API_remove_fn_t remove;
opal_dstore_base_API_get_handle_fn_t get_handle;
} opal_dstore_base_API_t;
/**** DEFINE THE MODULE API'S ****/
/* Note that each datastore handle will be associated with
* a single active module. Thus, storing and fetching data
* from that module does not require that we pass in the
* handle itself.
*
* NOTE: the call to actually store/fetch data in a given
* datastore handle must be protected against threaded operations
* as there is NO thread protection inside the various modules.
*/
struct opal_dstore_base_module_t;
/*
* Initialize the module
*/
typedef int (*opal_dstore_base_module_init_fn_t)(struct opal_dstore_base_module_t *mod);
/*
* Finalize the module
*/
typedef void (*opal_dstore_base_module_finalize_fn_t)(struct opal_dstore_base_module_t *mod);
/* store the data in this module */
typedef int (*opal_dstore_base_module_store_fn_t)(struct opal_dstore_base_module_t *mod,
const opal_process_name_t *id,
opal_value_t *kv);
/* fetch data from the module */
typedef int (*opal_dstore_base_module_fetch_fn_t)(struct opal_dstore_base_module_t *mod,
const opal_process_name_t *id,
const char *key,
opal_list_t *kvs);
/* remove data */
typedef int (*opal_dstore_base_module_remove_fn_t)(struct opal_dstore_base_module_t *mod,
const opal_process_name_t *id,
const char *key);
/*
* the standard module data structure
*/
typedef struct {
opal_dstore_base_module_init_fn_t init;
opal_dstore_base_module_finalize_fn_t finalize;
opal_dstore_base_module_store_fn_t store;
opal_dstore_base_module_fetch_fn_t fetch;
opal_dstore_base_module_remove_fn_t remove;
} opal_dstore_base_module_t;
/*
* the component data structure
*/
/* create and return a datastore module */
typedef opal_dstore_base_module_t* (*mca_dstore_base_component_create_hdl_fn_t)(opal_list_t *attributes);
/* update an existing handle */
typedef int (*mca_dstore_base_component_update_hdl_fn_t)(int hdl, opal_list_t *attributes);
/* provide a chance for the component to finalize */
typedef void (*mca_dstore_base_component_finalize_fn_t)(void);
typedef struct {
mca_base_component_t base_version;
mca_base_component_data_t base_data;
mca_dstore_base_component_create_hdl_fn_t create_handle;
mca_dstore_base_component_update_hdl_fn_t update_handle;
mca_dstore_base_component_finalize_fn_t finalize;
} opal_dstore_base_component_t;
/*
* Macro for use in components that are of type dstore
*/
#define OPAL_DSTORE_BASE_VERSION_2_0_0 \
OPAL_MCA_BASE_VERSION_2_1_0("dstore", 2, 0, 0)
/* Global structure for accessing store functions */
OPAL_DECLSPEC extern opal_dstore_base_API_t opal_dstore; /* holds base function pointers */
END_C_DECLS
#endif

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

@ -1,66 +0,0 @@
/*
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The OPAL Database Framework
*
*/
#ifndef OPAL_DSTORE_TYPES_H
#define OPAL_DSTORE_TYPES_H
#include "opal_config.h"
#include "opal/types.h"
#include "opal/dss/dss_types.h"
#include "opal/mca/pmix/pmix.h"
BEGIN_C_DECLS
/* some values are provided by an external entity such
* as the resource manager. These values enter the
* system via the PMIx interface at startup, but are
* not explicitly retrieved by processes. Instead, procs
* access them after RTE-init has stored them. For ease-of-use,
* we define equivalent dstore names here. PMIx attributes
* not listed here should be directly accessed via the
* OPAL pmix framework */
#define OPAL_DSTORE_CPUSET PMIX_CPUSET
#define OPAL_DSTORE_CREDENTIAL PMIX_CREDENTIAL
#define OPAL_DSTORE_TMPDIR PMIX_TMPDIR
#define OPAL_DSTORE_JOBID PMIX_JOBID
#define OPAL_DSTORE_APPNUM PMIX_APPNUM
#define OPAL_DSTORE_RANK PMIX_RANK
#define OPAL_DSTORE_GLOBAL_RANK PMIX_GLOBAL_RANK
#define OPAL_DSTORE_LOCALRANK PMIX_LOCAL_RANK
#define OPAL_DSTORE_NODERANK PMIX_NODE_RANK
#define OPAL_DSTORE_LOCALLDR PMIX_LOCALLDR
#define OPAL_DSTORE_APPLDR PMIX_APPLDR
#define OPAL_DSTORE_LOCAL_PEERS PMIX_LOCAL_PEERS
#define OPAL_DSTORE_UNIV_SIZE PMIX_UNIV_SIZE
#define OPAL_DSTORE_JOB_SIZE PMIX_JOB_SIZE
#define OPAL_DSTORE_LOCAL_SIZE PMIX_LOCAL_SIZE
#define OPAL_DSTORE_NODE_SIZE PMIX_NODE_SIZE
#define OPAL_DSTORE_MAX_PROCS PMIX_MAX_PROCS
#define OPAL_DSTORE_NPROC_OFFSET PMIX_NPROC_OFFSET
#define OPAL_DSTORE_HOSTNAME PMIX_HOSTNAME
#define OPAL_DSTORE_NODEID PMIX_NODE_ID
/* some OPAL-appropriate key definitions */
#define OPAL_DSTORE_LOCALITY "opal.locality" // (uint16_t) relative locality of a peer
/* proc-specific scratch dirs */
#define OPAL_DSTORE_JOB_SDIR "opal.job.session.dir" // (char*) job-level session dir
#define OPAL_DSTORE_MY_SDIR "opal.my.session.dir" // (char*) session dir for this proc
#define OPAL_DSTORE_URI "opal.uri" // (char*) uri of specified proc
#define OPAL_DSTORE_ARCH "opal.arch" // (uint32_t) arch for specified proc
END_C_DECLS
#endif

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

@ -1,36 +0,0 @@
#
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
sources = \
dstore_hash.h \
dstore_hash_component.c \
dstore_hash.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_dstore_hash_DSO
component_noinst =
component_install = mca_dstore_hash.la
else
component_noinst = libmca_dstore_hash.la
component_install =
endif
mcacomponentdir = $(opallibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_dstore_hash_la_SOURCES = $(sources)
mca_dstore_hash_la_LDFLAGS = -module -avoid-version
mca_dstore_hash_la_LIBADD = $(dstore_hash_LIBS)
noinst_LTLIBRARIES = $(component_noinst)
libmca_dstore_hash_la_SOURCES =$(sources)
libmca_dstore_hash_la_LDFLAGS = -module -avoid-version

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

@ -1,33 +0,0 @@
/*
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef OPAL_DSTORE_HASH_H
#define OPAL_DSTORE_HASH_H
#include "opal/class/opal_hash_table.h"
#include "opal/mca/dstore/dstore.h"
BEGIN_C_DECLS
OPAL_MODULE_DECLSPEC extern opal_dstore_base_component_t mca_dstore_hash_component;
typedef struct {
opal_dstore_base_module_t api;
opal_proc_table_t ptable;
} mca_dstore_hash_module_t;
OPAL_MODULE_DECLSPEC extern mca_dstore_hash_module_t opal_dstore_hash_module;
END_C_DECLS
#endif /* OPAL_DSTORE_HASH_H */

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

@ -1,84 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
* Copyright (c) 2015 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 "opal_config.h"
#include "opal/constants.h"
#include "opal/mca/base/base.h"
#include "opal/util/error.h"
#include "opal/mca/dstore/dstore.h"
#include "opal/mca/dstore/base/base.h"
#include "dstore_hash.h"
static opal_dstore_base_module_t *component_create(opal_list_t *attrs);
static int dstore_hash_query(mca_base_module_t **module, int *priority);
/*
* Instantiate the public struct with all of our public information
* and pointers to our public functions in it
*/
opal_dstore_base_component_t mca_dstore_hash_component = {
.base_version = {
OPAL_DSTORE_BASE_VERSION_2_0_0,
/* Component name and version */
.mca_component_name = "hash",
MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION),
/* Component open and close functions */
.mca_query_component = dstore_hash_query,
},
.base_data = {
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
.create_handle = component_create,
};
static int dstore_hash_query(mca_base_module_t **module, int *priority)
{
/* we are always available, but only as storage */
*priority = 80;
*module = NULL;
return OPAL_SUCCESS;
}
/* this component ignores any input attributes */
static opal_dstore_base_module_t *component_create(opal_list_t *attrs)
{
mca_dstore_hash_module_t *mod;
mod = (mca_dstore_hash_module_t*)malloc(sizeof(mca_dstore_hash_module_t));
if (NULL == mod) {
OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE);
return NULL;
}
/* copy the APIs across */
memcpy(mod, &opal_dstore_hash_module.api, sizeof(opal_dstore_base_module_t));
/* let the module init itself */
if (OPAL_SUCCESS != mod->api.init((struct opal_dstore_base_module_t*)mod)) {
/* release the module and return the error */
free(mod);
return NULL;
}
return (opal_dstore_base_module_t*)mod;
}

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

@ -1,7 +0,0 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: project
status: active

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

@ -17,7 +17,7 @@ libmca_pmix_la_SOURCES =
dist_opaldata_DATA =
# local files
headers = pmix.h
headers = pmix.h pmix_types.h pmix_server.h
libmca_pmix_la_SOURCES += $(headers)
# Conditionally install the header files

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