[Users] global reductions in specified domains

Roland Haas rhaas at tapir.caltech.edu
Fri Nov 15 10:39:44 CST 2013


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


More information about the Users mailing list