From fead33bb0bb420a04d15ad58b778342b3906fa8a Mon Sep 17 00:00:00 2001 From: tradke Date: Tue, 13 May 2003 15:20:54 +0000 Subject: Check for a "suppress_warnings" key in the parameter table to find out whether we should print warnings or not. So far this only affects the warning "Couldn't map point onto processor". git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHInterp/trunk@61 1c20744c-e24a-42ec-9533-f5004cb800e5 --- src/InterpGridArrays.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/InterpGridArrays.c b/src/InterpGridArrays.c index 23e851c..6f3baa1 100644 --- a/src/InterpGridArrays.c +++ b/src/InterpGridArrays.c @@ -184,7 +184,7 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, const CCTK_INT output_array_types[], void *const output_arrays[]) { - int i, retval; + int i, suppress_warnings, retval; CCTK_REAL *origin_local, *delta; CCTK_INT *input_array_dims, *input_array_types, *input_array_time_levels; const void **input_arrays; @@ -207,6 +207,11 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, #endif + /* check for a "suppress_warnings" key in the parameter table + to find out whether we should print warnings or not */ + suppress_warnings = Util_TableQueryValueInfo (param_table_handle, NULL, + NULL, "suppress_warnings") == 1; + pughGH = CCTK_GHExtension (GH, "PUGH"); /* check function arguments */ @@ -588,14 +593,14 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, { bbox_interp_coords[i] = bbox_interp_coords[i-1] + 2*N_dims; } - for (j = 0; j < 2 * N_dims; j++) /* j indices faces of the bounding box */ + for (j = 0; j < 2 * N_dims; j++) /* j indices faces of the bounding box */ { /* initialize this point to the middle of the bounding box */ for (i = 0; i < N_dims; i++) { bbox_interp_coords[i][j] = 0.5 * (bbox_local[2*i+0] + bbox_local[2*i+1]); } - if (! GH->cctk_bbox[j]) /* if this is an interprocessor face... */ + if (! GH->cctk_bbox[j]) /* if this is an interprocessor face... */ { /* ... move the point to the center of this face of the bounding box */ bbox_interp_coords[j/2][j] = bbox_local[j]; @@ -628,17 +633,20 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, { if (myGH->whichproc[point] < 0) { - msg = malloc (80 + N_dims*20); - sprintf (msg, "Unable to locate point %d [%f", - point, (double) ((const CCTK_REAL *) interp_coords[0])[point]); - for (i = 1; i < N_dims; i++) + if (! suppress_warnings) { - sprintf (msg, "%s %f", - msg, (double) ((const CCTK_REAL *) interp_coords[i])[point]); + msg = malloc (80 + N_dims*20); + sprintf (msg, "Unable to locate point %d [%f", + point, (double) ((CCTK_REAL *) interp_coords[0])[point]); + for (i = 1; i < N_dims; i++) + { + sprintf (msg, "%s %f", + msg, (double) ((CCTK_REAL *) interp_coords[i])[point]); + } + sprintf (msg, "%s]", msg); + CCTK_WARN (1, msg); + free (msg); } - sprintf (msg, "%s]", msg); - CCTK_WARN (1, msg); - free (msg); retval = CCTK_ERROR_INTERP_POINT_OUTSIDE; } } -- cgit v1.2.3