More on \( MPI\_Reduce \)

In our case, since we are summing the rectangle contributions from every process we define \( MPI\_Op = MPI\_SUM \). If we have an array or matrix we can search for the largest og smallest element by sending either \( MPI\_MAX \) or \( MPI\_MIN \). If we want the location as well (which array element) we simply transfer \( MPI\_MAXLOC \) or \( MPI\_MINOC \). If we want the product we write \( MPI\_PROD \).

\( MPI\_Allreduce \) is defined as

MPI_Allreduce( void *senddata, void* resultdata, int count, 
          MPI_Datatype datatype, MPI_Op, MPI_Comm comm)