diff --git a/ompi/mca/coll/basic/coll_basic_allgather.c b/ompi/mca/coll/basic/coll_basic_allgather.c index be12293b94..0938a99173 100644 --- a/ompi/mca/coll/basic/coll_basic_allgather.c +++ b/ompi/mca/coll/basic/coll_basic_allgather.c @@ -106,14 +106,9 @@ mca_coll_basic_allgather_inter(void *sbuf, int scount, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm) { - int rank; - int root = 0; - int size, rsize; - int err; - int i; + int rank, root = 0, size, rsize, err, i; char *tmpbuf = NULL, *ptmp; - ptrdiff_t rlb, slb, rextent, sextent; - ptrdiff_t incr; + ptrdiff_t rlb, slb, rextent, sextent, incr; ompi_request_t *req; ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs; diff --git a/ompi/mca/coll/basic/coll_basic_allreduce.c b/ompi/mca/coll/basic/coll_basic_allreduce.c index 3f72297523..b3c329ffee 100644 --- a/ompi/mca/coll/basic/coll_basic_allreduce.c +++ b/ompi/mca/coll/basic/coll_basic_allreduce.c @@ -76,10 +76,7 @@ mca_coll_basic_allreduce_inter(void *sbuf, void *rbuf, int count, struct ompi_op_t *op, struct ompi_communicator_t *comm) { - int err, i; - int rank; - int root = 0; - int rsize; + int err, i, rank, root = 0, rsize; ptrdiff_t lb, extent; char *tmpbuf = NULL, *pml_buffer = NULL; ompi_request_t *req[2]; diff --git a/ompi/mca/coll/basic/coll_basic_alltoall.c b/ompi/mca/coll/basic/coll_basic_alltoall.c index ffefa31c07..3d82199aab 100644 --- a/ompi/mca/coll/basic/coll_basic_alltoall.c +++ b/ompi/mca/coll/basic/coll_basic_alltoall.c @@ -91,7 +91,6 @@ mca_coll_basic_alltoall_intra(void *sbuf, int scount, /* Initiate all send/recv to/from others. */ - nreqs = (size - 1) * 2; req = rreq = comm->c_coll_basic_data->mccb_reqs; sreq = rreq + size - 1; @@ -100,31 +99,32 @@ mca_coll_basic_alltoall_intra(void *sbuf, int scount, /* Post all receives first -- a simple optimization */ - for (i = (rank + 1) % size; i != rank; i = (i + 1) % size, ++rreq) { + for (nreqs = 0, i = (rank + 1) % size; i != rank; i = (i + 1) % size, ++rreq, ++nreqs) { err = MCA_PML_CALL(irecv_init (prcv + (i * rcvinc), rcount, rdtype, i, MCA_COLL_BASE_TAG_ALLTOALL, comm, rreq)); if (MPI_SUCCESS != err) { - mca_coll_basic_free_reqs(req, rreq - req); + mca_coll_basic_free_reqs(req, nreqs); return err; } } /* Now post all sends */ - for (i = (rank + 1) % size; i != rank; i = (i + 1) % size, ++sreq) { + for (nreqs = 0, i = (rank + 1) % size; i != rank; i = (i + 1) % size, ++sreq, ++nreqs) { err = MCA_PML_CALL(isend_init (psnd + (i * sndinc), scount, sdtype, i, MCA_COLL_BASE_TAG_ALLTOALL, MCA_PML_BASE_SEND_STANDARD, comm, sreq)); if (MPI_SUCCESS != err) { - mca_coll_basic_free_reqs(req, sreq - req); + mca_coll_basic_free_reqs(req, nreqs); return err; } } + nreqs = (size - 1) * 2; /* Start your engines. This will never return an error. */ MCA_PML_CALL(start(nreqs, req)); diff --git a/ompi/mca/coll/basic/coll_basic_alltoallv.c b/ompi/mca/coll/basic/coll_basic_alltoallv.c index 7d8607cd19..5b327f04d9 100644 --- a/ompi/mca/coll/basic/coll_basic_alltoallv.c +++ b/ompi/mca/coll/basic/coll_basic_alltoallv.c @@ -47,7 +47,7 @@ mca_coll_basic_alltoallv_intra(void *sbuf, int *scounts, int *sdisps, int err; char *psnd; char *prcv; - size_t nreqs; + int nreqs; MPI_Aint sndextent; MPI_Aint rcvextent; MPI_Request *preq; diff --git a/ompi/mca/coll/basic/coll_basic_alltoallw.c b/ompi/mca/coll/basic/coll_basic_alltoallw.c index 6dbdb5a600..bef9d4e6f5 100644 --- a/ompi/mca/coll/basic/coll_basic_alltoallw.c +++ b/ompi/mca/coll/basic/coll_basic_alltoallw.c @@ -46,7 +46,7 @@ mca_coll_basic_alltoallw_intra(void *sbuf, int *scounts, int *sdisps, int err; char *psnd; char *prcv; - size_t nreqs; + int nreqs; MPI_Request *preq; /* Initialize. */ @@ -159,7 +159,7 @@ mca_coll_basic_alltoallw_inter(void *sbuf, int *scounts, int *sdisps, int err; char *psnd; char *prcv; - size_t nreqs; + int nreqs; MPI_Request *preq; /* Initialize. */ diff --git a/ompi/mca/coll/basic/coll_basic_bcast.c b/ompi/mca/coll/basic/coll_basic_bcast.c index 25d36f0f12..1b3871be2b 100644 --- a/ompi/mca/coll/basic/coll_basic_bcast.c +++ b/ompi/mca/coll/basic/coll_basic_bcast.c @@ -161,7 +161,7 @@ mca_coll_basic_bcast_log_intra(void *buff, int count, MCA_PML_BASE_SEND_STANDARD, comm, preq++)); if (MPI_SUCCESS != err) { - mca_coll_basic_free_reqs(reqs, preq - reqs); + mca_coll_basic_free_reqs(reqs, nreqs); return err; } } diff --git a/ompi/mca/coll/basic/coll_basic_reduce_scatter.c b/ompi/mca/coll/basic/coll_basic_reduce_scatter.c index df3bb9fed9..11deb01dce 100644 --- a/ompi/mca/coll/basic/coll_basic_reduce_scatter.c +++ b/ompi/mca/coll/basic/coll_basic_reduce_scatter.c @@ -46,8 +46,7 @@ mca_coll_basic_reduce_scatter_intra(void *sbuf, void *rbuf, int *rcounts, int i, err, rank, size, count; ptrdiff_t true_lb, true_extent, lb, extent; int *disps = NULL; - char *free_buffer = NULL; - char *pml_buffer = NULL; + char *free_buffer = NULL, *pml_buffer = NULL; /* Initialize */ diff --git a/ompi/mca/coll/sm/coll_sm_component.c b/ompi/mca/coll/sm/coll_sm_component.c index 290cf3a785..4c2b47246e 100644 --- a/ompi/mca/coll/sm/coll_sm_component.c +++ b/ompi/mca/coll/sm/coll_sm_component.c @@ -247,7 +247,7 @@ static int sm_open(void) mca_base_param_reg_int(c, "shared_mem_used_bootstrap", "Amount of shared memory used in the shared memory bootstrap area (in bytes)", false, true, - size1, NULL); + (int)size1, NULL); /* Calculate how much space we need in the data mpool. This formula taken directly from coll_sm_module.c. */ @@ -265,7 +265,7 @@ static int sm_open(void) mca_base_param_reg_int(c, "shared_mem_used_data", "Amount of shared memory used in the shared memory data area for info_num_procs processes (in bytes)", false, true, - size2, NULL); + (int)size2, NULL); return OMPI_SUCCESS; } diff --git a/ompi/mca/coll/tuned/coll_tuned_alltoall.c b/ompi/mca/coll/tuned/coll_tuned_alltoall.c index 08aa4238ac..c6a6c51fa5 100644 --- a/ompi/mca/coll/tuned/coll_tuned_alltoall.c +++ b/ompi/mca/coll/tuned/coll_tuned_alltoall.c @@ -369,7 +369,6 @@ int ompi_coll_tuned_alltoall_intra_basic_linear(void *sbuf, int scount, /* Initiate all send/recv to/from others. */ - nreqs = (size - 1) * 2; req = rreq = comm->c_coll_basic_data->mcct_reqs; sreq = rreq + size - 1; @@ -378,7 +377,7 @@ int ompi_coll_tuned_alltoall_intra_basic_linear(void *sbuf, int scount, /* Post all receives first -- a simple optimization */ - for (i = (rank + 1) % size; i != rank; i = (i + 1) % size, ++rreq) { + for (nreqs = 0, i = (rank + 1) % size; i != rank; i = (i + 1) % size, ++rreq, ++nreqs) { err = MCA_PML_CALL(irecv_init (prcv + (i * rcvinc), rcount, rdtype, i, @@ -391,7 +390,7 @@ int ompi_coll_tuned_alltoall_intra_basic_linear(void *sbuf, int scount, /* Now post all sends */ - for (i = (rank + 1) % size; i != rank; i = (i + 1) % size, ++sreq) { + for (nreqs = 0, i = (rank + 1) % size; i != rank; i = (i + 1) % size, ++sreq, ++nreqs) { err = MCA_PML_CALL(isend_init (psnd + (i * sndinc), scount, sdtype, i, @@ -403,6 +402,7 @@ int ompi_coll_tuned_alltoall_intra_basic_linear(void *sbuf, int scount, } } + nreqs = (size - 1) * 2; /* Start your engines. This will never return an error. */ MCA_PML_CALL(start(nreqs, req)); diff --git a/ompi/mca/coll/tuned/coll_tuned_bcast.c b/ompi/mca/coll/tuned/coll_tuned_bcast.c index 974448c5b1..2f48cd9979 100644 --- a/ompi/mca/coll/tuned/coll_tuned_bcast.c +++ b/ompi/mca/coll/tuned/coll_tuned_bcast.c @@ -73,10 +73,11 @@ ompi_coll_tuned_bcast_intra_chain ( void *buff, int count, /* segment the message (ompi_ddt_type_size() will never return a negative value in typelng; it returns an int [vs. an unsigned type] because of the MPI spec) */ - if (segsize < ((uint32_t) typelng)) { - segsize = typelng; /* push segsize up to hold one type */ + if (segsize < ((uint32_t)typelng)) { + segcount = 1; + } else { + segcount = segsize / typelng; } - segcount = segsize / typelng; if (segcount > count) { /* we have a single underfilled segment */ segcount = count; num_segments = 1;