[Users] CCTK_ReductionArrayHandle
Luca Baiotti
baiotti at ile.osaka-u.ac.jp
Thu Aug 2 03:26:22 CDT 2012
On 8/2/12 4:11 PM, Roland Haas wrote:
>> CCTK_ReductionArrayHandle is used in several thorns but it is not
>> described in the ReferenceManual. Is it (still) supported?
>> How is it different from CCTK_LocalArrayReductionHandle?
> It's part of the "old" reduction interface. Which happens to be the one
> Carpet supports, so it is widely used :-). I doubt support will go away
> anytime soon. The calls are documented in the User manual in section
> C1.7.5 (page 84 in my build).
I see, so CCTK_ReductionArrayHandle is described in the User's Manual
but not in the Reference Manual.
> As for differences I'd consult this section and the reference manual. It
> seems that one is a reduction over local arrays (ie double a[100]) while
> the other reduces grid functions (or grid arrays or grid scalars most
> likely).
I found no reference saying that CCTK_ReductionArrayHandle should be
used only for local arrays or only for grid functions.
Which of the two codes below is correct (in a subroutine called by the
scheduler)? Why?
1)
CCTK_REAL local_array_in,local_array_out;
CCTK_INT handle = CCTK_LocalArrayReductionHandle("sum");
CCTK_ReduceLocArrayToArray1D(cctkGH, -1, handle, &local_array_in,
local_array_out, 4, CCTK_VARIABLE_REAL));
2)
CCTK_REAL local_array_in,local_array_out;
CCTK_INT handle_sum = CCTK_ReductionHandle("sum");
CCTK_ReduceLocArrayToArray1D(cctkGH, -1, handle, &local_array_in,
local_array_out, 4, CCTK_VARIABLE_REAL));
Best,
Luca
More information about the Users
mailing list