1
1

coll: Don't allocate space for zero requests

Refs #2402

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Этот коммит содержится в:
Gilles Gouaillardet 2016-11-13 22:20:13 -07:00
родитель 725277bc26
Коммит 99d30353af
4 изменённых файлов: 20 добавлений и 6 удалений

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

@ -395,8 +395,10 @@ int ompi_coll_base_alltoall_intra_linear_sync(const void *sbuf, int scount,
total_reqs = (((max_outstanding_reqs > (size - 1)) || total_reqs = (((max_outstanding_reqs > (size - 1)) ||
(max_outstanding_reqs <= 0)) ? (max_outstanding_reqs <= 0)) ?
(size - 1) : (max_outstanding_reqs)); (size - 1) : (max_outstanding_reqs));
if (0 < total_reqs) {
reqs = coll_base_comm_get_reqs(module->base_data, 2 * total_reqs); reqs = coll_base_comm_get_reqs(module->base_data, 2 * total_reqs);
if (NULL == reqs) { error = -1; line = __LINE__; goto error_hndl; } if (NULL == reqs) { error = -1; line = __LINE__; goto error_hndl; }
}
prcv = (char *) rbuf; prcv = (char *) rbuf;
psnd = (char *) sbuf; psnd = (char *) sbuf;

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

@ -11,6 +11,8 @@
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * 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$ * $COPYRIGHT$
* *
* Additional copyrights may follow * 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)); 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. */ /* Non-root receive the data. */
if (rank != root) { 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; } if (NULL == tmpbuf) { err = OMPI_ERR_OUT_OF_RESOURCE; line = __LINE__; goto exit; }
pml_buffer = tmpbuf - gap; pml_buffer = tmpbuf - gap;
if (rsize > 1) {
reqs = coll_base_comm_get_reqs(module->base_data, 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; } 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 */ /* Do a send-recv between the two root procs. to avoid deadlock */
err = MCA_PML_CALL(irecv(rbuf, count, dtype, 0, err = MCA_PML_CALL(irecv(rbuf, count, dtype, 0,

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

@ -12,7 +12,7 @@
* All rights reserved. * All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights * Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved. * 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. * and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $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; int rc = MPI_SUCCESS, dim, i, nreqs;
ompi_request_t **reqs, **preqs; 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 ); reqs = preqs = coll_base_comm_get_reqs( module->base_data, 4 * cart->ndims );
if( NULL == reqs ) { return OMPI_ERR_OUT_OF_RESOURCE; } 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; const int *edges;
mca_topo_base_graph_neighbors_count (comm, rank, &degree); mca_topo_base_graph_neighbors_count (comm, rank, &degree);
if (0 == degree) return OMPI_SUCCESS;
reqs = preqs = coll_base_comm_get_reqs( module->base_data, 2 * degree ); reqs = preqs = coll_base_comm_get_reqs( module->base_data, 2 * degree );
if( NULL == reqs ) { return OMPI_ERR_OUT_OF_RESOURCE; } 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; inedges = dist_graph->in;
outedges = dist_graph->out; outedges = dist_graph->out;
if (0 == indegree+outdegree) return OMPI_SUCCESS;
reqs = preqs = coll_base_comm_get_reqs( module->base_data, indegree + outdegree ); reqs = preqs = coll_base_comm_get_reqs( module->base_data, indegree + outdegree );
if( NULL == reqs ) { return OMPI_ERR_OUT_OF_RESOURCE; } if( NULL == reqs ) { return OMPI_ERR_OUT_OF_RESOURCE; }