1
1

Per the RFC, extend the current use of the ompi_proc_t flags field (without changing the field itself).

The prior ompi_proc_t structure had a uint8_t flag field in it, where only one
bit was used to flag that a proc was "local". In that context, "local" was
constrained to mean "local to this node".

This commit provides a greater degree of granularity on the term "local", to include tests
to see if the proc is on the same socket, PC board, node, switch, CU (computing
unit), and cluster.

Add #define's to designate which bits stand for which local condition. This
was added to the OPAL layer to avoid conflicting with the proposed movement of
the BTLs. To make it easier to use, a set of macros have been defined - e.g.,
OPAL_PROC_ON_LOCAL_SOCKET - that test the specific bit. These can be used in
the code base to clearly indicate which sense of locality is being considered.

All locations in the code base that looked at the current proc_t field have
been changed to use the new macros.

Also modify the orte_ess modules so that each returns a uint8_t (to match the
ompi_proc_t field) that contains a complete description of the locality of this
proc. Obviously, not all environments will be capable of providing such detailed
info. Thus, getting a "false" from a test for "on_local_socket" may simply
indicate a lack of knowledge.

This commit was SVN r20496.
Этот коммит содержится в:
Ralph Castain 2009-02-10 02:20:16 +00:00
родитель 42df4b2102
Коммит 4cdf91a8d4
22 изменённых файлов: 106 добавлений и 86 удалений

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

