Small cleanups, some explicit casts.
This commit was SVN r12494.
Этот коммит содержится в:
родитель
74d3946342
Коммит
0914892044
@ -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;
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
|
@ -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. */
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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));
|
||||
|
@ -74,9 +74,10 @@ ompi_coll_tuned_bcast_intra_chain ( void *buff, int count,
|
||||
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 */
|
||||
}
|
||||
segcount = 1;
|
||||
} else {
|
||||
segcount = segsize / typelng;
|
||||
}
|
||||
if (segcount > count) { /* we have a single underfilled segment */
|
||||
segcount = count;
|
||||
num_segments = 1;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user