communicator/comm_init.c: add a new flag indicating binding policy
Check for the binding policy used. We are only interested in whether mapby-node has been set right now (could be extended later) and only on MPI_COMM_WORLD, since for all other sub-communicators it is virtually impossible to identify their layout across nodes in the most generic sense. This is used by OMPIO for deciding which ranks to use for aggregators Signed-off-by: Edgar Gabriel <gabriel@cs.uh.edu>
Этот коммит содержится в:
родитель
b3f59c76e1
Коммит
92eff9050c
@ -10,7 +10,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006-2010 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2006-2017 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012-2015 Los Alamos National Security, LLC.
|
||||
@ -35,6 +35,7 @@
|
||||
|
||||
#include "opal/util/bit_ops.h"
|
||||
#include "opal/util/info_subscriber.h"
|
||||
#include "opal/mca/pmix/pmix.h"
|
||||
#include "ompi/constants.h"
|
||||
#include "ompi/mca/pml/pml.h"
|
||||
#include "ompi/mca/coll/base/base.h"
|
||||
@ -150,6 +151,23 @@ int ompi_comm_init(void)
|
||||
because MPI_COMM_WORLD has some predefined attributes. */
|
||||
ompi_attr_hash_init(&ompi_mpi_comm_world.comm.c_keyhash);
|
||||
|
||||
/* Check for the binding policy used. We are only interested in
|
||||
whether mapby-node has been set right now (could be extended later)
|
||||
and only on MPI_COMM_WORLD, since for all other sub-communicators
|
||||
it is virtually impossible to identify their layout across nodes
|
||||
in the most generic sense. This is used by OMPIO for deciding which
|
||||
ranks to use for aggregators
|
||||
*/
|
||||
opal_process_name_t wildcard = {ORTE_PROC_MY_NAME->jobid, OPAL_VPID_WILDCARD};
|
||||
char *str=NULL;
|
||||
int rc;
|
||||
|
||||
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_MAPBY, &wildcard, &str, OPAL_STRING);
|
||||
if ( 0 == rc ) {
|
||||
if ( strstr ( str, "BYNODE") ) {
|
||||
OMPI_COMM_SET_MAPBY_NODE(&ompi_mpi_comm_world.comm);
|
||||
}
|
||||
}
|
||||
/* Setup MPI_COMM_SELF */
|
||||
OBJ_CONSTRUCT(&ompi_mpi_comm_self, ompi_communicator_t);
|
||||
assert(ompi_mpi_comm_self.comm.c_f_to_c_index == 1);
|
||||
|
@ -11,7 +11,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
|
||||
* Copyright (c) 2006-2010 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2006-2017 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011-2013 Inria. All rights reserved.
|
||||
* Copyright (c) 2011-2013 Universite Bordeaux 1
|
||||
@ -60,6 +60,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_communicator_t);
|
||||
#define OMPI_COMM_DIST_GRAPH 0x00000400
|
||||
#define OMPI_COMM_PML_ADDED 0x00001000
|
||||
#define OMPI_COMM_EXTRA_RETAIN 0x00004000
|
||||
#define OMPI_COMM_MAPBY_NODE 0x00008000
|
||||
|
||||
/* some utility #defines */
|
||||
#define OMPI_COMM_IS_INTER(comm) ((comm)->c_flags & OMPI_COMM_INTER)
|
||||
@ -76,12 +77,14 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_communicator_t);
|
||||
#define OMPI_COMM_IS_TOPO(comm) (OMPI_COMM_IS_CART((comm)) || \
|
||||
OMPI_COMM_IS_GRAPH((comm)) || \
|
||||
OMPI_COMM_IS_DIST_GRAPH((comm)))
|
||||
#define OMPI_COMM_IS_MAPBY_NODE(comm) ((comm)->c_flags & OMPI_COMM_MAPBY_NODE)
|
||||
|
||||
#define OMPI_COMM_SET_DYNAMIC(comm) ((comm)->c_flags |= OMPI_COMM_DYNAMIC)
|
||||
#define OMPI_COMM_SET_INVALID(comm) ((comm)->c_flags |= OMPI_COMM_INVALID)
|
||||
|
||||
#define OMPI_COMM_SET_PML_ADDED(comm) ((comm)->c_flags |= OMPI_COMM_PML_ADDED)
|
||||
#define OMPI_COMM_SET_EXTRA_RETAIN(comm) ((comm)->c_flags |= OMPI_COMM_EXTRA_RETAIN)
|
||||
#define OMPI_COMM_SET_MAPBY_NODE(comm) ((comm)->c_flags |= OMPI_COMM_MAPBY_NODE)
|
||||
|
||||
/* a set of special tags: */
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user