Commit 8228d5ef authored by Kirill Nikitin's avatar Kirill Nikitin

Parallel: added AggregateMax functions

Added MPI_Allreduce wrapper with MPI_MAX operation.
parent 5e041bc3
......@@ -993,6 +993,8 @@ namespace INMOST
Storage::integer Integrate(Storage::integer input);
Storage::integer ExclusiveSum(Storage::integer input);
Storage::real Integrate(Tag t,ElementType mask);
Storage::real AggregateMax(Storage::real input);
Storage::integer AggregateMax(Storage::integer input);
void RecomputeParallelStorage(ElementType mask);
__INLINE const Tag SendtoTag() const {return tag_sendto;}
__INLINE const Tag SharedTag() const {return tag_shared;}
......
......@@ -255,8 +255,23 @@ namespace INMOST
return output;
}
Storage::real Mesh::AggregateMax(Storage::real input)
{
Storage::real output = input;
#if defined(USE_MPI)
MPI_Allreduce(&input,&output,1,INMOST_MPI_DATA_REAL_TYPE,MPI_MAX,comm);
#endif
return output;
}
Storage::integer Mesh::AggregateMax(Storage::integer input)
{
Storage::integer output = input;
#if defined(USE_MPI)
MPI_Allreduce(&input,&output,1,INMOST_MPI_DATA_INTEGER_TYPE,MPI_MAX,comm);
#endif
return output;
}
void DefaultUnpack(Tag tag, Element * element, INMOST_DATA_BULK_TYPE * data, INMOST_DATA_ENUM_TYPE size)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment