[Users] global reductions in specified domains
Vassilios Mewes
vassilios.mewes at uv.es
Fri Nov 15 12:45:36 CST 2013
Thanks a lot, I will try this!
best wishes,
Vassili
On Fri, Nov 15, 2013 at 5:39 PM, Roland Haas <rhaas at tapir.caltech.edu>wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello Vassilios,
>
> > and then reduce over all radial shells
> >
> > for(int iradii=0; iradii < nradii; iradii ++) {
> > CCTK_Reduce(cctkGH,-1, &rho_total_shell[iradii], CCTK_VAR =
> > rho_in_shell[iradii]) }
> >
> > would that be an option? or even work?
> Yes, that is essentially option 2 that I had outlined. You need to
> modify your first loop to be CCTK_LOOP3_INTBND (described in the user
> guide, be careful when trying to use OpenMP since rho_in_shell[iradii]
> might see contributions from different threads) so that you exclude
> ghost zones. You also have to multiply rhop[i3D] by CarpetReduce's
> weight function (easiest is to inherit from CarpetReduce which will
> give you access to the grid function). You can do the Reduction all in
> one MPI call if you'd like:
>
> const int op_sum = CCTK_ReductionArrayHandle("sum");
> const int ierr = CCTK_ReduceArray(cctkGH,-1, op_sum, nradii,
> CCTK_VARIABLE_REAL, rho_total_shell, 1/*num_dims*/,
> 1/*num_in_arrays*/, CCTK_VARIALBE_REAL, nradii, rho_in_shell);
>
> or one of of the 1D ArrayToArray helper routines
> (CCTK_ReduceLocArrayToArray1D) described in the user guide.
>
> Yours,
> Roland
>
> - --
> My email is as private as my paper mail. I therefore support encrypting
> and signing email messages. Get my PGP key from http://keys.gnupg.net.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.15 (GNU/Linux)
> Comment: Using GnuPG with Icedove - http://www.enigmail.net/
>
> iEYEARECAAYFAlKGTk8ACgkQTiFSTN7SboWrIgCgzzgU3hS/FzvXTzyzup9b0Tt0
> 3WYAoNFx6ZROsng8/gHVysQ68zp7os1r
> =nH9a
> -----END PGP SIGNATURE-----
> _______________________________________________
> Users mailing list
> Users at einsteintoolkit.org
> http://lists.einsteintoolkit.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/users/attachments/20131115/65387a67/attachment.html
More information about the Users
mailing list