Hello Roland,

another question on this topic i am trying to wrap my head around:

actually, i am not performing those processor local "integrals" on grid variables, but the result is a new variable (i just chose rho in the example pseudocode i wrote on friday)

now my problem is the scheduling...

i have different radial shells, and a function that computes the "processor-local" value of the quantity i want to sum (which is defined as a type=scalar in my interface.ccl...

in order to be able to do that, i need to schedule my thorn as global loop-local, otherwise i get failed assertions in the loop macros..

now my question is the following:

how can i now perform the reduction on this "processor-local" quantity?

if i write a new function, will it have access to all the instances every processor creates? 

if i calculate the reduction inside the "processor-local" function, will it work? because the function is global loop-local and i will need a loop to perform the integration on every shell i specify..

i tried to manually change modes using the carpet c++ macros, but that has led to segmentation faults only so far...

any idea how i could do that?

best wishes,

Vassili


On Fri, Nov 15, 2013 at 7:45 PM, Vassilios Mewes <vassilios.mewes@uv.es> wrote:
Thanks a lot, I will try this!

best wishes,

Vassili


On Fri, Nov 15, 2013 at 5:39 PM, Roland Haas <rhaas@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@einsteintoolkit.org
http://lists.einsteintoolkit.org/mailman/listinfo/users