Skip to content

Commit

Permalink
coll: use assertion and int coercion local reduction op
Browse files Browse the repository at this point in the history
The op functions are not using large count yet.

TODO: fix this.
  • Loading branch information
hzhou committed Feb 10, 2021
1 parent ef2fca3 commit 8fc06c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/mpi/coll/reduce_local/reduce_local.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ int MPIR_Reduce_local(const void *inbuf, void *inoutbuf, MPI_Aint count, MPI_Dat
}

/* actually perform the reduction */
/* FIXME: properly support large count reduction */
MPIR_Assert(count <= INT_MAX);
int icount = (int) count;
#ifdef HAVE_CXX_BINDING
if (is_cxx_uop) {
(*MPIR_Process.cxx_call_op_fn) (inbuf, inoutbuf, count, datatype, uop);
(*MPIR_Process.cxx_call_op_fn) (inbuf, inoutbuf, icount, datatype, uop);
} else
#endif
{
Expand All @@ -68,10 +71,10 @@ int MPIR_Reduce_local(const void *inbuf, void *inoutbuf, MPI_Aint count, MPI_Dat

(*uop_f77) ((void *) inbuf, inoutbuf, &lcount, &ldtype);
} else {
(*uop) ((void *) inbuf, inoutbuf, &count, &datatype);
(*uop) ((void *) inbuf, inoutbuf, &icount, &datatype);
}
#else
(*uop) ((void *) inbuf, inoutbuf, &count, &datatype);
(*uop) ((void *) inbuf, inoutbuf, &icount, &datatype);
#endif
}

Expand Down

0 comments on commit 8fc06c9

Please sign in to comment.