diff options
author | yye00 <yye00@7daa882c-dc44-4453-834e-278d26b18e6a> | 2004-08-26 10:40:09 +0000 |
---|---|---|
committer | yye00 <yye00@7daa882c-dc44-4453-834e-278d26b18e6a> | 2004-08-26 10:40:09 +0000 |
commit | 1f543eb0efb2ef00fea2ac2829b41ec7a9994ede (patch) | |
tree | cb50e2ca38f5589bfdaeeca4297d02ce78dc6294 /src/ReductionMin.c | |
parent | 6e38661972bac728bd5bf1887ecf521e53c2c8d0 (diff) |
continuing cleaning ...
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/LocalReduce/trunk@28 7daa882c-dc44-4453-834e-278d26b18e6a
Diffstat (limited to 'src/ReductionMin.c')
-rw-r--r-- | src/ReductionMin.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/ReductionMin.c b/src/ReductionMin.c index 5ad29ea..c0fd0c0 100644 --- a/src/ReductionMin.c +++ b/src/ReductionMin.c @@ -1,7 +1,7 @@ /*@@ @file ReductionMin.c - @date Thu Apr 3 11:54:53 1997 - @author Thomas Radke, Paul Walker, Erik Schnetter + @date + @author Tom Goodale, Yaakoub Y El Khamra @desc Defines the reduction operator to get the average of an arbitrary array. @@ -35,9 +35,9 @@ static int ReductionMin (int N_dims, int operator_handle, /*@@ - @routine LocalReduce_Mean - @author Thomas Radke - @date 19 Aug 1999 + @routine LocalReduce_Min + @author Yaakoub Y El Khamra + @date @desc @enddesc @history @@ -93,7 +93,7 @@ static int ReductionMin (int N_dims, int operator_handle, @vio in @endvar @@*/ -int LocalReduce_Mean (int N_dims, int operator_handle, +int LocalReduce_Min (int N_dims, int operator_handle, int param_table_handle, int N_input_arrays, const CCTK_INT input_array_dims[], const CCTK_INT input_array_type_codes[], @@ -118,7 +118,7 @@ int LocalReduce_Mean (int N_dims, int operator_handle, /*@@ @routine ReductionMin @date Aug 19 1999 - @author Thomas Radke + @author Tom Goodale, Yaakoub Y El Khamra @desc Returns the average of a distributed array with 'num_points' elements. Global reduction is done element-wise (num_outvals == 1) or on the results of the local reductions. @@ -137,8 +137,6 @@ static int ReductionMin (int N_dims, int operator_handle, int i, j, k, flag, product, num_points; int ierr; int * iters_per_dim; - void * data_pointer[10]; - void * output_buffer[10]; /* indices to hold the temp indices of size N_dims and iteration indices*/ int * indices; @@ -163,9 +161,6 @@ static int ReductionMin (int N_dims, int operator_handle, CCTK_INT mask_offset; CCTK_INT mask_time_level; - - - /* set the number of points */ num_points = 0; @@ -246,9 +241,9 @@ static int ReductionMin (int N_dims, int operator_handle, #undef REDUCTION_INITIAL #undef EXTRA_STEP -#define REDUCTION_OPERATION(Min, scalar) if (Min > scalar) Min = scalar; +#define REDUCTION_OPERATION(Max, scalar) if (Max > scalar) Max = scalar; #define REDUCTION_INITIAL(num) num = 0; -#define EXTRA_STEP(a, b); +#define EXTRA_STEP(a, b) for (i = 0; i < N_input_arrays; i++) { @@ -1230,6 +1225,16 @@ static int ReductionMin (int N_dims, int operator_handle, #endif } } + + /* free memory */ + free (iters_per_dim); + free (indices); + free (actual_indices); + free (actual_iters_per_dim); + free (input_array_offsets); + free (input_array_strides); + free (input_array_min_subscripts); + free (input_array_max_subscripts); return (0); } |