On 4/23/19 11:48 AM, Moraad Biagooi wrote:

> In MPI part, that is developed from tutorial step-40, I need to use 
> 'Point_value' and 'Point_gradient' template functions.
> 
> My question is, how should I use these functions when the cells of these 
> points are not (necessarily) locally owned?
> 
> Should I broadcast the Point to all the processes and find the correct 
> process that owns the cell, then get the value from it? (This looks very 
> slow).

Yes, that seems like the correct answer. Alternatively, you probably 
have a way to figure out which points need to be evaluated, and each 
processor could do this independently. For example, if the list of 
points comes from a file, let every processor read this file. If they 
are algorithmicly generated, let every processor generate the entire 
list. Then you don't need communication to exchange the points since 
every processor already knows.

Then you can just loop over all points and take the values returned for 
points that are on locally owned cells; you would simply catch and 
ignore the exception you get for all points that can not be evaluated 
locally.


Maybe as a general rule: Exchanging one piece of data like this is not 
really very expensive. You have to realize that when solving a linear 
system, you will likely have hundreds of communication steps between all 
processors, many of which block execution until they are finished. 
*This* is expensive, whereas a single communication to exchange points 
or point values is really not something you will ever notice, unless you 
do it dozens of times per solve.

Best
  W.


-- 
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 [email protected]
                            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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to