diff --git a/ompi/mca/coll/base/coll_base_alltoall.c b/ompi/mca/coll/base/coll_base_alltoall.c index 69ec37f734..6e06e6640b 100644 --- a/ompi/mca/coll/base/coll_base_alltoall.c +++ b/ompi/mca/coll/base/coll_base_alltoall.c @@ -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; diff --git a/ompi/mca/coll/base/coll_base_bcast.c b/ompi/mca/coll/base/coll_base_bcast.c index 9ef303793a..737af89fe3 100644 --- a/ompi/mca/coll/base/coll_base_bcast.c +++ b/ompi/mca/coll/base/coll_base_bcast.c @@ -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) { diff --git a/ompi/mca/coll/basic/coll_basic_allreduce.c b/ompi/mca/coll/basic/coll_basic_allreduce.c index 5dd0d4a2ed..7cdb84a652 100644 --- a/ompi/mca/coll/basic/coll_basic_allreduce.c +++ b/ompi/mca/coll/basic/coll_basic_allreduce.c @@ -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, diff --git a/ompi/mca/coll/basic/coll_basic_neighbor_alltoallw.c b/ompi/mca/coll/basic/coll_basic_neighbor_alltoallw.c index 11d16f8ec8..3ee5514d21 100644 --- a/ompi/mca/coll/basic/coll_basic_neighbor_alltoallw.c +++ b/ompi/mca/coll/basic/coll_basic_neighbor_alltoallw.c @@ -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; }