Seyed, What I understood so far is, that the Utilities::MPI::max() function > computes the maximum between all processors for each row of my vector. This > means if I have a vector of 20 entries, each entry has 8 values distributed > on 8 cores for instance. As a result, I get 20 maximum values again, but > this time they are maximal and processor independent. > Correct.
> Hence, my question now is how am I able to check where the maximum value > comes from? Is it possible to output the processor number of the maximum > value for each row? > If you look at the implementation of Utilities::MPI::max() [2], you see that this is essentially a wrapper around MPI_Allreduce called in [3]. What you want is currently not implemented in deal.II, but MPI_MAXLOC is exactly doing this. Example 3 in [1] shows how to use this, i.e. - copy your std::vector into a struct containing a value and the MPI process number - call MPI_Allreduce( in_struct, out_struct, vector.size(), MPI_DOUBLE_INT, MPI_MAXLOC, mpi_communicator); - the maximum value and the number of the first process with that value for each entry of your vector is stored in out_struct My aim is to find the node where the maximum value exists. This is somehow > cumbersome in parallel mode since I have to store information about the > current CPU core, cell ID and node number. Then somehow use my previously > shown distance function in C++ and check the position of the maximum value > with regard to the geometry structure I stored. > If you save the cells/positions containing the maximum values for each process before comparing these across processes, you should be fine with this approach. Best, Daniel [1] https://www.open-mpi.org/doc/v2.0/man3/MPI_Reduce.3.php [2] https://www.dealii.org/8.4.0/doxygen/deal.II/mpi_8h_source.html#l00708 [3] https://www.dealii.org/8.4.0/doxygen/deal.II/mpi_8h_source.html#l00544 -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.