1
1

Revert "* comment on communicator creation in mca_topo_base_dist_graph_create(...)"

This partially reverts commit open-mpi/ompi@27e4389259.
Этот коммит содержится в:
Gilles Gouaillardet 2015-09-22 00:31:44 +09:00 коммит произвёл George Bosilca
родитель a8bdd8f668
Коммит 99cca2cfd3
2 изменённых файлов: 21 добавлений и 13 удалений

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

@ -76,10 +76,11 @@ mca_coll_basic_comm_query(struct ompi_communicator_t *comm,
}
size *= 2;
if (OMPI_COMM_IS_CART(comm)) {
int cart_size, ndims;
int cart_size;
mca_topo_base_comm_cart_2_2_0_t *cart;
assert (NULL != comm->c_topo);
comm->c_topo->topo.cart.cartdim_get(comm, &ndims);
cart_size = ndims * 4;
cart = comm->c_topo->mtc.cart;
cart_size = cart->ndims * 4;
if (cart_size > size) {
size = cart_size;
}
@ -87,16 +88,17 @@ mca_coll_basic_comm_query(struct ompi_communicator_t *comm,
int rank, degree;
assert (NULL != comm->c_topo);
rank = ompi_comm_rank (comm);
comm->c_topo->topo.graph.graph_neighbors_count (comm, rank, &degree);
mca_topo_base_graph_neighbors_count (comm, rank, &degree);
degree *= 2;
if (degree > size) {
size = degree;
}
} else if (OMPI_COMM_IS_DIST_GRAPH(comm)) {
int dist_graph_size, inneighbors, outneighbors, weighted;
int dist_graph_size;
mca_topo_base_comm_dist_graph_2_2_0_t *dist_graph;
assert (NULL != comm->c_topo);
comm->c_topo->topo.dist_graph.dist_graph_neighbors_count(comm, &inneighbors, &outneighbors, &weighted);
dist_graph_size = inneighbors + outneighbors;
dist_graph = comm->c_topo->mtc.dist_graph;
dist_graph_size = dist_graph->indegree + dist_graph->outdegree;
if (dist_graph_size > size) {
size = dist_graph_size;
}

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

@ -287,15 +287,23 @@ int mca_topo_base_dist_graph_create(mca_topo_base_module_t* module,
ompi_communicator_t **newcomm)
{
int err;
ompi_proc_t **topo_procs = NULL;
int num_procs, ret, rank, i;
ompi_communicator_t *new_comm;
mca_topo_base_comm_dist_graph_2_2_0_t* topo;
num_procs = ompi_comm_size(comm_old);
num_procs = ompi_comm_size(comm_old);
rank = ompi_comm_rank(comm_old);
topo_procs = (ompi_proc_t**)malloc(num_procs * sizeof(ompi_proc_t *));
if (NULL == topo_procs) {
return OMPI_ERR_OUT_OF_RESOURCE;
if(OMPI_GROUP_IS_DENSE(comm_old->c_local_group)) {
memcpy(topo_procs,
comm_old->c_local_group->grp_proc_pointers,
num_procs * sizeof(ompi_proc_t *));
} else {
for(i = 0 ; i < num_procs; i++) {
topo_procs[i] = ompi_group_peer_lookup(comm_old->c_local_group,i);
}
}
new_comm = ompi_comm_allocate(num_procs, 0);
if (NULL == new_comm) {
@ -310,12 +318,10 @@ int mca_topo_base_dist_graph_create(mca_topo_base_module_t* module,
&topo);
if( OMPI_SUCCESS != err ) {
free(topo_procs);
ompi_comm_free(&new_comm);
ompi_comm_free(newcomm);
return err;
}
/* we cannot simply call ompi_comm_create because c_topo
must be set before invoking ompi_comm_enable */
rank = ompi_comm_rank(comm_old);
if(OMPI_GROUP_IS_DENSE(comm_old->c_local_group)) {
memcpy(topo_procs,