diff options
author | yye00 <yye00@eff87b29-5268-4891-90a3-a07138403961> | 2005-11-02 17:28:39 +0000 |
---|---|---|
committer | yye00 <yye00@eff87b29-5268-4891-90a3-a07138403961> | 2005-11-02 17:28:39 +0000 |
commit | 731ae5f566092ad3fc89f038005dc9968efd6bcc (patch) | |
tree | 71969983c592764dd28935bfba9360f734ea4a59 | |
parent | 9b62bad6526158b670eb5b289a92368154aa4ba5 (diff) |
change to use new reduction api
git-svn-id: http://svn.cactuscode.org/arrangements/CactusIO/IOJpeg/trunk@118 eff87b29-5268-4891-90a3-a07138403961
-rw-r--r-- | src/Write.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/Write.c b/src/Write.c index faf87ef..fb33d5a 100644 --- a/src/Write.c +++ b/src/Write.c @@ -83,7 +83,16 @@ int IOJpeg_Write (const cGH *GH, CCTK_INT vindex, const char *alias) CCTK_REAL min, max; const CCTK_INT htype = CCTK_VARIABLE_REAL; DECLARE_CCTK_PARAMETERS + + /* Reduction variables */ + int input_array[1]; + CCTK_INT input_array_type_codes[1]; + void* value_min[1], *value_max[1]; + input_array_type_codes[0] = CCTK_VARIABLE_REAL; + input_array[0] = vindex; + value_min[0] = &min; + value_max[0] = &max; /* get the variable name and group information */ fullname = CCTK_FullName (vindex); @@ -111,10 +120,10 @@ int IOJpeg_Write (const cGH *GH, CCTK_INT vindex, const char *alias) } else { - i = CCTK_ReductionHandle ("minimum"); - CCTK_Reduce (GH, 0, i, 1, CCTK_VARIABLE_REAL, &min, 1, vindex); - i = CCTK_ReductionHandle ("maximum"); - CCTK_Reduce (GH, 0, i, 1, CCTK_VARIABLE_REAL, &max, 1, vindex); + i = CCTK_LocalArrayReductionHandle ("minimum"); + i = CCTK_ReduceGridArrays (GH, 0, i, -1, 1, input_array , 1, input_array_type_codes, value_min); + i = CCTK_LocalArrayReductionHandle ("maximum"); + i = CCTK_ReduceGridArrays (GH, 0, i, -1, 1, input_array , 1, input_array_type_codes, value_max); } /* get the number of slices to output */ |