| 
10 | 10 |  *                         University of Stuttgart.  All rights reserved.  | 
11 | 11 |  * Copyright (c) 2004-2005 The Regents of the University of California.  | 
12 | 12 |  *                         All rights reserved.  | 
13 |  | - * Copyright (c) 2006-2010 University of Houston. All rights reserved.  | 
 | 13 | + * Copyright (c) 2006-2017 University of Houston. All rights reserved.  | 
14 | 14 |  * Copyright (c) 2007-2012 Cisco Systems, Inc.  All rights reserved.  | 
15 | 15 |  * Copyright (c) 2009      Sun Microsystems, Inc. All rights reserved.  | 
16 | 16 |  * Copyright (c) 2012-2015 Los Alamos National Security, LLC.  | 
 | 
35 | 35 | 
 
  | 
36 | 36 | #include "opal/util/bit_ops.h"  | 
37 | 37 | #include "opal/util/info_subscriber.h"  | 
 | 38 | +#include "opal/mca/pmix/pmix.h"  | 
38 | 39 | #include "ompi/constants.h"  | 
39 | 40 | #include "ompi/mca/pml/pml.h"  | 
40 | 41 | #include "ompi/mca/coll/base/base.h"  | 
@@ -150,6 +151,23 @@ int ompi_comm_init(void)  | 
150 | 151 |        because MPI_COMM_WORLD has some predefined attributes. */  | 
151 | 152 |     ompi_attr_hash_init(&ompi_mpi_comm_world.comm.c_keyhash);  | 
152 | 153 | 
 
  | 
 | 154 | +    /* Check for the binding policy used. We are only interested in   | 
 | 155 | +       whether mapby-node has been set right now (could be extended later)  | 
 | 156 | +       and only on MPI_COMM_WORLD, since for all other sub-communicators  | 
 | 157 | +       it is virtually impossible to identify their layout across nodes  | 
 | 158 | +       in the most generic sense. This is used by OMPIO for deciding which  | 
 | 159 | +       ranks to use for aggregators  | 
 | 160 | +    */  | 
 | 161 | +    opal_process_name_t wildcard = {ORTE_PROC_MY_NAME->jobid, OPAL_VPID_WILDCARD};  | 
 | 162 | +    char *str=NULL;  | 
 | 163 | +    int rc;  | 
 | 164 | +      | 
 | 165 | +    OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_MAPBY, &wildcard, &str, OPAL_STRING);  | 
 | 166 | +    if ( 0 == rc ) {  | 
 | 167 | +        if ( strstr ( str, "BYNODE") ) {  | 
 | 168 | +            OMPI_COMM_SET_MAPBY_NODE(&ompi_mpi_comm_world.comm);  | 
 | 169 | +        }  | 
 | 170 | +    }  | 
153 | 171 |     /* Setup MPI_COMM_SELF */  | 
154 | 172 |     OBJ_CONSTRUCT(&ompi_mpi_comm_self, ompi_communicator_t);  | 
155 | 173 |     assert(ompi_mpi_comm_self.comm.c_f_to_c_index == 1);  | 
 | 
0 commit comments