@ -53,7 +53,7 @@ int mca_btl_mx_add_procs( struct mca_btl_base_module_t* btl,
* other processes on the same node. The BTL self and sm are
* supposed to take care of such communications.
*/
if( ompi_procs[i]->proc_flags & OMPI_PROC_FLAG_LOCAL ) {
if( OPAL_PROC_ON_LOCAL_NODE(ompi_procs[i]->proc_flags) ) {
if( ompi_procs[i] == ompi_proc_local_proc ) {
if( 0 == mca_btl_mx_component.mx_support_self )
continue;

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

@ -347,7 +347,7 @@ int mca_btl_openib_add_procs(
we'll just mark any local peer on an iWARP NIC as
unreachable. See trac ticket #1352. */
if (IBV_TRANSPORT_IWARP == openib_btl->device->ib_dev->transport_type &&
0 != (ompi_proc->proc_flags && OMPI_PROC_FLAG_LOCAL)) {
!OPAL_PROC_ON_LOCAL_NODE(ompi_proc->proc_flags)) {
continue;
}
#endif

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

@ -446,7 +446,7 @@ int mca_btl_sm_add_procs(
/* check to see if this proc can be reached via shmem (i.e.,
if they're on my local host and in my job) */
if (procs[proc]->proc_name.jobid != my_proc->proc_name.jobid ||
0 == (procs[proc]->proc_flags & OMPI_PROC_FLAG_LOCAL)) {
OPAL_PROC_ON_LOCAL_NODE(procs[proc]->proc_flags)) {
peers[proc] = NULL;
continue;
}

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

@ -533,7 +533,7 @@ mca_coll_hierarch_checkfor_sm ( struct ompi_communicator_t *comm, int *color, i
procs = comm->c_local_group->grp_proc_pointers;
for ( i = 0 ; i < size ; i++) {
if ( procs[i]->proc_name.jobid == my_proc->proc_name.jobid &&
( (procs[i]->proc_flags & OMPI_PROC_FLAG_LOCAL)) ) {
( OPAL_PROC_ON_LOCAL_NODE(procs[i]->proc_flags)) ) {
lncount++;
if ( *color == -1){
*color = i;

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

@ -492,7 +492,7 @@ static bool have_local_peers(ompi_group_t *group, size_t size)
for (i = 0; i < size; ++i) {
proc = ompi_group_peer_lookup(group,i);
if (0 == (proc->proc_flags & OMPI_PROC_FLAG_LOCAL)) {
if (OPAL_PROC_ON_LOCAL_NODE(proc->proc_flags)) {
return false;
}
}

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

@ -180,7 +180,7 @@ static bool have_local_peers(ompi_group_t *group, size_t size)
for (i = 0; i < size; ++i) {
proc = ompi_group_peer_lookup(group,i);
if (0 == (proc->proc_flags & OMPI_PROC_FLAG_LOCAL)) {
if (OPAL_PROC_ON_LOCAL_NODE(proc->proc_flags)) {
return false;
}
}

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

@ -131,7 +131,7 @@ mca_common_sm_mmap_t* mca_common_sm_mmap_init(size_t size, char *file_name,
procs = ompi_proc_world(&n_total_procs);
for(p=0; p < n_total_procs; p++) {
if(procs[p]->proc_flags & OMPI_PROC_FLAG_LOCAL) {
if(OPAL_PROC_ON_LOCAL_NODE(procs[p]->proc_flags)) {
procs[n_local_procs++] = procs[p];
}
}

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

@ -181,7 +181,7 @@ static mca_mpool_base_module_t* mca_mpool_sm_init(
spawned ones) are to talk using shared memory */
procs = ompi_proc_world(&num_all_procs);
for (i = 0 ; i < num_all_procs ; ++i) {
if (procs[i]->proc_flags & OMPI_PROC_FLAG_LOCAL) {
if (OPAL_PROC_ON_LOCAL_NODE(procs[i]->proc_flags)) {
num_local_procs++;
}
}

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

@ -108,14 +108,13 @@ int ompi_proc_init(void)
proc->proc_name.vpid = i;
if (i == ORTE_PROC_MY_NAME->vpid) {
ompi_proc_local_proc = proc;
proc->proc_flags |= OMPI_PROC_FLAG_LOCAL;
proc->proc_flags = OPAL_PROC_ALL_LOCAL;
proc->proc_hostname = orte_process_info.nodename;
proc->proc_arch = orte_process_info.arch;
} else {
if (orte_ess.proc_is_local(&proc->proc_name)) {
/* flag all local procs */
proc->proc_flags |= OMPI_PROC_FLAG_LOCAL;
}
/* get the locality information */
proc->proc_flags = orte_ess.proc_get_locality(&proc->proc_name);
/* get the name of the node it is on */
proc->proc_hostname = orte_ess.proc_get_hostname(&proc->proc_name);
}
}
@ -354,13 +353,11 @@ int ompi_proc_refresh(void) {
if (i == ORTE_PROC_MY_NAME->vpid) {
ompi_proc_local_proc = proc;
proc->proc_flags |= OMPI_PROC_FLAG_LOCAL;
proc->proc_flags = OPAL_PROC_ALL_LOCAL;
proc->proc_hostname = orte_process_info.nodename;
proc->proc_arch = orte_process_info.arch;
} else {
if (orte_ess.proc_is_local(&proc->proc_name)) {
proc->proc_flags |= OMPI_PROC_FLAG_LOCAL;
}
proc->proc_flags = orte_ess.proc_get_locality(&proc->proc_name);
proc->proc_hostname = orte_ess.proc_get_hostname(&proc->proc_name);
proc->proc_arch = orte_ess.proc_get_arch(&proc->proc_name);
/* if arch is different than mine, create a new convertor for this proc */
@ -552,7 +549,7 @@ ompi_proc_unpack(opal_buffer_t* buf,
#endif
}
if (0 == strcmp(ompi_proc_local_proc->proc_hostname,new_hostname)) {
plist[i]->proc_flags |= OMPI_PROC_FLAG_LOCAL;
plist[i]->proc_flags |= (OPAL_PROC_ON_NODE | OPAL_PROC_ON_CU | OPAL_PROC_ON_CLUSTER);
}
/* Save the hostname */

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

@ -35,6 +35,7 @@
#include "opal/class/opal_list.h"
#include "opal/threads/mutex.h"
#include "opal/dss/dss_types.h"
#include "opal/mca/paffinity/paffinity.h"
#include "orte/runtime/orte_globals.h"
@ -90,13 +91,6 @@ OMPI_DECLSPEC extern ompi_proc_t* ompi_proc_local_proc;
/* ******************************************************************** */
/** Process is on the same node as the local process */
#define OMPI_PROC_FLAG_LOCAL 0x01
/* ******************************************************************** */
/**
* Initialize the OMPI process subsystem
*

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

@ -90,6 +90,27 @@
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
/* ******************************************************************** */
/** Process locality definitions */
#define OPAL_PROC_ON_CLUSTER 0x10
#define OPAL_PROC_ON_CU 0x08
#define OPAL_PROC_ON_NODE 0x04
#define OPAL_PROC_ON_BOARD 0x02
#define OPAL_PROC_ON_SOCKET 0x01
#define OPAL_PROC_NON_LOCAL 0x00
#define OPAL_PROC_ALL_LOCAL 0x1f
/** Process locality macros */
#define OPAL_PROC_ON_LOCAL_SOCKET(n) ((n) & OPAL_PROC_ON_SOCKET)
#define OPAL_PROC_ON_LOCAL_BOARD(n) ((n) & OPAL_PROC_ON_BOARD)
#define OPAL_PROC_ON_LOCAL_NODE(n) ((n) & OPAL_PROC_ON_NODE)
#define OPAL_PROC_ON_LOCAL_CU(n) ((n) & OPAL_PROC_ON_CU)
#define OPAL_PROC_ON_LOCAL_CLUSTER(n) ((n) & OPAL_PROC_ON_CLUSTER)
/* ******************************************************************** */
/**
* Buffer type for paffinity processor masks.
* Copied almost directly from PLPA.

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

@ -25,6 +25,7 @@
#include "orte/util/show_help.h"
#include "opal/util/argv.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/mca/paffinity/paffinity.h"
#include "orte/util/proc_info.h"
#include "orte/mca/errmgr/base/base.h"
@ -40,7 +41,7 @@ static int alps_set_name(void);
static int rte_init(char flags);
static int rte_finalize(void);
static bool proc_is_local(orte_process_name_t *proc);
static uint8_t proc_get_locality(orte_process_name_t *proc);
static orte_vpid_t proc_get_daemon(orte_process_name_t *proc);
static char* proc_get_hostname(orte_process_name_t *proc);
static uint32_t proc_get_arch(orte_process_name_t *proc);
@ -54,7 +55,7 @@ orte_ess_base_module_t orte_ess_alps_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
proc_is_local,
proc_get_locality,
proc_get_daemon,
proc_get_hostname,
proc_get_arch,
@ -159,21 +160,21 @@ static int rte_finalize(void)
return ret;
}
static bool proc_is_local(orte_process_name_t *proc)
static uint8_t proc_get_locality(orte_process_name_t *proc)
{
orte_nid_t *nid;
if (NULL == (nid = orte_util_lookup_nid(proc))) {
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
return false;
return OPAL_PROC_NON_LOCAL;
}
if (nid->daemon == ORTE_PROC_MY_DAEMON->vpid) {
OPAL_OUTPUT_VERBOSE((2, orte_ess_base_output,
"%s ess:alps: proc %s is LOCAL",
"%s ess:alps: proc %s on LOCAL NODE",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return true;
return (OPAL_PROC_ON_NODE | OPAL_PROC_ON_CU | OPAL_PROC_ON_CLUSTER);
}
OPAL_OUTPUT_VERBOSE((2, orte_ess_base_output,
@ -181,7 +182,7 @@ static bool proc_is_local(orte_process_name_t *proc)
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return false;
return OPAL_PROC_NON_LOCAL;
}

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

@ -22,6 +22,8 @@
#include <catamount/cnos_mpi_os.h>
#include "opal/mca/paffinity/paffinity.h"
#include "orte/util/show_help.h"
#include "orte/mca/errmgr/base/base.h"
@ -38,7 +40,7 @@
static int rte_init(char flags);
static int rte_finalize(void);
static void rte_abort(int status, bool report) __opal_attribute_noreturn__;
static bool proc_is_local(orte_process_name_t *proc);
static uint8_t proc_get_locality(orte_process_name_t *proc);
static char* proc_get_hostname(orte_process_name_t *proc);
static uint32_t proc_get_arch(orte_process_name_t *proc);
static orte_local_rank_t proc_get_local_rank(orte_process_name_t *proc);
@ -49,7 +51,7 @@ orte_ess_base_module_t orte_ess_cnos_module = {
rte_init,
rte_finalize,
rte_abort,
proc_is_local,
proc_get_locality,
NULL, /* proc_get_daemon is only used in ORTE */
proc_get_hostname,
proc_get_arch,
@ -124,14 +126,14 @@ static void rte_abort(int status, bool report)
exit(status);
}
static bool proc_is_local(orte_process_name_t *proc)
static uint8_t proc_get_locality(orte_process_name_t *proc)
{
if (map[ORTE_PROC_MY_NAME->vpid].nid ==
map[proc->vpid].nid) {
return true;
return (OPAL_PROC_ON_NODE | OPAL_PROC_ON_CU | OPAL_PROC_ON_CLUSTER);
}
return false;
return OPAL_PROC_NON_LOCAL;
}
static char* proc_get_hostname(orte_process_name_t *proc)

15
orte/mca/ess/env/ess_env_module.c поставляемый
Просмотреть файл

@ -34,6 +34,7 @@
#include "opal/runtime/opal.h"
#include "opal/runtime/opal_cr.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/mca/paffinity/paffinity.h"
#include "orte/util/show_help.h"
#include "opal/mca/mca.h"
@ -81,7 +82,7 @@ static int env_set_name(void);
static int rte_init(char flags);
static int rte_finalize(void);
static bool proc_is_local(orte_process_name_t *proc);
static uint8_t proc_get_locality(orte_process_name_t *proc);
static orte_vpid_t proc_get_daemon(orte_process_name_t *proc);
static char* proc_get_hostname(orte_process_name_t *proc);
static uint32_t proc_get_arch(orte_process_name_t *proc);
@ -100,7 +101,7 @@ orte_ess_base_module_t orte_ess_env_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
proc_is_local,
proc_get_locality,
proc_get_daemon,
proc_get_hostname,
proc_get_arch,
@ -209,21 +210,21 @@ static int rte_finalize(void)
return ret;
}
static bool proc_is_local(orte_process_name_t *proc)
static uint8_t proc_get_locality(orte_process_name_t *proc)
{
orte_nid_t *nid;
if (NULL == (nid = orte_util_lookup_nid(proc))) {
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
return false;
return OPAL_PROC_NON_LOCAL;
}
if (nid->daemon == ORTE_PROC_MY_DAEMON->vpid) {
OPAL_OUTPUT_VERBOSE((2, orte_ess_base_output,
"%s ess:env: proc %s is LOCAL",
"%s ess:env: proc %s on LOCAL NODE",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return true;
return (OPAL_PROC_ON_NODE | OPAL_PROC_ON_CU | OPAL_PROC_ON_CLUSTER);
}
OPAL_OUTPUT_VERBOSE((2, orte_ess_base_output,
@ -231,7 +232,7 @@ static bool proc_is_local(orte_process_name_t *proc)
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return false;
return OPAL_PROC_NON_LOCAL;
}

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

@ -59,16 +59,13 @@ typedef int (*orte_ess_base_module_finalize_fn_t)(void);
typedef void (*orte_ess_base_module_abort_fn_t)(int status, bool report) __opal_attribute_noreturn__;
/**
* Determine if a process is local to me
* Get the locality flag of the specified process
*
* MPI procs need to know if a process is "local" or not - i.e.,
* if they share the same node. Different environments are capable
* of making that determination in different ways - e.g., they may
* provide a callable utility to return the answer, or download
* a map of information into each process. This API provides a
* means for each environment to do the "right thing".
* MPI procs need to know whether a proc shares a common socket,
* board, node, computing unit, or cluster. This function provides
* a means for an MPI proc to query the locality of another proc.
*/
typedef bool (*orte_ess_base_module_proc_is_local_fn_t)(orte_process_name_t *proc);
typedef uint8_t (*orte_ess_base_module_get_proc_locality_fn_t)(orte_process_name_t *proc);
/**
* Get the vpid of the daemon who hosts the specified proc
@ -158,7 +155,7 @@ struct orte_ess_base_module_1_0_0_t {
orte_ess_base_module_init_fn_t init;
orte_ess_base_module_finalize_fn_t finalize;
orte_ess_base_module_abort_fn_t abort;
orte_ess_base_module_proc_is_local_fn_t proc_is_local;
orte_ess_base_module_get_proc_locality_fn_t proc_get_locality;
orte_ess_base_module_proc_get_daemon_fn_t proc_get_daemon;
orte_ess_base_module_proc_get_hostname_fn_t proc_get_hostname;
orte_ess_base_module_proc_get_arch_fn_t proc_get_arch;

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

@ -37,6 +37,7 @@
#include "opal/util/malloc.h"
#include "opal/util/basename.h"
#include "opal/mca/pstat/base/base.h"
#include "opal/mca/paffinity/paffinity.h"
#include "orte/util/show_help.h"
#include "orte/mca/rml/base/base.h"
@ -74,7 +75,7 @@
static int rte_init(char flags);
static int rte_finalize(void);
static void rte_abort(int status, bool report) __opal_attribute_noreturn__;
static bool proc_is_local(orte_process_name_t *proc);
static uint8_t proc_get_locality(orte_process_name_t *proc);
static orte_vpid_t proc_get_daemon(orte_process_name_t *proc);
static char* proc_get_hostname(orte_process_name_t *proc);
static uint32_t proc_get_arch(orte_process_name_t *proc);
@ -89,7 +90,7 @@ orte_ess_base_module_t orte_ess_hnp_module = {
rte_init,
rte_finalize,
rte_abort,
proc_is_local,
proc_get_locality,
proc_get_daemon,
proc_get_hostname,
proc_get_arch,
@ -564,7 +565,7 @@ static void rte_abort(int status, bool report)
exit(status);
}
static bool proc_is_local(orte_process_name_t *proc)
static uint8_t proc_get_locality(orte_process_name_t *proc)
{
orte_node_t **nodes;
orte_proc_t **procs;
@ -582,7 +583,7 @@ static bool proc_is_local(orte_process_name_t *proc)
"%s ess:hnp: proc %s is LOCAL",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return true;
return (OPAL_PROC_ON_NODE | OPAL_PROC_ON_CU | OPAL_PROC_ON_CLUSTER);
}
}
@ -591,7 +592,7 @@ static bool proc_is_local(orte_process_name_t *proc)
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return false;
return OPAL_PROC_NON_LOCAL;
}

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

@ -34,6 +34,7 @@
#include "opal/util/argv.h"
#include "opal/util/opal_environ.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/mca/paffinity/paffinity.h"
#include "orte/util/show_help.h"
#include "orte/util/name_fns.h"
@ -50,7 +51,7 @@ static int lsf_set_name(void);
static int rte_init(char flags);
static int rte_finalize(void);
static bool proc_is_local(orte_process_name_t *proc);
static uint8_t proc_get_locality(orte_process_name_t *proc);
static orte_vpid_t proc_get_daemon(orte_process_name_t *proc);
static char* proc_get_hostname(orte_process_name_t *proc);
static uint32_t proc_get_arch(orte_process_name_t *proc);
@ -64,7 +65,7 @@ orte_ess_base_module_t orte_ess_lsf_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
proc_is_local,
proc_get_locality,
proc_get_daemon,
proc_get_hostname,
proc_get_arch,
@ -171,13 +172,13 @@ static int rte_finalize(void)
return ret;
}
static bool proc_is_local(orte_process_name_t *proc)
static uint8_t proc_get_locality(orte_process_name_t *proc)
{
orte_nid_t *nid;
if (NULL == (nid = orte_util_lookup_nid(proc))) {
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
return false;
return OPAL_PROC_NON_LOCAL;
}
if (nid->daemon == ORTE_PROC_MY_DAEMON->vpid) {
@ -185,7 +186,7 @@ static bool proc_is_local(orte_process_name_t *proc)
"%s ess:lsf: proc %s is LOCAL",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return true;
return (OPAL_PROC_ON_NODE | OPAL_PROC_ON_CU | OPAL_PROC_ON_CLUSTER);
}
OPAL_OUTPUT_VERBOSE((2, orte_ess_base_output,
@ -193,7 +194,7 @@ static bool proc_is_local(orte_process_name_t *proc)
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return false;
return OPAL_PROC_NON_LOCAL;
}

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

@ -24,6 +24,7 @@
#include "orte/util/show_help.h"
#include "opal/util/argv.h"
#include "opal/mca/paffinity/paffinity.h"
#include "orte/mca/errmgr/base/base.h"
#include "orte/util/name_fns.h"
@ -38,7 +39,7 @@
static int rte_init(char flags);
static int rte_finalize(void);
static void rte_abort(int status, bool report) __opal_attribute_noreturn__;
static bool proc_is_local(orte_process_name_t *proc);
static uint8_t proc_get_locality(orte_process_name_t *proc);
static char* proc_get_hostname(orte_process_name_t *proc);
static uint32_t proc_get_arch(orte_process_name_t *proc);
static orte_local_rank_t proc_get_local_rank(orte_process_name_t *proc);
@ -49,7 +50,7 @@ orte_ess_base_module_t orte_ess_portals_utcp_module = {
rte_init,
rte_finalize,
rte_abort,
proc_is_local,
proc_get_locality,
NULL, /* proc_get_daemon is only used in ORTE */
proc_get_hostname,
proc_get_arch,
@ -137,16 +138,16 @@ static void rte_abort(int status, bool report)
exit(status);
}
static bool proc_is_local(orte_process_name_t *proc)
static uint8_t proc_get_locality(orte_process_name_t *proc)
{
if (NULL != nidmap[proc->vpid] &&
NULL != nidmap[ORTE_PROC_MY_NAME->vpid] &&
0 == strcmp(nidmap[proc->vpid],
nidmap[ORTE_PROC_MY_NAME->vpid])) {
return true;
return (OPAL_PROC_ON_NODE | OPAL_PROC_ON_CU | OPAL_PROC_ON_CLUSTER);
}
return false;
return OPAL_PROC_NON_LOCAL;
}
static char* proc_get_hostname(orte_process_name_t *proc)

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

@ -35,6 +35,7 @@
#include "opal/mca/installdirs/installdirs.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/class/opal_value_array.h"
#include "opal/mca/paffinity/paffinity.h"
#include "orte/util/show_help.h"
#include "orte/util/proc_info.h"
@ -68,7 +69,7 @@ static void set_handler_default(int sig)
static int rte_init(char flags);
static int rte_finalize(void);
static bool proc_is_local(orte_process_name_t *proc);
static uint8_t proc_get_locality(orte_process_name_t *proc);
static orte_vpid_t proc_get_daemon(orte_process_name_t *proc);
static char* proc_get_hostname(orte_process_name_t *proc);
static uint32_t proc_get_arch(orte_process_name_t *proc);
@ -82,7 +83,7 @@ orte_ess_base_module_t orte_ess_singleton_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
proc_is_local,
proc_get_locality,
proc_get_daemon,
proc_get_hostname,
proc_get_arch,
@ -382,13 +383,13 @@ static int fork_hnp(void)
return ORTE_SUCCESS;
}
static bool proc_is_local(orte_process_name_t *proc)
static uint8_t proc_get_locality(orte_process_name_t *proc)
{
orte_nid_t *nid;
if (NULL == (nid = orte_util_lookup_nid(proc))) {
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
return false;
return OPAL_PROC_NON_LOCAL;
}
if (nid->daemon == ORTE_PROC_MY_DAEMON->vpid) {
@ -396,7 +397,7 @@ static bool proc_is_local(orte_process_name_t *proc)
"%s ess:singleton: proc %s is LOCAL",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return true;
return (OPAL_PROC_ON_NODE | OPAL_PROC_ON_CU | OPAL_PROC_ON_CLUSTER);
}
OPAL_OUTPUT_VERBOSE((2, orte_ess_base_output,
@ -404,7 +405,7 @@ static bool proc_is_local(orte_process_name_t *proc)
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return false;
return OPAL_PROC_NON_LOCAL;
}

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

@ -34,6 +34,7 @@
#include "opal/runtime/opal.h"
#include "opal/runtime/opal_cr.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/mca/paffinity/paffinity.h"
#include "orte/util/show_help.h"
#include "opal/mca/mca.h"
@ -81,7 +82,7 @@ static int slave_set_name(void);
static int rte_init(char flags);
static int rte_finalize(void);
static bool proc_is_local(orte_process_name_t *proc);
static uint8_t proc_get_locality(orte_process_name_t *proc);
static orte_vpid_t proc_get_daemon(orte_process_name_t *proc);
static char* proc_get_hostname(orte_process_name_t *proc);
static uint32_t proc_get_arch(orte_process_name_t *proc);
@ -100,7 +101,7 @@ orte_ess_base_module_t orte_ess_slave_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
proc_is_local,
proc_get_locality,
proc_get_daemon,
proc_get_hostname,
proc_get_arch,
@ -172,7 +173,7 @@ static int rte_finalize(void)
return ret;
}
static bool proc_is_local(orte_process_name_t *proc)
static uint8_t proc_get_locality(orte_process_name_t *proc)
{
/* no proc can be local */
@ -181,7 +182,7 @@ static bool proc_is_local(orte_process_name_t *proc)
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return false;
return OPAL_PROC_NON_LOCAL;
}

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

@ -43,6 +43,7 @@
#include "opal/util/if.h"
#include "opal/util/net.h"
#include "opal/dss/dss.h"
#include "opal/mca/paffinity/paffinity.h"
#include "orte/util/proc_info.h"
#include "orte/util/show_help.h"
@ -62,7 +63,7 @@ static int build_daemon_nidmap(void);
static int rte_init(char flags);
static int rte_finalize(void);
static bool proc_is_local(orte_process_name_t *proc);
static uint8_t proc_get_locality(orte_process_name_t *proc);
static orte_vpid_t proc_get_daemon(orte_process_name_t *proc);
static char* proc_get_hostname(orte_process_name_t *proc);
static uint32_t proc_get_arch(orte_process_name_t *proc);
@ -76,7 +77,7 @@ orte_ess_base_module_t orte_ess_slurm_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
proc_is_local,
proc_get_locality,
proc_get_daemon,
proc_get_hostname,
proc_get_arch,
@ -202,13 +203,13 @@ static int rte_finalize(void)
return ret;
}
static bool proc_is_local(orte_process_name_t *proc)
static uint8_t proc_get_locality(orte_process_name_t *proc)
{
orte_nid_t *nid;
if (NULL == (nid = orte_util_lookup_nid(proc))) {
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
return false;
return OPAL_PROC_NON_LOCAL;
}
if (nid->daemon == ORTE_PROC_MY_DAEMON->vpid) {
@ -216,7 +217,7 @@ static bool proc_is_local(orte_process_name_t *proc)
"%s ess:slurm: proc %s is LOCAL",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return true;
return (OPAL_PROC_ON_NODE | OPAL_PROC_ON_CU | OPAL_PROC_ON_CLUSTER);
}
OPAL_OUTPUT_VERBOSE((2, orte_ess_base_output,
@ -224,7 +225,7 @@ static bool proc_is_local(orte_process_name_t *proc)
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(proc)));
return false;
return OPAL_PROC_NON_LOCAL;
}

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

@ -29,6 +29,7 @@
#include "opal/class/opal_hash_table.h"
#include "opal/dss/dss.h"
#include "opal/runtime/opal.h"
#include "opal/mca/paffinity/paffinity.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/ess/ess.h"
@ -313,7 +314,7 @@ static int allgather(opal_buffer_t *sbuf, opal_buffer_t *rbuf)
continue;
}
proc.vpid = v;
if (!orte_ess.proc_is_local(&proc)) {
if (!OPAL_PROC_ON_LOCAL_NODE(orte_ess.proc_get_locality(&proc))) {
continue;
}
/* add this proc to our list of local peers */