[Users] GF information question

Erik Schnetter schnetter at cct.lsu.edu
Thu Nov 19 23:33:28 CST 2015


On Thu, Nov 19, 2015 at 11:05 PM, Frank Loeffler <knarf at cct.lsu.edu> wrote:

> On Fri, Nov 20, 2015 at 04:41:48AM +0000, Garrison, David wrote:
> > How do you find the number of non-zero elements in a Grid Function in
> Cactus?
>
> The best way would probably be to count them locally on each process,
> write the result in a distributed grid array, and do the sum there by
> syncing the array and counting locally (not sure if a reduction on such
> an array would work, it might).
>

There is no need for a distributed grid array. After counting locally, a
"local reduction" (i.e. reduction of a local variable) gives you the
overall result.

-erik

Another, but more expensive way (in terms of memory size and memory
> accesses) would be to create another grid function, populate it with
> either 1 or 0 depending on the non-zero-property of the GF you are
> interested in, and calling the existing sum-reduction on it.
>
> Frank
>
>
> _______________________________________________
> Users mailing list
> Users at einsteintoolkit.org
> http://lists.einsteintoolkit.org/mailman/listinfo/users
>
>


-- 
Erik Schnetter <schnetter at cct.lsu.edu>
http://www.perimeterinstitute.ca/personal/eschnetter/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/users/attachments/20151119/f654842f/attachment.html 


More information about the Users mailing list