родитель
387ee0ad29
Коммит
039fed1973
@ -347,8 +347,6 @@ mca_coll_basic_reduce_log_intra(void *sbuf, void *rbuf, int count,
|
|||||||
vrank = ompi_op_is_commute(op) ? (rank - root + size) % size : rank;
|
vrank = ompi_op_is_commute(op) ? (rank - root + size) % size : rank;
|
||||||
dim = comm->c_cube_dim;
|
dim = comm->c_cube_dim;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Allocate the incoming and resulting message buffers. See lengthy
|
/* Allocate the incoming and resulting message buffers. See lengthy
|
||||||
* rationale above. */
|
* rationale above. */
|
||||||
|
|
||||||
@ -373,7 +371,8 @@ mca_coll_basic_reduce_log_intra(void *sbuf, void *rbuf, int count,
|
|||||||
if (MPI_IN_PLACE == sbuf) {
|
if (MPI_IN_PLACE == sbuf) {
|
||||||
inplace_temp = (char*)malloc(true_extent + (count - 1) * extent);
|
inplace_temp = (char*)malloc(true_extent + (count - 1) * extent);
|
||||||
if (NULL == inplace_temp) {
|
if (NULL == inplace_temp) {
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
err = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
|
goto cleanup_and_return;
|
||||||
}
|
}
|
||||||
sbuf = inplace_temp - lb;
|
sbuf = inplace_temp - lb;
|
||||||
err = ompi_ddt_copy_content_same_ddt(dtype, count, (char*)sbuf, (char*)rbuf);
|
err = ompi_ddt_copy_content_same_ddt(dtype, count, (char*)sbuf, (char*)rbuf);
|
||||||
@ -386,8 +385,8 @@ mca_coll_basic_reduce_log_intra(void *sbuf, void *rbuf, int count,
|
|||||||
* here to be valid on all non-leaf ranks */
|
* here to be valid on all non-leaf ranks */
|
||||||
free_rbuf = (char*)malloc(true_extent + (count - 1) * extent);
|
free_rbuf = (char*)malloc(true_extent + (count - 1) * extent);
|
||||||
if (NULL == free_rbuf) {
|
if (NULL == free_rbuf) {
|
||||||
free(free_buffer);
|
err = OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
goto cleanup_and_return;
|
||||||
}
|
}
|
||||||
rbuf = free_rbuf - lb;
|
rbuf = free_rbuf - lb;
|
||||||
}
|
}
|
||||||
@ -408,13 +407,7 @@ mca_coll_basic_reduce_log_intra(void *sbuf, void *rbuf, int count,
|
|||||||
dtype, peer, MCA_COLL_BASE_TAG_REDUCE,
|
dtype, peer, MCA_COLL_BASE_TAG_REDUCE,
|
||||||
MCA_PML_BASE_SEND_STANDARD, comm));
|
MCA_PML_BASE_SEND_STANDARD, comm));
|
||||||
if (MPI_SUCCESS != err) {
|
if (MPI_SUCCESS != err) {
|
||||||
if (NULL != free_buffer) {
|
goto cleanup_and_return;
|
||||||
free(free_buffer);
|
|
||||||
}
|
|
||||||
if (NULL != free_rbuf) {
|
|
||||||
free(free_rbuf);
|
|
||||||
}
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
snd_buffer = (char*)rbuf;
|
snd_buffer = (char*)rbuf;
|
||||||
break;
|
break;
|
||||||
@ -445,13 +438,7 @@ mca_coll_basic_reduce_log_intra(void *sbuf, void *rbuf, int count,
|
|||||||
MCA_COLL_BASE_TAG_REDUCE, comm,
|
MCA_COLL_BASE_TAG_REDUCE, comm,
|
||||||
MPI_STATUS_IGNORE));
|
MPI_STATUS_IGNORE));
|
||||||
if (MPI_SUCCESS != err) {
|
if (MPI_SUCCESS != err) {
|
||||||
if (NULL != free_buffer) {
|
goto cleanup_and_return;
|
||||||
free(free_buffer);
|
|
||||||
}
|
|
||||||
if (NULL != free_rbuf) {
|
|
||||||
free(free_rbuf);
|
|
||||||
}
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
/* Perform the operation. The target is always the user
|
/* Perform the operation. The target is always the user
|
||||||
* provided buffer We do the operation only if we receive it
|
* provided buffer We do the operation only if we receive it
|
||||||
@ -500,6 +487,7 @@ mca_coll_basic_reduce_log_intra(void *sbuf, void *rbuf, int count,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleanup_and_return:
|
||||||
if (NULL != inplace_temp) {
|
if (NULL != inplace_temp) {
|
||||||
free(inplace_temp);
|
free(inplace_temp);
|
||||||
}
|
}
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user