1
1
openmpi/opal/util/proc.c
Ralph Castain aec5cd08bd Per the PMIx RFC:
WHAT:    Merge the PMIx branch into the devel repo, creating a new
               OPAL “lmix” framework to abstract PMI support for all RTEs.
               Replace the ORTE daemon-level collectives with a new PMIx
               server and update the ORTE grpcomm framework to support
               server-to-server collectives

WHY:      We’ve had problems dealing with variations in PMI implementations,
               and need to extend the existing PMI definitions to meet exascale
               requirements.

WHEN:   Mon, Aug 25

WHERE:  https://github.com/rhc54/ompi-svn-mirror.git

Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.

All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.

Accordingly, we have:

* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.

* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.

* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint

* removed the prior OMPI/OPAL modex code

* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.

* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand

This commit was SVN r32570.
2014-08-21 18:56:47 +00:00

123 строки
3.4 KiB
C

/*
* Copyright (c) 2013 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2013 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "proc.h"
#include "opal/util/proc.h"
#include "opal/util/arch.h"
#include "opal/mca/dstore/dstore.h"
#include "opal/mca/pmix/pmix.h"
opal_process_info_t opal_process_info = {
.nodename = "not yet named",
.job_session_dir = "not yet defined",
.proc_session_dir = "not yet defined",
.num_local_peers = 1, /* I'm the only process around here */
.my_local_rank = 0, /* I'm the only process around here */
#if OPAL_HAVE_HWLOC
.cpuset = NULL,
#endif
};
static opal_proc_t opal_local_proc = {
{ .opal_list_next = NULL,
.opal_list_prev = NULL},
OPAL_NAME_INVALID,
0,
0,
NULL,
"localhost - unnamed"
};
static opal_proc_t* opal_proc_my_name = &opal_local_proc;
static void opal_proc_construct(opal_proc_t* proc)
{
proc->proc_arch = opal_local_arch;
proc->proc_convertor = NULL;
proc->proc_flags = 0;
proc->proc_name = 0;
}
static void opal_proc_destruct(opal_proc_t* proc)
{
proc->proc_flags = 0;
proc->proc_name = 0;
proc->proc_hostname = NULL;
proc->proc_convertor = NULL;
}
OBJ_CLASS_INSTANCE(opal_proc_t, opal_list_item_t,
opal_proc_construct, opal_proc_destruct);
static int
opal_compare_opal_procs(const opal_process_name_t proc1,
const opal_process_name_t proc2)
{
if( proc1 == proc2 ) return 0;
if( proc1 < proc2 ) return -1;
return 1;
}
opal_compare_proc_fct_t opal_compare_proc = opal_compare_opal_procs;
opal_proc_t* opal_proc_local_get(void)
{
return opal_proc_my_name;
}
int opal_proc_local_set(opal_proc_t* proc)
{
if( proc != opal_proc_my_name ) {
if( NULL != proc )
OBJ_RETAIN(proc);
if( &opal_local_proc != opal_proc_my_name )
OBJ_RELEASE(opal_proc_my_name);
if( NULL != proc ) {
opal_proc_my_name = proc;
} else {
opal_proc_my_name = &opal_local_proc;
}
}
return OPAL_SUCCESS;
}
/* this function is used to temporarily set the local
* name while OPAL and upper layers are initializing,
* thus allowing debug messages to be more easily
* understood */
void opal_proc_set_name(opal_process_name_t *name)
{
opal_local_proc.proc_name = *name;
}
/**
* The following functions are surrogates for the RTE functionality, and are not supposed
* to be called. Instead, the corresponding function pointer should be set by the upper layer
* before the call to opal_init, to make them point to the correct accessors based on the
* underlying RTE.
*/
static char*
opal_process_name_print_should_never_be_called(const opal_process_name_t procname)
{
return "My Name is Nobody";
}
static uint32_t
opal_process_name_vpid_should_never_be_called(const opal_process_name_t unused)
{
return UINT_MAX;
}
char* (*opal_process_name_print)(const opal_process_name_t) = opal_process_name_print_should_never_be_called;
uint32_t (*opal_process_name_vpid)(const opal_process_name_t) = opal_process_name_vpid_should_never_be_called;
uint32_t (*opal_process_name_jobid)(const opal_process_name_t) = opal_process_name_vpid_should_never_be_called;