From e9f3f33ab2cad984ce128adfb79cc6f24e8abb91 Mon Sep 17 00:00:00 2001 From: yye00 Date: Tue, 31 Aug 2004 03:00:40 +0000 Subject: added better functionality git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/LocalReduce/trunk@39 7daa882c-dc44-4453-834e-278d26b18e6a --- src/ReductionAvg.c | 6 ++++-- src/ReductionNorm1.c | 6 ++++-- src/ReductionNorm2.c | 6 ++++-- src/ReductionNorm3.c | 6 ++++-- src/ReductionNorm4.c | 6 ++++-- src/ReductionNormInf.c | 6 ++++-- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/ReductionAvg.c b/src/ReductionAvg.c index 24cb152..ac3f8ce 100644 --- a/src/ReductionAvg.c +++ b/src/ReductionAvg.c @@ -137,6 +137,7 @@ static int ReductionAvg (int N_dims, int operator_handle, int i, j, k, flag, product, num_points; int ierr; int * iters_per_dim; + int global_calling = 0; /* indices to hold the temp indices of size N_dims and iteration indices*/ int * indices; @@ -1233,8 +1234,9 @@ static int ReductionAvg (int N_dims, int operator_handle, num_points--; - /* store the number of points in the paramater table */ - if ( Util_TableQueryNKeys(param_table_handle) != 0) + /* store the number of points in the paramater table and perform division */ + ierr = Util_TableGetInt(param_table_handle, &global_calling, "global_calling"); + if ( global_calling != 0) { ierr = Util_TableSetInt(param_table_handle, num_points, "num_points"); ierr = Util_TableSetInt(param_table_handle, 3,"mpi_operation"); diff --git a/src/ReductionNorm1.c b/src/ReductionNorm1.c index c8f5839..1fb4942 100644 --- a/src/ReductionNorm1.c +++ b/src/ReductionNorm1.c @@ -137,6 +137,7 @@ static int ReductionL1 (int N_dims, int operator_handle, int i, j, k, flag, product, num_points; int ierr; int * iters_per_dim; + int global_calling = 0; /* indices to hold the temp indices of size N_dims and iteration indices*/ int * indices; @@ -1275,8 +1276,9 @@ static int ReductionL1 (int N_dims, int operator_handle, num_points--; - /* store the number of points in the paramater table */ - if ( Util_TableQueryNKeys(param_table_handle) != 0) + /* store the number of points in the paramater table and perform division */ + ierr = Util_TableGetInt(param_table_handle, &global_calling, "global_calling"); + if ( global_calling != 0) { ierr = Util_TableSetInt(param_table_handle, num_points, "num_points"); ierr = Util_TableSetInt(param_table_handle, 3,"mpi_operation"); diff --git a/src/ReductionNorm2.c b/src/ReductionNorm2.c index 222ab3c..9cb1a4f 100644 --- a/src/ReductionNorm2.c +++ b/src/ReductionNorm2.c @@ -137,6 +137,7 @@ static int ReductionL2 (int N_dims, int operator_handle, int i, j, k, flag, product, num_points; int ierr; int * iters_per_dim; + int global_calling = 0; /* indices to hold the temp indices of size N_dims and iteration indices*/ int * indices; @@ -1241,8 +1242,9 @@ static int ReductionL2 (int N_dims, int operator_handle, num_points--; - /* store the number of points in the paramater table */ - if ( Util_TableQueryNKeys(param_table_handle) != 0) + /* store the number of points in the paramater table and perform division */ + ierr = Util_TableGetInt(param_table_handle, &global_calling, "global_calling"); + if ( global_calling != 0) { ierr = Util_TableSetInt(param_table_handle, num_points, "num_points"); ierr = Util_TableSetInt(param_table_handle, 3,"mpi_operation"); diff --git a/src/ReductionNorm3.c b/src/ReductionNorm3.c index 3f95560..be2e6df 100644 --- a/src/ReductionNorm3.c +++ b/src/ReductionNorm3.c @@ -137,6 +137,7 @@ static int ReductionL3 (int N_dims, int operator_handle, int i, j, k, flag, product, num_points; int ierr; int * iters_per_dim; + int global_calling = 0; /* indices to hold the temp indices of size N_dims and iteration indices*/ int * indices; @@ -1273,8 +1274,9 @@ static int ReductionL3 (int N_dims, int operator_handle, num_points--; - /* store the number of points in the paramater table */ - if ( Util_TableQueryNKeys(param_table_handle) != 0) + /* store the number of points in the paramater table and perform division */ + ierr = Util_TableGetInt(param_table_handle, &global_calling, "global_calling"); + if ( global_calling != 0) { ierr = Util_TableSetInt(param_table_handle, num_points, "num_points"); ierr = Util_TableSetInt(param_table_handle, 3,"mpi_operation"); diff --git a/src/ReductionNorm4.c b/src/ReductionNorm4.c index 268edb8..b7520bf 100644 --- a/src/ReductionNorm4.c +++ b/src/ReductionNorm4.c @@ -137,6 +137,7 @@ static int ReductionL4 (int N_dims, int operator_handle, int i, j, k, flag, product, num_points; int ierr; int * iters_per_dim; + int global_calling = 0; /* indices to hold the temp indices of size N_dims and iteration indices*/ int * indices; @@ -1238,8 +1239,9 @@ static int ReductionL4 (int N_dims, int operator_handle, num_points--; - /* store the number of points in the paramater table */ - if ( Util_TableQueryNKeys(param_table_handle) != 0) + /* store the number of points in the paramater table and perform division */ + ierr = Util_TableGetInt(param_table_handle, &global_calling, "global_calling"); + if ( global_calling != 0) { ierr = Util_TableSetInt(param_table_handle, num_points, "num_points"); ierr = Util_TableSetInt(param_table_handle, 3,"mpi_operation"); diff --git a/src/ReductionNormInf.c b/src/ReductionNormInf.c index 34e4c65..3380e00 100644 --- a/src/ReductionNormInf.c +++ b/src/ReductionNormInf.c @@ -137,6 +137,7 @@ static int ReductionLInf (int N_dims, int operator_handle, int i, j, k, flag, product, num_points; int ierr; int * iters_per_dim; + int global_calling = 0; /* indices to hold the temp indices of size N_dims and iteration indices*/ int * indices; @@ -1285,8 +1286,9 @@ static int ReductionLInf (int N_dims, int operator_handle, num_points--; - /* store the number of points in the paramater table */ - if ( Util_TableQueryNKeys(param_table_handle) != 0) + /* store the number of points in the paramater table and perform division */ + ierr = Util_TableGetInt(param_table_handle, &global_calling, "global_calling"); + if ( global_calling != 0) { ierr = Util_TableSetInt(param_table_handle, num_points, "num_points"); ierr = Util_TableSetInt(param_table_handle, 3,"mpi_operation"); -- cgit v1.2.3