1
1

Remove dead/redundant code. Minimize number of calloc invocations

This commit was SVN r20121.
Этот коммит содержится в:
Nysal Jan 2008-12-12 10:55:50 +00:00
родитель 7631eb8eed
Коммит ee8ec6f6b5
3 изменённых файлов: 8 добавлений и 21 удалений

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

@ -141,14 +141,11 @@ int ompi_coll_tuned_allgatherv_intra_bruck(void *sbuf, int scount,
blockcount = 1;
tmpsend = (char*) rbuf;
new_rcounts = (int*) calloc(size, sizeof(int));
new_rcounts = (int*) calloc(4*size, sizeof(int));
if (NULL == new_rcounts) { err = -1; line = __LINE__; goto err_hndl; }
new_rdispls = (int*) calloc(size, sizeof(int));
if (NULL == new_rdispls) { err = -1; line = __LINE__; goto err_hndl; }
new_scounts = (int*) calloc(size, sizeof(int));
if (NULL == new_scounts) { err = -1; line = __LINE__; goto err_hndl; }
new_sdispls = (int*) calloc(size, sizeof(int));
if (NULL == new_sdispls) { err = -1; line = __LINE__; goto err_hndl; }
new_rdispls = new_rcounts + size;
new_scounts = new_rdispls + size;
new_sdispls = new_scounts + size;
for (distance = 1; distance < size; distance<<=1) {
@ -193,17 +190,11 @@ int ompi_coll_tuned_allgatherv_intra_bruck(void *sbuf, int scount,
}
free(new_rcounts);
free(new_rdispls);
free(new_scounts);
free(new_sdispls);
return OMPI_SUCCESS;
err_hndl:
if( NULL != new_rcounts ) free(new_rcounts);
if( NULL != new_rdispls ) free(new_rdispls);
if( NULL != new_scounts ) free(new_scounts);
if( NULL != new_sdispls ) free(new_sdispls);
OPAL_OUTPUT((ompi_coll_tuned_stream, "%s:%4d\tError occurred %d, rank %2d",
__FILE__, line, err, rank));

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

@ -542,8 +542,7 @@ int ompi_coll_tuned_allgather_intra_dec_fixed(void *sbuf, int scount,
" rank %d com_size %d msg_length %lu",
ompi_comm_rank(comm), communicator_size, (unsigned long)total_dsize));
for (pow2_size = 1; pow2_size <= communicator_size; pow2_size <<=1);
pow2_size >>=1;
for (pow2_size = 1; pow2_size < communicator_size; pow2_size <<=1);
/* Decision based on MX 2Gb results from Grig cluster at
The University of Tennesse, Knoxville
@ -618,7 +617,7 @@ int ompi_coll_tuned_allgatherv_intra_dec_fixed(void *sbuf, int scount,
mca_coll_base_module_t *module)
{
int i;
int communicator_size, pow2_size;
int communicator_size;
size_t dsize, total_dsize;
communicator_size = ompi_comm_size(comm);
@ -642,9 +641,6 @@ int ompi_coll_tuned_allgatherv_intra_dec_fixed(void *sbuf, int scount,
" rank %d com_size %d msg_length %lu",
ompi_comm_rank(comm), communicator_size, (unsigned long)total_dsize));
for (pow2_size = 1; pow2_size <= communicator_size; pow2_size <<=1);
pow2_size >>=1;
/* Decision based on allgather decision. */
if (total_dsize < 50000) {
return ompi_coll_tuned_allgatherv_intra_bruck(sbuf, scount, sdtype,

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

@ -80,6 +80,8 @@ int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
FUNC_NAME);
} else if (MPI_IN_PLACE == recvbuf) {
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
} else if (MPI_DATATYPE_NULL == recvtype) {
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
}
if (MPI_IN_PLACE != sendbuf) {
@ -91,8 +93,6 @@ int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
for (i = 0; i < size; ++i) {
if (recvcounts[i] < 0) {
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
} else if (MPI_DATATYPE_NULL == recvtype) {
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
}
}