summaryrefslogtreecommitdiff
path: root/src/comm
diff options
context:
space:
mode:
authorjthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-05-14 10:23:12 +0000
committerjthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-05-14 10:23:12 +0000
commit570e3eeab49d899499905f8333bbb05a49fd3b3b (patch)
tree1f51bb1526c94a07b6a7aa91442d8d8f0a9291e6 /src/comm
parenteb34221c85b1874a9235f0030a4e99c2048470ff (diff)
Fix previous patch so we only warn at most onece per processor per API.
This avoids problems with millions of warnings being printed if user code calls the interpolator separately at each grid point. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3729 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/comm')
-rw-r--r--src/comm/Interp.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/comm/Interp.c b/src/comm/Interp.c
index ca9a3f20..d97fe9d5 100644
--- a/src/comm/Interp.c
+++ b/src/comm/Interp.c
@@ -689,15 +689,21 @@ int CCTK_InterpGV (cGH *GH,
const void **interp_coord_arrays;
void **out_arrays;
struct interp_info *operator;
+ static int obsolete_warning_first_time_flag = 1;
- /* warn the user that this API is obselete and will disappear soon! */
+ /* warn the user that this API is obsolete and will disappear soon! */
+ /* (but only warn once per processor per API) */
+ if (obsolete_warning_first_time_flag)
+ {
+ obsolete_warning_first_time_flag = 0;
CCTK_VWarn(1, __LINE__, __FILE__, "Cactus",
"\n"
"***\n"
"*** CCTK_InterpGV() is obsolescent and will be phased out soon!\n"
"*** You should convert your code to use CCTK_InterpGridArrays() instead.\n"
"***\n");
+ }
/* Get the interpolation operator routine and the coordinate system name */
operator = (struct interp_info *) Util_GetHandledData (interp_operators,
@@ -777,15 +783,21 @@ void CCTK_FCALL CCTK_FNAME (CCTK_InterpGV)
const void **interp_coord_arrays;
void **out_arrays;
struct interp_info *operator;
+ static int obsolete_warning_first_time_flag = 1;
- /* warn the user that this API is obselete and will disappear soon! */
+ /* warn the user that this API is obsolete and will disappear soon! */
+ /* (but only warn once per processor per API) */
+ if (obsolete_warning_first_time_flag)
+ {
+ obsolete_warning_first_time_flag = 0;
CCTK_VWarn(1, __LINE__, __FILE__, "Cactus",
"\n"
"***\n"
"*** CCTK_InterpGV() is obsolescent and will be phased out soon!\n"
"*** You should convert your code to use CCTK_InterpGridArrays() instead.\n"
"***\n");
+ }
/* Get the interpolation operator and the coordinate system name */
operator = (struct interp_info *) Util_GetHandledData (interp_operators,
@@ -958,14 +970,21 @@ int CCTK_InterpLocal (cGH *GH,
const void **coord_arrays, **interp_coord_arrays, **in_arrays;
void **out_arrays;
struct interp_info *operator;
+ static int obsolete_warning_first_time_flag = 1;
+
- /* warn the user that this API is obselete and will disappear soon! */
+ /* warn the user that this API is obsolete and will disappear soon! */
+ /* (but only warn once per processor per API) */
+ if (obsolete_warning_first_time_flag)
+ {
+ obsolete_warning_first_time_flag = 0;
CCTK_VWarn(1, __LINE__, __FILE__, "Cactus",
"\n"
"***\n"
"*** CCTK_InterpLocal() is obsolescent and will be phased out soon!\n"
"*** You should convert your code to use CCTK_InterpLocalUniform() instead.\n"
"***\n");
+ }
/* Get the interpolation operator */
operator = (struct interp_info *) Util_GetHandledData (interp_operators,
@@ -1050,15 +1069,21 @@ void CCTK_FCALL CCTK_FNAME (CCTK_InterpLocal)
const void **coord_arrays, **interp_coord_arrays, **in_arrays;
void **out_arrays;
struct interp_info *operator;
+ static int obsolete_warning_first_time_flag = 1;
- /* warn the user that this API is obselete and will disappear soon! */
+ /* warn the user that this API is obsolete and will disappear soon! */
+ /* (but only warn once per processor per API) */
+ if (obsolete_warning_first_time_flag)
+ {
+ obsolete_warning_first_time_flag = 0;
CCTK_VWarn(1, __LINE__, __FILE__, "Cactus",
"\n"
"***\n"
"*** CCTK_InterpLocal() is obsolescent and will be phased out soon!\n"
"*** You should convert your code to use CCTK_InterpLocalUniform() instead.\n"
"***\n");
+ }
/* Get the interpolation operator */
operator = (struct interp_info *) Util_GetHandledData (interp_operators,