aboutsummaryrefslogtreecommitdiff
path: root/src/driver/find_horizons.cc
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-02-16 22:21:49 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-02-16 22:21:49 +0000
commitcc221a875a640142697df54a2bcff6638f7b1a88 (patch)
treea1477d8a3dd8b96d0dea7a2af4546556166389aa /src/driver/find_horizons.cc
parent04ed769ddfacb1d6f5faedb66d3ff8d512ede7d4 (diff)
* general tidying of multiprocessor code
* add current iteration number to what's sent to processor #0 for printing at each iteration * add a new verbosity level "algorithm debug" for what used to be #ifdef DEBUG debugging code * add new parameters & logic to set CCTK_Warn() levels for various warnings (eg AH is outside the gid, metric isn't +ve definite, etc) * restore the ability to output the horizon shape to a data file, which I mistakenly deleted a few days ago :( git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@947 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/driver/find_horizons.cc')
-rw-r--r--src/driver/find_horizons.cc47
1 files changed, 29 insertions, 18 deletions
diff --git a/src/driver/find_horizons.cc b/src/driver/find_horizons.cc
index fd35afd..0324cf1 100644
--- a/src/driver/find_horizons.cc
+++ b/src/driver/find_horizons.cc
@@ -71,7 +71,7 @@ void do_evaluate_expansions(int my_proc, int N_horizons,
const struct cactus_grid_info& cgi,
const struct geometry_info& gi,
const struct IO_info& IO_info,
- bool output_h, bool output_Theta,
+ const struct error_info& error_info,
const struct verbose_info& verbose_info,
int timer_handle);
void do_test_expansion_Jacobians(int my_proc, int N_horizons,
@@ -81,6 +81,7 @@ void do_test_expansion_Jacobians(int my_proc, int N_horizons,
struct Jacobian_info& Jac_info,
bool test_all_Jacobian_compute_methods,
const struct IO_info& IO_info,
+ const struct error_info& error_info,
const struct verbose_info& verbose_info,
int timer_handle);
@@ -117,6 +118,7 @@ const bool active_flag = hs.has_genuine_horizons();
const struct geometry_info& gi = state.gi;
struct Jacobian_info& Jac_info = state.Jac_info;
struct IO_info& IO_info = state.IO_info;
+const struct error_info& error_info = state.error_info;
const struct verbose_info& verbose_info = state.verbose_info;
// what are the semantics of the Cactus gxx variables? (these may
@@ -125,17 +127,17 @@ if (CCTK_Equals(metric_type, "physical"))
then cgi.Cactus_conformal_metric = false;
else if (CCTK_Equals(metric_type, "static conformal"))
then cgi.Cactus_conformal_metric = (conformal_state > 0);
-else CCTK_VWarn(-1, __LINE__, __FILE__, CCTK_THORNSTRING,
+else CCTK_VWarn(FATAL_ERROR, __LINE__, __FILE__, CCTK_THORNSTRING,
"AHFinderDirect_find_horizons(): unknown metric_type=\"%s\"!",
metric_type); /*NOTREACHED*/
// get the Cactus time step and decide if we want to output h and/or Theta now
IO_info.time_iteration = cctk_iteration;
IO_info.time = cctk_time;
-const bool output_h
+IO_info.output_h
= (IO_info.how_often_to_output_h > 0)
&& ((IO_info.time_iteration % IO_info.how_often_to_output_h) == 0);
-const bool output_Theta
+IO_info.output_Theta
= (IO_info.how_often_to_output_Theta > 0)
&& ((IO_info.time_iteration % IO_info.how_often_to_output_Theta) == 0);
@@ -176,9 +178,9 @@ switch (state.method)
case method__evaluate_expansions:
do_evaluate_expansions(my_proc, state.N_horizons,
*state.my_hs, state.my_AH_info,
- cgi, gi,
- IO_info, output_h, output_Theta,
- state.verbose_info, state.timer_handle);
+ cgi, gi, IO_info,
+ error_info, verbose_info,
+ state.timer_handle);
break;
case method__test_expansion_Jacobians:
@@ -186,7 +188,8 @@ case method__test_expansion_Jacobians:
state.my_AH_info,
cgi, gi, Jac_info,
(test_all_Jacobian_compute_methods != 0),
- IO_info, verbose_info, state.timer_handle);
+ IO_info, error_info, verbose_info,
+ state.timer_handle);
break;
case method__find_horizons:
@@ -197,13 +200,13 @@ case method__find_horizons:
*state.my_hs, state.my_AH_info,
cgi, gi, Jac_info, state.solver_info,
IO_info, state.BH_diagnostics_info,
- verbose_info);
+ error_info, verbose_info);
if (state.timer_handle >= 0)
then CCTK_TimerStopI(state.timer_handle);
break;
default:
- CCTK_VWarn(-1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ CCTK_VWarn(FATAL_ERROR, __LINE__, __FILE__, CCTK_THORNSTRING,
"\n"
" find_horizons(): unknown method=(int)%d!\n"
" (this should never happen!)"
@@ -213,7 +216,8 @@ default:
if (state.timer_handle >= 0)
then {
- printf("timer stats for computation:\n");
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "timer stats for computation:");
CCTK_TimerPrintDataI(state.timer_handle, -1);
}
}
@@ -279,7 +283,7 @@ const CCTK_REAL* data_ptr = static_cast<const fp*>(
);
if (check_for_NULL && (data_ptr == NULL))
- then CCTK_VWarn(-1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ then CCTK_VWarn(FATAL_ERROR, __LINE__, __FILE__, CCTK_THORNSTRING,
"\n"
" Cactus_gridfn_data_ptr(): got unexpected NULL data pointer\n"
" for Cactus geometry gridfn!\n"
@@ -317,7 +321,7 @@ void do_evaluate_expansions(int my_proc, int N_horizons,
const struct cactus_grid_info& cgi,
const struct geometry_info& gi,
const struct IO_info& IO_info,
- bool output_h, bool output_Theta,
+ const struct error_info& error_info,
const struct verbose_info& verbose_info,
int timer_handle)
{
@@ -341,13 +345,14 @@ if (active_flag)
jtutil::norm<fp> Theta_norms;
const bool Theta_ok = expansion(&ps,
cgi, gi,
+ error_info, true,// initial eval
false, // no Jacobian coeffs
true, // yes, print msgs
&Theta_norms);
if (timer_handle >= 0)
then CCTK_TimerStopI(timer_handle);
- if (output_h)
+ if (IO_info.output_h)
then output_gridfn(ps, gfns::gfn__h,
IO_info, IO_info.h_base_file_name,
hn, verbose_info.print_algorithm_details);
@@ -357,7 +362,7 @@ if (active_flag)
CCTK_VInfo(CCTK_THORNSTRING,
" Theta(h) rms-norm %.2e, infinity-norm %.2e",
Theta_norms.rms_norm(), Theta_norms.infinity_norm());
- if (output_Theta)
+ if (IO_info.output_Theta)
then output_gridfn(ps, gfns::gfn__Theta,
IO_info, IO_info
.Theta_base_file_name,
@@ -369,8 +374,9 @@ if (active_flag)
else {
for (int i = 0 ; i < N_horizons ; ++i)
{
- expansion(NULL, // dummy computation
- cgi, gi);
+ expansion(NULL, // dummy computation
+ cgi, gi,
+ error_info, true); // initial evaluation
}
}
}
@@ -410,6 +416,7 @@ void do_test_expansion_Jacobians(int my_proc, int N_horizons,
struct Jacobian_info& Jac_info,
bool test_all_Jacobian_compute_methods,
const struct IO_info& IO_info,
+ const struct error_info& error_info,
const struct verbose_info& verbose_info,
int timer_handle)
{
@@ -427,10 +434,12 @@ patch_system* ps_ptr = active_flag ? AH_info_ptr->ps_ptr : NULL;
//
Jacobian* Jac_NP_ptr = active_flag ? AH_info_ptr->Jac_ptr : NULL;
expansion(ps_ptr,
- cgi, gi);
+ cgi, gi,
+ error_info, true); // initial evaluation
Jac_info.Jacobian_compute_method = Jacobian__numerical_perturbation;
expansion_Jacobian(ps_ptr, Jac_NP_ptr,
cgi, gi, Jac_info,
+ error_info, true, // initial evaluation
print_msg_flag);
Jacobian* Jac_SD_FDdr_ptr = NULL;
@@ -444,10 +453,12 @@ if (test_all_Jacobian_compute_methods)
: NULL;
expansion(ps_ptr,
cgi, gi,
+ error_info, true, // initial evaluation
true); // compute SD Jacobian coeffs
Jac_info.Jacobian_compute_method = Jacobian__symbolic_diff_with_FD_dr;
expansion_Jacobian(ps_ptr, Jac_SD_FDdr_ptr,
cgi, gi, Jac_info,
+ error_info, true, // initial evaluation
print_msg_flag);
}