diff options
-rw-r--r-- | doc/documentation.tex | 44 | ||||
-rw-r--r-- | interface.ccl | 21 | ||||
-rw-r--r-- | param.ccl | 68 | ||||
-rw-r--r-- | src/driver/driver.hh | 5 | ||||
-rw-r--r-- | src/driver/find_horizons.cc | 3 | ||||
-rw-r--r-- | src/driver/setup.cc | 2 |
6 files changed, 95 insertions, 48 deletions
diff --git a/doc/documentation.tex b/doc/documentation.tex index b341c35..6cf6183 100644 --- a/doc/documentation.tex +++ b/doc/documentation.tex @@ -80,7 +80,7 @@ \author{Jonathan Thornburg \quad {\tt <jthorn@aei.mpg.de>}} % The title of the document (not necessarily the name of the Thorn) -\title{Thorn Guide for the {\bf AHFinderDirect} Thorn} +\title{{\bf AHFinderDirect} -- A Fast Apparent Horizon Finder} % the date your document was last changed, if your document is in CVS, % please us: @@ -1209,32 +1209,42 @@ following parameter: to allow other thorns to find out about the horizons. Each function returns a status code which is $\ge 0$~for ok, or negative for an error. \begin{verbatim} -# The following function computes the local coordinate origin -# for the specified horizon: -CCTK_INT FUNCTION HorizonLocalCoordinateOrigin - (CCTK_INT IN horizon_number, +# +# This function returns the local coordinate origin for a given horizon. +# +CCTK_INT FUNCTION HorizonLocalCoordinateOrigin \ + (CCTK_INT IN horizon_number, \ CCTK_REAL OUT origin_x, CCTK_REAL OUT origin_y, CCTK_REAL OUT origin_z) +# # The following function queries whether or not the specified horizon # was found the most recent time AHFinderDirect searched for it. # The return value is: # 1 if the horizon was found # 0 if the horizon was not found # negative for an error +# CCTK_INT FUNCTION HorizonWasFound(CCTK_INT IN horizon_number) -# The following function computes the horizon radius in the -# direction of each (x,y,z) point, or -1.0 if this horizon wasn't found -# the most recent time AHFinderDirect searched for it. More precisely, -# For each (x,y,z), consider the ray from the local coordinate origin -# through (x,y,z). This function computes the Euclidean distance -# between the local coordinate origin and this ray's intersection with -# the horizon, or -1.0 if this horizon wasn't found the most recent time -# AHFinderDirect searched for it. -CCTK_INT FUNCTION HorizonRadiusInDirection - (CCTK_INT IN horizon_number, - CCTK_INT IN N_points, - CCTK_REAL IN ARRAY x, CCTK_REAL IN ARRAY y, CCTK_REAL IN ARRAY z, +# +# The following function computes the horizon radius in the direction +# of each (x,y,z) point, or -1.0 if this horizon wasn't found the most +# recent time AHFinderDirect searched for it. More precisely, for each +# (x,y,z), consider the ray from the local coordinate origin through +# (x,y,z). This function computes the Euclidean distance between the +# local coordinate origin and this ray's intersection with the horizon, +# or -1.0 if this horizon wasn't found the most recent time AHFinderDirect +# searched for it. +# +# If this function is to be used in a multiprocessor run on a horizon +# which was found on some other processor, the parameter +# AHFinderDirect::always_broadcast_horizon_shape +# must be set to true to get the correct answer. +# +CCTK_INT FUNCTION HorizonRadiusInDirection \ + (CCTK_INT IN horizon_number, \ + CCTK_INT IN N_points, \ + CCTK_REAL IN ARRAY x, CCTK_REAL IN ARRAY y, CCTK_REAL IN ARRAY z, \ CCTK_REAL OUT ARRAY radius) \end{verbatim} diff --git a/interface.ccl b/interface.ccl index 6546fd4..4c683c1 100644 --- a/interface.ccl +++ b/interface.ccl @@ -44,14 +44,19 @@ CCTK_INT FUNCTION HorizonLocalCoordinateOrigin \ CCTK_INT FUNCTION HorizonWasFound(CCTK_INT IN horizon_number) # -# The following function computes the horizon radius in the -# direction of each (x,y,z) point, or -1.0 if this horizon wasn't found -# the most recent time AHFinderDirect searched for it. More precisely, -# For each (x,y,z), consider the ray from the local coordinate origin -# through (x,y,z). This function computes the Euclidean distance -# between the local coordinate origin and this ray's intersection with -# the horizon, or -1.0 if this horizon wasn't found the most recent time -# AHFinderDirect searched for it. +# The following function computes the horizon radius in the direction +# of each (x,y,z) point, or -1.0 if this horizon wasn't found the most +# recent time AHFinderDirect searched for it. More precisely, for each +# (x,y,z), consider the ray from the local coordinate origin through +# (x,y,z). This function computes the Euclidean distance between the +# local coordinate origin and this ray's intersection with the horizon, +# or -1.0 if this horizon wasn't found the most recent time AHFinderDirect +# searched for it. +# +# If this function is to be used in a multiprocessor run on a horizon +# which was found on some other processor, the parameter +# AHFinderDirect::always_broadcast_horizon_shape +# must be set to true to get the correct answer. # CCTK_INT FUNCTION HorizonRadiusInDirection \ (CCTK_INT IN horizon_number, \ @@ -59,10 +59,10 @@ int find_every "how often should we try to find apparent horizons?" # Boolean run_at_CCTK_ANALYSIS "should we run in CCTK_ANALYSIS schedule bin?" { -} "true" +} true Boolean run_at_CCTK_POSTSTEP "should we run in CCTK_POSTSTEP schedule bin?" { -} "false" +} false # # unless you're trying to debug AHFinderDirect, you should leave @@ -135,6 +135,30 @@ int which_surface_to_store_info[101] \ } -1 # +# When finding multiple horizons in a multiprocessor run, this thorn +# will find different horizons in parallel on different processors. +# As a performance optimization, this thorn normally only broadcasts +# each horizon's shape from the processor that finds it, to all processors, +# if it thinks that information will be needed, i.e. if either or both +# of the following conditions hold: +# * we're setting an excision mask +# * we're storing horizon information in the SphericalSurface variables +# for at least one horizon +# +# If another thorn calls the HorizonRadiusInDirection() aliased function +# for a horizon which was found on some other processor, this broadcast is +# also needed to get the right answer (in a multiprocessor run), but this +# thorn doesn't know this. The following parameter should be used in this +# case to force the broadcast to be made. +# +Boolean always_broadcast_horizon_shape \ + "should we always broadcast each horizon shape from the processor \ + that finds it, to all processors, even if there's no apparent need \ + for this information on other processors?" +{ +} false + +# # This parameter controls how verbose this thorn is in printing # informational (non-error) messages describing what it's doing. # @@ -165,7 +189,7 @@ keyword verbose_level \ Boolean print_timing_stats \ "should we print timing stats for the whole apparent-horizon-finding process?" { -} "false" +} false # By default, we find apparent horizons by solving the equation # Theta(h) = 0 @@ -331,7 +355,7 @@ real initial_guess__coord_ellipsoid__z_radius[101] "z radius of ellipsoid" Boolean output_BH_diagnostics \ "should we output BH diagnostics to a data file for each AH found?" { -} "true" +} true # # These file names are actually just "base" file names, with the full @@ -404,7 +428,7 @@ Boolean output_ghost_zones_for_h \ "should we include the patch system (angular) interpatch ghost zones \ in h data files?" { -} "false" +} false # n.b. making this "gnuplot" probably isn't a good idea, # since it could create confusion with gnuplot command files @@ -474,7 +498,7 @@ Boolean output_OpenDX_control_files \ "should we output OpenDX control files to allow reading of AHFinderDirect \ 'ASCII (gnuplot)' format data files?" { -} "true" +} true string OpenDX_control_file_name_extension \ "file name extension for OpenDX control files" { @@ -491,7 +515,7 @@ string OpenDX_control_file_name_extension \ Boolean output_initial_guess \ "should we output the initial guess back to the h data file?" { -} "false" +} false # for debugging convergence failures, we can optionally output # h, Theta, and delta_h at each Newton iteration @@ -499,7 +523,7 @@ Boolean output_initial_guess \ Boolean debugging_output_at_each_Newton_iteration \ "should we output {h, Theta, delta_h} at each Newton iteration?" { -} "false" +} false string Jacobian_base_file_name "base file name for Jacobian output file(s)" { @@ -516,12 +540,12 @@ string Jacobian_base_file_name "base file name for Jacobian output file(s)" Boolean set_mask_for_all_horizons \ "should we set a mask grid function (or functions) for all horizons?" { -} "false" +} false Boolean set_mask_for_individual_horizon[101] \ "should we set a mask grid function (or functions) for *this* horizon?" { -} "false" +} false # # If we set a mask, we do so based on partitioning the Cactus grid into @@ -576,7 +600,7 @@ Boolean mask_is_noshrink \ "should we prevent the inside & buffer regions from ever shrinking?" \ STEERABLE=ALWAYS { -} "true" +} true # # If we're using mesh refinement (eg Carpet) it's possible to find a @@ -628,13 +652,13 @@ Boolean set_old_style_mask \ should we set an old-style (CCTK_REAL) mask gridfn?" \ STEERABLE = ALWAYS { -} "true" +} true Boolean set_new_style_mask \ "if we're setting a mask, \ should we set an new-style (CCTK_INT) mask gridfn?" \ STEERABLE = ALWAYS { -} "false" +} false # # mask info for mask_type = "old-style (CCTK_REAL)" @@ -728,7 +752,7 @@ int warn_level__point_outside__subsequent \ # the Cactus configure process didn't find a finite() function, # so we're skipping the "check that the geometry is finite" tests -# even though the user set check_that_geometry_is_finite = "true" +# even though the user set check_that_geometry_is_finite = true int warn_level__skipping_finite_check \ "warning level if the user sets check_that_geometry_is_finite \ but the Cactus configure process doesn't find a finite() function \ @@ -1035,9 +1059,9 @@ real ILUCG__error_tolerance "error tolerance for conjugate gradient iteration" Boolean ILUCG__limit_CG_iterations \ "should we limit the maximum number of conjugate gradient iterations allowed?" { -"false" :: "no limit on CG iterations" -"true" :: "limit to Neqns CG iterations" -} "true" +false :: "no limit on CG iterations" +true :: "limit to Neqns CG iterations" +} true # extra parameters for # Jacobian_store_solve_method == "row-oriented sparse matrix/UMFPACK" @@ -1077,7 +1101,7 @@ real Jacobian_perturbation_amplitude \ Boolean test_all_Jacobian_compute_methods \ "should we test all Jacobian computation methods, or just NP?" { -} "true" +} true ################################################################################ @@ -1142,7 +1166,7 @@ Boolean hardwire_Schwarzschild_EF_geometry \ "should we hard-wire the geometry to Schwarzschild/EF instead of \ interpolating from the Cactus grid?" { -} "false" +} false real geometry__Schwarzschild_EF__mass "mass of Schwarzschild BH" { @@ -1202,11 +1226,11 @@ real geometry__Schwarzschild_EF__Delta_xyz \ Boolean check_that_h_is_finite \ "should we check that horizon shape function h is finite?" { -} "true" +} true Boolean check_that_geometry_is_finite \ "should we check the interpolated geometry variables are finite?" { -} "true" +} true ################################################################################ @@ -1333,6 +1357,6 @@ keyword integral_method "how do we compute integrals over the horizon?" ## "should we perturb at *all* points in the y patch, or just those with the \ ## iperp which is (supposedly) involved in the interpatch interpolation?" ##{ -##} "true" +##} true ## ################################################################################## diff --git a/src/driver/driver.hh b/src/driver/driver.hh index 6f9c992..d951f97 100644 --- a/src/driver/driver.hh +++ b/src/driver/driver.hh @@ -366,6 +366,11 @@ struct state bool announce_centroid_flag; // should we announce horizon centroid? int which_horizon_to_announce_centroid; // if so, which horizon? + // should we always broadcast each horizon shape from the processor + // that finds it, to all processors, even if there's no apparent need + // for this information on other processors? + bool always_broadcast_horizon_shape; + // this is the inclusive-or of AH_data.store_info_in_SS_vars // over all horizons, i.e. it says if we will store horizon // information in the SphericalSurface variables for *any* horizon diff --git a/src/driver/find_horizons.cc b/src/driver/find_horizons.cc index e252528..a4d2b65 100644 --- a/src/driver/find_horizons.cc +++ b/src/driver/find_horizons.cc @@ -105,7 +105,8 @@ const int N_horizons = state.N_horizons; horizon_sequence& hs = *state.my_hs; const bool active_flag = hs.has_genuine_horizons(); const bool broadcast_horizon_shape - = state.mask_info.set_mask_for_any_horizon + = state.always_broadcast_horizon_shape + || state.mask_info.set_mask_for_any_horizon || state.store_info_in_SS_vars_for_any_horizon; struct cactus_grid_info& cgi = state.cgi; diff --git a/src/driver/setup.cc b/src/driver/setup.cc index 51c5562..44c0d65 100644 --- a/src/driver/setup.cc +++ b/src/driver/setup.cc @@ -304,6 +304,8 @@ IO_info.time = 0.0; state.BH_diagnostics_info.integral_method = patch::decode_integration_method(integral_method); +state.always_broadcast_horizon_shape = (always_broadcast_horizon_shape != 0); + // // mask parameters |