On 05/04/2017 02:45 PM, Weixiong Zheng wrote:

Great! I looked at Utilities::MPI::sum() and it might be exactly what I
need.

Do I use it in this way?

double global_quantity = 0;

for locally_owned_cell
  quantity += local_cell_contribution

Utilities::MPI::sum(global_quantity, mpi_communicator);

Yes, this is exactly how it's done (though you need to assign the result of the last call to something), i.e.
  global_quantity = Utilities::MPI::sum(quantity, mpi_communicator);

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
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.

Reply via email to