aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryye00 <yye00@d60812e6-3970-4df4-986e-c251b06effeb>2005-10-18 21:04:03 +0000
committeryye00 <yye00@d60812e6-3970-4df4-986e-c251b06effeb>2005-10-18 21:04:03 +0000
commit7271151af14e7274ce215c309ab29c1738839bf1 (patch)
treed37cebe6c8fce39d28fceda8d3a719aaff73af1b
parent46bc9d232342d4741c86b591a39dc6d335f3636f (diff)
fixed the false warning messages, added parameter table creation/deletion checking
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHReduce/trunk@71 d60812e6-3970-4df4-986e-c251b06effeb
-rw-r--r--src/ReduceGA.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ReduceGA.c b/src/ReduceGA.c
index 86530d0..0a6b752 100644
--- a/src/ReduceGA.c
+++ b/src/ReduceGA.c
@@ -145,12 +145,13 @@ static int ReduceGridArrays (const cGH *GH,
int perform_all_reduce = 1;
pGA *GA;
const void *data;
+ int created_local_par_table = 0;
/* weight variables */
int weight_variable_index;
int weight_on = 0;
CCTK_REAL weight_sum = 0.0;
- CCTK_REAL total_weight_sum = 0.0;
+ CCTK_REAL total_weight_sum = 1.0;
const void * weight;
CCTK_INT * lower_array_bounds;
@@ -258,6 +259,7 @@ static int ReduceGridArrays (const cGH *GH,
/* Create the parameter table if it is not there and add the bounds to it */
if ( Util_TableQueryNKeys(param_table_handle) == 0)
{
+ created_local_par_table = 1;
param_table_handle = Util_TableCreate (UTIL_TABLE_FLAGS_DEFAULT);
ierr = Util_TableSetGenericArray (param_table_handle, CCTK_VARIABLE_INT, dim,min_array_subscript, "input_array_min_subscripts");
ierr = Util_TableSetGenericArray (param_table_handle, CCTK_VARIABLE_INT, dim,array_lsh, "input_array_max_subscripts");
@@ -322,7 +324,7 @@ static int ReduceGridArrays (const cGH *GH,
CACTUS_MPI_ERROR (MPI_Reduce (&num_points, &total_num_points, 1,
PUGH_MPI_INT, MPI_SUM, dest_proc, pughGH->PUGH_COMM_WORLD));
CACTUS_MPI_ERROR (MPI_Reduce (&weight_sum, &total_weight_sum, 1,
- PUGH_MPI_INT, MPI_SUM, dest_proc, pughGH->PUGH_COMM_WORLD));
+ PUGH_MPI_REAL, MPI_SUM, dest_proc, pughGH->PUGH_COMM_WORLD));
}
for (i = 0; i< M_output_values; i++)
{
@@ -1221,6 +1223,11 @@ static int ReduceGridArrays (const cGH *GH,
}
}
}
+
+ if(created_local_par_table)
+ {
+ ierr = Util_TableDestroy(param_table_handle);
+ }
return ierr;
}