coll: Don't allocate space for zero requests
Refs #2402 Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Этот коммит содержится в:
родитель
725277bc26
Коммит
99d30353af
@ -395,8 +395,10 @@ int ompi_coll_base_alltoall_intra_linear_sync(const void *sbuf, int scount,
|
||||
total_reqs = (((max_outstanding_reqs > (size - 1)) ||
|
||||
(max_outstanding_reqs <= 0)) ?
|
||||
(size - 1) : (max_outstanding_reqs));
|
||||
reqs = coll_base_comm_get_reqs(module->base_data, 2 * total_reqs);
|
||||
if (NULL == reqs) { error = -1; line = __LINE__; goto error_hndl; }
|
||||
if (0 < total_reqs) {
|
||||
reqs = coll_base_comm_get_reqs(module->base_data, 2 * total_reqs);
|
||||
if (NULL == reqs) { error = -1; line = __LINE__; goto error_hndl; }
|
||||
}
|
||||
|
||||
prcv = (char *) rbuf;
|
||||
psnd = (char *) sbuf;
|
||||
|
@ -10,7 +10,9 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -615,6 +617,8 @@ ompi_coll_base_bcast_intra_basic_linear(void *buff, int count,
|
||||
|
||||
OPAL_OUTPUT((ompi_coll_base_framework.framework_output,"ompi_coll_base_bcast_intra_basic_linear rank %d root %d", rank, root));
|
||||
|
||||
if (1 == size) return OMPI_SUCCESS;
|
||||
|
||||
/* Non-root receive the data. */
|
||||
|
||||
if (rank != root) {
|
||||
|
@ -108,8 +108,10 @@ mca_coll_basic_allreduce_inter(const void *sbuf, void *rbuf, int count,
|
||||
if (NULL == tmpbuf) { err = OMPI_ERR_OUT_OF_RESOURCE; line = __LINE__; goto exit; }
|
||||
pml_buffer = tmpbuf - gap;
|
||||
|
||||
reqs = coll_base_comm_get_reqs(module->base_data, rsize - 1);
|
||||
if( NULL == reqs ) { err = OMPI_ERR_OUT_OF_RESOURCE; line = __LINE__; goto exit; }
|
||||
if (rsize > 1) {
|
||||
reqs = coll_base_comm_get_reqs(module->base_data, rsize - 1);
|
||||
if( NULL == reqs ) { err = OMPI_ERR_OUT_OF_RESOURCE; line = __LINE__; goto exit; }
|
||||
}
|
||||
|
||||
/* Do a send-recv between the two root procs. to avoid deadlock */
|
||||
err = MCA_PML_CALL(irecv(rbuf, count, dtype, 0,
|
||||
|
@ -12,7 +12,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -46,6 +46,8 @@ mca_coll_basic_neighbor_alltoallw_cart(const void *sbuf, const int scounts[], co
|
||||
int rc = MPI_SUCCESS, dim, i, nreqs;
|
||||
ompi_request_t **reqs, **preqs;
|
||||
|
||||
if (0 == cart->ndims) return OMPI_SUCCESS;
|
||||
|
||||
reqs = preqs = coll_base_comm_get_reqs( module->base_data, 4 * cart->ndims );
|
||||
if( NULL == reqs ) { return OMPI_ERR_OUT_OF_RESOURCE; }
|
||||
|
||||
@ -129,6 +131,8 @@ mca_coll_basic_neighbor_alltoallw_graph(const void *sbuf, const int scounts[], c
|
||||
const int *edges;
|
||||
|
||||
mca_topo_base_graph_neighbors_count (comm, rank, °ree);
|
||||
if (0 == degree) return OMPI_SUCCESS;
|
||||
|
||||
reqs = preqs = coll_base_comm_get_reqs( module->base_data, 2 * degree );
|
||||
if( NULL == reqs ) { return OMPI_ERR_OUT_OF_RESOURCE; }
|
||||
|
||||
@ -187,6 +191,8 @@ mca_coll_basic_neighbor_alltoallw_dist_graph(const void *sbuf, const int scounts
|
||||
inedges = dist_graph->in;
|
||||
outedges = dist_graph->out;
|
||||
|
||||
if (0 == indegree+outdegree) return OMPI_SUCCESS;
|
||||
|
||||
reqs = preqs = coll_base_comm_get_reqs( module->base_data, indegree + outdegree );
|
||||
if( NULL == reqs ) { return OMPI_ERR_OUT_OF_RESOURCE; }
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user