1
1

Small cleanups, some explicit casts.

This commit was SVN r12494.
Этот коммит содержится в:
George Bosilca 2006-11-08 16:54:03 +00:00
родитель 74d3946342
Коммит 0914892044
10 изменённых файлов: 22 добавлений и 30 удалений

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

@ -106,14 +106,9 @@ mca_coll_basic_allgather_inter(void *sbuf, int scount,
struct ompi_datatype_t *rdtype, struct ompi_datatype_t *rdtype,
struct ompi_communicator_t *comm) struct ompi_communicator_t *comm)
{ {
int rank; int rank, root = 0, size, rsize, err, i;
int root = 0;
int size, rsize;
int err;
int i;
char *tmpbuf = NULL, *ptmp; char *tmpbuf = NULL, *ptmp;
ptrdiff_t rlb, slb, rextent, sextent; ptrdiff_t rlb, slb, rextent, sextent, incr;
ptrdiff_t incr;
ompi_request_t *req; ompi_request_t *req;
ompi_request_t **reqs = comm->c_coll_basic_data->mccb_reqs; 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_op_t *op,
struct ompi_communicator_t *comm) struct ompi_communicator_t *comm)
{ {
int err, i; int err, i, rank, root = 0, rsize;
int rank;
int root = 0;
int rsize;
ptrdiff_t lb, extent; ptrdiff_t lb, extent;
char *tmpbuf = NULL, *pml_buffer = NULL; char *tmpbuf = NULL, *pml_buffer = NULL;
ompi_request_t *req[2]; 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. */ /* Initiate all send/recv to/from others. */
nreqs = (size - 1) * 2;
req = rreq = comm->c_coll_basic_data->mccb_reqs; req = rreq = comm->c_coll_basic_data->mccb_reqs;
sreq = rreq + size - 1; sreq = rreq + size - 1;
@ -100,31 +99,32 @@ mca_coll_basic_alltoall_intra(void *sbuf, int scount,
/* Post all receives first -- a simple optimization */ /* 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 = err =
MCA_PML_CALL(irecv_init MCA_PML_CALL(irecv_init
(prcv + (i * rcvinc), rcount, rdtype, i, (prcv + (i * rcvinc), rcount, rdtype, i,
MCA_COLL_BASE_TAG_ALLTOALL, comm, rreq)); MCA_COLL_BASE_TAG_ALLTOALL, comm, rreq));
if (MPI_SUCCESS != err) { if (MPI_SUCCESS != err) {
mca_coll_basic_free_reqs(req, rreq - req); mca_coll_basic_free_reqs(req, nreqs);
return err; return err;
} }
} }
/* Now post all sends */ /* 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 = err =
MCA_PML_CALL(isend_init MCA_PML_CALL(isend_init
(psnd + (i * sndinc), scount, sdtype, i, (psnd + (i * sndinc), scount, sdtype, i,
MCA_COLL_BASE_TAG_ALLTOALL, MCA_COLL_BASE_TAG_ALLTOALL,
MCA_PML_BASE_SEND_STANDARD, comm, sreq)); MCA_PML_BASE_SEND_STANDARD, comm, sreq));
if (MPI_SUCCESS != err) { if (MPI_SUCCESS != err) {
mca_coll_basic_free_reqs(req, sreq - req); mca_coll_basic_free_reqs(req, nreqs);
return err; return err;
} }
} }
nreqs = (size - 1) * 2;
/* Start your engines. This will never return an error. */ /* Start your engines. This will never return an error. */
MCA_PML_CALL(start(nreqs, req)); MCA_PML_CALL(start(nreqs, req));

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

@ -47,7 +47,7 @@ mca_coll_basic_alltoallv_intra(void *sbuf, int *scounts, int *sdisps,
int err; int err;
char *psnd; char *psnd;
char *prcv; char *prcv;
size_t nreqs; int nreqs;
MPI_Aint sndextent; MPI_Aint sndextent;
MPI_Aint rcvextent; MPI_Aint rcvextent;
MPI_Request *preq; MPI_Request *preq;

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

@ -46,7 +46,7 @@ mca_coll_basic_alltoallw_intra(void *sbuf, int *scounts, int *sdisps,
int err; int err;
char *psnd; char *psnd;
char *prcv; char *prcv;
size_t nreqs; int nreqs;
MPI_Request *preq; MPI_Request *preq;
/* Initialize. */ /* Initialize. */
@ -159,7 +159,7 @@ mca_coll_basic_alltoallw_inter(void *sbuf, int *scounts, int *sdisps,
int err; int err;
char *psnd; char *psnd;
char *prcv; char *prcv;
size_t nreqs; int nreqs;
MPI_Request *preq; MPI_Request *preq;
/* Initialize. */ /* Initialize. */

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

@ -161,7 +161,7 @@ mca_coll_basic_bcast_log_intra(void *buff, int count,
MCA_PML_BASE_SEND_STANDARD, MCA_PML_BASE_SEND_STANDARD,
comm, preq++)); comm, preq++));
if (MPI_SUCCESS != err) { if (MPI_SUCCESS != err) {
mca_coll_basic_free_reqs(reqs, preq - reqs); mca_coll_basic_free_reqs(reqs, nreqs);
return err; return err;
} }
} }

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

@ -46,8 +46,7 @@ mca_coll_basic_reduce_scatter_intra(void *sbuf, void *rbuf, int *rcounts,
int i, err, rank, size, count; int i, err, rank, size, count;
ptrdiff_t true_lb, true_extent, lb, extent; ptrdiff_t true_lb, true_extent, lb, extent;
int *disps = NULL; int *disps = NULL;
char *free_buffer = NULL; char *free_buffer = NULL, *pml_buffer = NULL;
char *pml_buffer = NULL;
/* Initialize */ /* Initialize */

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

@ -247,7 +247,7 @@ static int sm_open(void)
mca_base_param_reg_int(c, "shared_mem_used_bootstrap", mca_base_param_reg_int(c, "shared_mem_used_bootstrap",
"Amount of shared memory used in the shared memory bootstrap area (in bytes)", "Amount of shared memory used in the shared memory bootstrap area (in bytes)",
false, true, false, true,
size1, NULL); (int)size1, NULL);
/* Calculate how much space we need in the data mpool. This /* Calculate how much space we need in the data mpool. This
formula taken directly from coll_sm_module.c. */ 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", 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)", "Amount of shared memory used in the shared memory data area for info_num_procs processes (in bytes)",
false, true, false, true,
size2, NULL); (int)size2, NULL);
return OMPI_SUCCESS; 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. */ /* Initiate all send/recv to/from others. */
nreqs = (size - 1) * 2;
req = rreq = comm->c_coll_basic_data->mcct_reqs; req = rreq = comm->c_coll_basic_data->mcct_reqs;
sreq = rreq + size - 1; 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 */ /* 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 = err =
MCA_PML_CALL(irecv_init MCA_PML_CALL(irecv_init
(prcv + (i * rcvinc), rcount, rdtype, i, (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 */ /* 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 = err =
MCA_PML_CALL(isend_init MCA_PML_CALL(isend_init
(psnd + (i * sndinc), scount, sdtype, i, (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. */ /* Start your engines. This will never return an error. */
MCA_PML_CALL(start(nreqs, req)); 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 a negative value in typelng; it returns an int [vs. an
unsigned type] because of the MPI spec) */ unsigned type] because of the MPI spec) */
if (segsize < ((uint32_t)typelng)) { if (segsize < ((uint32_t)typelng)) {
segsize = typelng; /* push segsize up to hold one type */ segcount = 1;
} } else {
segcount = segsize / typelng; segcount = segsize / typelng;
}
if (segcount > count) { /* we have a single underfilled segment */ if (segcount > count) { /* we have a single underfilled segment */
segcount = count; segcount = count;
num_segments = 1; num_segments = 1;