1
1

fix for reduce and allreduce for an unsymmetric case

This commit was SVN r7802.
Этот коммит содержится в:
Edgar Gabriel 2005-10-18 19:20:48 +00:00
родитель 76d1a808e9
Коммит 3a7efaf4d9
3 изменённых файлов: 64 добавлений и 49 удалений

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

@ -171,8 +171,8 @@ mca_coll_hierarch_comm_query(struct ompi_communicator_t *comm, int *priority,
size = ompi_comm_size(comm); size = ompi_comm_size(comm);
if ( size == 1 ) { if ( size < 3 ) {
/* No need for hierarchical collectives . */ /* No need for hierarchical collectives for 1 or 2 procs. */
return NULL; return NULL;
} }
@ -550,10 +550,18 @@ struct ompi_communicator_t* mca_coll_hierarch_get_llcomm (int root,
continue; continue;
} }
if (llead->offset >= offset ) { if (llead->offset == offset ) {
found = 1; found = 1;
break; break;
} }
#if 0
else if () {
/* the offset of root = maxoffset of this color and
* the offset on llead is larger then offset of root.
* then we can also use this llead structure
*/
}
#endif
} }
if ( !found ) { if ( !found ) {

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

@ -61,8 +61,6 @@ int mca_coll_hierarch_allreduce_intra(void *sbuf, void *rbuf, int count,
llcomm = mca_coll_hierarch_get_llcomm ( root, data, &llroot, &lroot); llcomm = mca_coll_hierarch_get_llcomm ( root, data, &llroot, &lroot);
if ( MPI_COMM_NULL != lcomm ) { if ( MPI_COMM_NULL != lcomm ) {
lrank = ompi_comm_rank (lcomm);
if ( lrank == lroot ) {
ompi_ddt_get_extent(dtype, &lb, &extent); ompi_ddt_get_extent(dtype, &lb, &extent);
ompi_ddt_get_true_extent(dtype, &true_lb, &true_extent); ompi_ddt_get_true_extent(dtype, &true_lb, &true_extent);
@ -71,7 +69,6 @@ int mca_coll_hierarch_allreduce_intra(void *sbuf, void *rbuf, int count,
return OMPI_ERR_OUT_OF_RESOURCE; return OMPI_ERR_OUT_OF_RESOURCE;
} }
tmpbuf = tbuf - lb; tmpbuf = tbuf - lb;
}
if ( MPI_IN_PLACE != sbuf ) { if ( MPI_IN_PLACE != sbuf ) {
ret = lcomm->c_coll.coll_reduce (sbuf, tmpbuf, count, dtype, ret = lcomm->c_coll.coll_reduce (sbuf, tmpbuf, count, dtype,
@ -87,9 +84,15 @@ int mca_coll_hierarch_allreduce_intra(void *sbuf, void *rbuf, int count,
} }
if ( MPI_UNDEFINED != llroot ) { if ( MPI_UNDEFINED != llroot ) {
if ( MPI_COMM_NULL != lcomm ) {
ret = llcomm->c_coll.coll_allreduce (tmpbuf, rbuf, count, dtype, ret = llcomm->c_coll.coll_allreduce (tmpbuf, rbuf, count, dtype,
op, llcomm); op, llcomm);
} }
else {
ret = llcomm->c_coll.coll_allreduce (sbuf, rbuf, count, dtype,
op, llcomm);
}
}
if ( MPI_COMM_NULL != lcomm ) { if ( MPI_COMM_NULL != lcomm ) {
ret = lcomm->c_coll.coll_bcast(rbuf, count, dtype, lroot, lcomm ); ret = lcomm->c_coll.coll_bcast(rbuf, count, dtype, lroot, lcomm );

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

@ -60,8 +60,6 @@ int mca_coll_hierarch_reduce_intra(void *sbuf, void *rbuf, int count,
llcomm = mca_coll_hierarch_get_llcomm ( root, data, &llroot, &lroot); llcomm = mca_coll_hierarch_get_llcomm ( root, data, &llroot, &lroot);
if ( MPI_COMM_NULL != lcomm ) { if ( MPI_COMM_NULL != lcomm ) {
lrank = ompi_comm_rank (lcomm);
if ( lrank == lroot ) {
ompi_ddt_get_extent(dtype, &lb, &extent); ompi_ddt_get_extent(dtype, &lb, &extent);
ompi_ddt_get_true_extent(dtype, &true_lb, &true_extent); ompi_ddt_get_true_extent(dtype, &true_lb, &true_extent);
@ -70,7 +68,7 @@ int mca_coll_hierarch_reduce_intra(void *sbuf, void *rbuf, int count,
return OMPI_ERR_OUT_OF_RESOURCE; return OMPI_ERR_OUT_OF_RESOURCE;
} }
tmpbuf = tbuf - lb; tmpbuf = tbuf - lb;
}
if ( MPI_IN_PLACE != sbuf ) { if ( MPI_IN_PLACE != sbuf ) {
ret = lcomm->c_coll.coll_reduce (sbuf, tmpbuf, count, dtype, ret = lcomm->c_coll.coll_reduce (sbuf, tmpbuf, count, dtype,
@ -86,9 +84,15 @@ int mca_coll_hierarch_reduce_intra(void *sbuf, void *rbuf, int count,
} }
if ( MPI_UNDEFINED != llroot ) { if ( MPI_UNDEFINED != llroot ) {
if ( MPI_COMM_NULL != lcomm ) {
ret = llcomm->c_coll.coll_reduce (tmpbuf, rbuf, count, dtype, ret = llcomm->c_coll.coll_reduce (tmpbuf, rbuf, count, dtype,
op, llroot, llcomm); op, llroot, llcomm);
} }
else {
ret = llcomm->c_coll.coll_reduce (sbuf, rbuf, count, dtype,
op, llroot, llcomm);
}
}
exit: exit:
if ( NULL != tmpbuf ) { if ( NULL != tmpbuf ) {