diff options
Diffstat (limited to 'src/Flat.c')
-rw-r--r-- | src/Flat.c | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -71,7 +71,17 @@ int SORFlat3D(cGH *GH, int FieldIndex, int MIndex, int NIndex, CCTK_REAL dx2rec, dy2rec, dz2rec; char *robin = NULL; char *sor_accel = NULL; - + int ierr = 0; + const void* input_array[1]; + void* reduction_value[1]; + int input_array_dim[1]; + int input_array_type_codes[1]; + + input_array[0] = (CCTK_REAL *)&resnorm; + input_array_dim[0] = 0; + reduction_value[0] = (CCTK_REAL *)&glob_residual; + input_array_type_codes[0] = CCTK_VARIABLE_REAL; + /* Boundary conditions */ int use_robin = 0; @@ -79,7 +89,7 @@ int SORFlat3D(cGH *GH, int FieldIndex, int MIndex, int NIndex, RelTol = RelTol; /* Get the reduction handle */ - sum_handle = CCTK_ReductionArrayHandle("sum"); + sum_handle = CCTK_LocalArrayReductionHandle("sum"); if (sum_handle<0) { CCTK_WARN(1,"SORFlat3D: Cannot get reduction handle for sum operation"); @@ -285,11 +295,16 @@ int SORFlat3D(cGH *GH, int FieldIndex, int MIndex, int NIndex, } } } - + /* reduction operation on processor-local residual values */ - - if (CCTK_ReduceLocScalar(GH, -1, sum_handle, - &resnorm, &glob_residual, CCTK_VARIABLE_REAL)<0) + ierr = ierr = CCTK_ReduceArraysGlobally(GH, -1,sum_handle, -1, 1,input_array,0, + input_array_dim, + input_array_type_codes, + 1, + input_array_type_codes, + reduction_value); + + if (ierr<0) { CCTK_WARN(1,"SORFlat3D: Reduction of Norm failed"); } |