diff options
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/Carpet/interface.ccl | 40 | ||||
-rw-r--r-- | Carpet/Carpet/param.ccl | 9 | ||||
-rw-r--r-- | Carpet/Carpet/src/CallFunction.cc | 12 | ||||
-rw-r--r-- | Carpet/Carpet/src/Comm.cc | 8 | ||||
-rw-r--r-- | Carpet/Carpet/src/Cycle.cc | 4 | ||||
-rw-r--r-- | Carpet/Carpet/src/Evolve.cc | 2 | ||||
-rw-r--r-- | Carpet/Carpet/src/Hosts.cc | 164 | ||||
-rw-r--r-- | Carpet/Carpet/src/Initialise.cc | 2 | ||||
-rw-r--r-- | Carpet/Carpet/src/MultiModel.cc | 14 | ||||
-rw-r--r-- | Carpet/Carpet/src/Requirements.cc | 34 | ||||
-rw-r--r-- | Carpet/Carpet/src/SetupGH.cc | 15 | ||||
-rw-r--r-- | Carpet/Carpet/src/Timing.cc | 2 | ||||
-rw-r--r-- | Carpet/Carpet/src/functions.hh | 43 | ||||
-rw-r--r-- | Carpet/Carpet/src/helpers.cc | 39 | ||||
-rw-r--r-- | Carpet/Carpet/src/make.code.defn | 1 | ||||
-rw-r--r-- | Carpet/Carpet/src/variables.cc | 3 | ||||
-rw-r--r-- | Carpet/Carpet/src/variables.hh | 3 | ||||
-rw-r--r-- | Carpet/CarpetIOHDF5/src/make.configuration.deps | 10 | ||||
-rw-r--r-- | Carpet/CarpetInterp2/src/fasterp.cc | 4 | ||||
-rw-r--r-- | Carpet/CarpetInterp2/src/fasterp.hh | 10 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/gdata.cc | 2 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/ggf.cc | 2 |
22 files changed, 376 insertions, 47 deletions
diff --git a/Carpet/Carpet/interface.ccl b/Carpet/Carpet/interface.ccl index f56e3ba75..506f9e8d4 100644 --- a/Carpet/Carpet/interface.ccl +++ b/Carpet/Carpet/interface.ccl @@ -48,6 +48,18 @@ PROVIDES FUNCTION GetMPICommWorld WITH Carpet_GetMPICommWorld LANGUAGE C +# Get access to process->host mapping +CCTK_INT FUNCTION CCTK_MyHost(CCTK_POINTER_TO_CONST IN cctkGH) +CCTK_INT FUNCTION CCTK_nHosts(CCTK_POINTER_TO_CONST IN cctkGH) +CCTK_INT FUNCTION CCTK_nProcsOnHost(CCTK_POINTER_TO_CONST IN cctkGH, CCTK_INT IN host) +CCTK_INT FUNCTION CCTK_ProcsOnHost(CCTK_POINTER_TO_CONST IN cctkGH, CCTK_INT IN host, CCTK_INT ARRAY OUT procs, CCTK_INT IN nprocs) +PROVIDES FUNCTION CCTK_MyHost WITH Carpet_MyHost LANGUAGE C +PROVIDES FUNCTION CCTK_nHosts WITH Carpet_nHosts LANGUAGE C +PROVIDES FUNCTION CCTK_nProcsOnHost WITH Carpet_nProcsOnHost LANGUAGE C +PROVIDES FUNCTION CCTK_ProcsOnHost WITH Carpet_ProcsOnHost LANGUAGE C + + + # Register and unregister routines which are called before and after # every scheduled routine CCTK_INT \ @@ -193,6 +205,34 @@ USES FUNCTION MultiPatch_ConvertFromPhysicalBoundary +CCTK_INT FUNCTION Accelerator_Cycle \ + (CCTK_POINTER_TO_CONST IN cctkGH) +USES FUNCTION Accelerator_Cycle + +CCTK_INT FUNCTION Accelerator_PreCallFunction \ + (CCTK_POINTER_TO_CONST IN cctkGH, \ + CCTK_POINTER_TO_CONST IN attribute) +USES FUNCTION Accelerator_PreCallFunction + +CCTK_INT FUNCTION Accelerator_PostCallFunction \ + (CCTK_POINTER_TO_CONST IN cctkGH, \ + CCTK_POINTER_TO_CONST IN attribute) +USES FUNCTION Accelerator_PostCallFunction + +CCTK_INT FUNCTION Accelerator_PreSync \ + (CCTK_POINTER_TO_CONST IN cctkGH, \ + CCTK_INT ARRAY IN groups, \ + CCTK_INT IN ngroups) +USES FUNCTION Accelerator_PreSync + +CCTK_INT FUNCTION Accelerator_PostSync \ + (CCTK_POINTER_TO_CONST IN cctkGH, \ + CCTK_INT ARRAY IN groups, \ + CCTK_INT IN ngroups) +USES FUNCTION Accelerator_PostSync + + + # Access coordinate information (on the coarse level) CCTK_INT FUNCTION GetCoordRange \ (CCTK_POINTER_TO_CONST IN cctkGH, \ diff --git a/Carpet/Carpet/param.ccl b/Carpet/Carpet/param.ccl index e8b0e193b..450ac0949 100644 --- a/Carpet/Carpet/param.ccl +++ b/Carpet/Carpet/param.ccl @@ -540,8 +540,7 @@ BOOLEAN adaptive_stepsize "Allow adaptive timestep sizes" BOOLEAN use_unusedpoints_mask "Turn on of off (default) storage and usage of 'unusedpoints_mask'" { - 0:* :: "Anything else than 0 turns unusedpoints_mask on" -} 0 +} "no" STRING timer_xml_clock "Which clock to use in the XML timer output file" { @@ -558,3 +557,9 @@ INT output_timer_tree_every "Output timing information in tree form to standard 0 :: "don't report" 1:* :: "report every so many iterations" } 0 + + + +BOOLEAN requirement_inconsistencies_are_fatal "Abort when encountering inconsistencies in requirements" STEERABLE=recover +{ +} "no" diff --git a/Carpet/Carpet/src/CallFunction.cc b/Carpet/Carpet/src/CallFunction.cc index 936c8525d..e0550907b 100644 --- a/Carpet/Carpet/src/CallFunction.cc +++ b/Carpet/Carpet/src/CallFunction.cc @@ -332,8 +332,20 @@ namespace Carpet { user_timer.start(); timer.start(); + if (CCTK_IsFunctionAliased("Accelerator_PreCallFunction")) { + Timer pre_timer("PreCall"); + pre_timer.start(); + Accelerator_PreCallFunction(cctkGH, attribute); + pre_timer.stop(); + } int const res = CCTK_CallFunction (function, attribute, data); assert (res==0); + if (CCTK_IsFunctionAliased("Accelerator_PostCallFunction")) { + Timer post_timer("PostCall"); + post_timer.start(); + Accelerator_PostCallFunction(cctkGH, attribute); + post_timer.stop(); + } timer.stop(); user_timer.stop(); diff --git a/Carpet/Carpet/src/Comm.cc b/Carpet/Carpet/src/Comm.cc index 9fa2893f3..ab6106c2b 100644 --- a/Carpet/Carpet/src/Comm.cc +++ b/Carpet/Carpet/src/Comm.cc @@ -214,6 +214,10 @@ namespace Carpet { Checkpoint ("SyncGroups"); assert (groups.size() > 0); + + if (CCTK_IsFunctionAliased("Accelerator_PreSync")) { + Accelerator_PreSync(cctkGH, &groups.front(), groups.size()); + } for (comm_state state; not state.done(); state.step()) { for (int group = 0; group < (int)groups.size(); ++group) { @@ -232,6 +236,10 @@ namespace Carpet { } } } + + if (CCTK_IsFunctionAliased("Accelerator_PostSync")) { + Accelerator_PostSync(cctkGH, &groups.front(), groups.size()); + } } diff --git a/Carpet/Carpet/src/Cycle.cc b/Carpet/Carpet/src/Cycle.cc index 89be14882..bd0acac0a 100644 --- a/Carpet/Carpet/src/Cycle.cc +++ b/Carpet/Carpet/src/Cycle.cc @@ -99,6 +99,10 @@ namespace Carpet { } // if storage } // for group + if (CCTK_IsFunctionAliased("Accelerator_Cycle")) { + Accelerator_Cycle(cctkGH); + } + if (errors > 0) { CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, "Errors in %d groups detected; aborting", errors); diff --git a/Carpet/Carpet/src/Evolve.cc b/Carpet/Carpet/src/Evolve.cc index 21647a4e3..8a11fb4ed 100644 --- a/Carpet/Carpet/src/Evolve.cc +++ b/Carpet/Carpet/src/Evolve.cc @@ -602,7 +602,9 @@ namespace Carpet { ScheduleTraverse (where, "CCTK_CHECKPOINT", cctkGH); // Analysis + in_analysis_bin = true; ScheduleTraverse (where, "CCTK_ANALYSIS", cctkGH); + in_analysis_bin = false; if (do_late_global_mode) { // Timing statistics diff --git a/Carpet/Carpet/src/Hosts.cc b/Carpet/Carpet/src/Hosts.cc new file mode 100644 index 000000000..a9f01031c --- /dev/null +++ b/Carpet/Carpet/src/Hosts.cc @@ -0,0 +1,164 @@ +#include <cctk.h> + +#include <cassert> +#include <cstring> +#include <iostream> +#include <map> +#include <string> +#include <vector> + +#ifdef CCTK_MPI +# include <mpi.h> +#else +# include "nompi.h" +#endif + +#include <dist.hh> +#include <functions.hh> +#include <mpi_string.hh> + + + +namespace Carpet +{ + + using namespace std; + + + + vector <string> hosts; // Host id to host name + std::map <string, int> host_map; // Host name to host id + vector <int> host_ids; // Process to host id + vector <vector <int> > host_procs; // Host id to processes + + + + vector <string> const & Hosts () { return hosts; } + std::map <string, int> const & HostMap () { return host_map; } + vector <int> const & HostIds () { return host_ids; } + vector <vector <int> > const & HostProcs () { return host_procs; } + + string Host (int const id) + { + return hosts.at (id); + } + + int HostMap (string const name) + { + if (host_map.find (name) != host_map.end()) + { + return host_map[name]; + } + else + { + return -1; + } + } + + int HostId (int const proc) + { + return host_ids.at (proc); + } + + vector <int> const & HostProcs (int const id) + { + return host_procs.at (id); + } + + + + void + DetermineHosts (string const host, bool const verbose) + { + // Get the total number of processes + int num_procs; + MPI_Comm_size (dist::comm(), & num_procs); + int my_proc; + MPI_Comm_rank (dist::comm(), & my_proc); + + // Gather all host names + hosts = allgather_string (dist::comm(), host); + + // Map host strings to small integers + int num_hosts = 0; + host_ids.resize (num_procs); + host_map.clear (); + for (int n = 0; n < num_procs; ++ n) + { + if (host_map.find (hosts.AT(n)) != host_map.end()) + { + host_ids.AT(n) = host_map[hosts.AT(n)]; + } + else + { + host_map[hosts.AT(n)] = num_hosts; + host_ids.AT(n) = num_hosts; + ++ num_hosts; + } + } + + // Determine processes per host + vector <int> num_host_procs (num_hosts, 0); + for (int n = 0; n < num_procs; ++ n) + { + ++ num_host_procs.at (host_ids.AT(n)); + } + + host_procs.resize (num_hosts); + for (int m = 0; m < num_hosts; ++ m) + { + host_procs.AT(m).reserve (num_host_procs.AT(m)); + } + for (int n = 0; n < num_procs; ++ n) + { + host_procs.at (host_ids.AT(n)).push_back (n); + } + for (int m = 0; m < num_hosts; ++ m) + { + assert (static_cast<int> (host_procs.AT(m).size()) + == num_host_procs.AT(m)); + } + + if (verbose) + { + CCTK_INFO ("Host listing:"); + for (int m = 0; m < num_hosts; ++ m) + { + cout << " host " << m << ": \"" << hosts.AT(m) << "\"" << endl; + } + CCTK_INFO ("Host/process mapping:"); + for (int n = 0; n < num_procs; ++ n) + { + int const m = host_ids.AT(n); + bool const same_host_as_prev = + n-1 >= 0 and host_ids.AT(n-1) == m; + bool const same_host_as_next = + n+1 < num_procs and host_ids.AT(n+1) == m; + if (same_host_as_next) { + if (same_host_as_prev) { + // Output nothing + } else { + // This process has the same host as the next one: + // output only a partial line + cout << " processes " << n << "-"; + } + } else { + if (same_host_as_prev) { + // This process has the same host as the previous one: + // finish a partial line + cout << n << ": " + << "host " << m << " \"" << hosts.AT(m) << "\"" << endl; + } else { + cout << " process " << n << ": " + << "host " << m << " \"" << hosts.AT(m) << "\"" << endl; + } + } + } + int const my_host = host_ids.AT(my_proc); + CCTK_VInfo (CCTK_THORNSTRING, + "Host mapping: This is process %d, host %d \"%s\"", + my_proc, my_host, host.c_str()); + } + } + +} // namespace Carpet diff --git a/Carpet/Carpet/src/Initialise.cc b/Carpet/Carpet/src/Initialise.cc index 976601ad9..559d58cfe 100644 --- a/Carpet/Carpet/src/Initialise.cc +++ b/Carpet/Carpet/src/Initialise.cc @@ -602,7 +602,9 @@ namespace Carpet { ScheduleTraverse (where, "CCTK_CPINITIAL", cctkGH); // Analysis + in_analysis_bin = true; ScheduleTraverse (where, "CCTK_ANALYSIS", cctkGH); + in_analysis_bin = false; if (do_late_global_mode) { // Timing statistics diff --git a/Carpet/Carpet/src/MultiModel.cc b/Carpet/Carpet/src/MultiModel.cc index 7f4db58bc..0de480051 100644 --- a/Carpet/Carpet/src/MultiModel.cc +++ b/Carpet/Carpet/src/MultiModel.cc @@ -32,12 +32,12 @@ namespace Carpet - vector <string> Models () { return models; } - std::map <string, int> ModelMap () { return model_map; } - vector <int> ModelIds () { return model_ids; } - vector <vector <int> > ModelProcs () { return model_procs; } + vector <string> const & Models () { return models; } + std::map <string, int> const & ModelMap () { return model_map; } + vector <int> const & ModelIds () { return model_ids; } + vector <vector <int> > const & ModelProcs () { return model_procs; } - string Models (int const id) + string Model (int const id) { return models.at (id); } @@ -59,9 +59,9 @@ namespace Carpet return model_ids.at (proc); } - vector <int> ModelProcs (int const proc) + vector <int> const & ModelProcs (int const id) { - return model_procs.at (proc); + return model_procs.at (id); } diff --git a/Carpet/Carpet/src/Requirements.cc b/Carpet/Carpet/src/Requirements.cc index da0beaf6b..630d1057d 100644 --- a/Carpet/Carpet/src/Requirements.cc +++ b/Carpet/Carpet/src/Requirements.cc @@ -95,11 +95,16 @@ namespace Carpet { CheckEntry (void * const attribute, void * const data) { + DECLARE_CCTK_PARAMETERS; + if (not attribute) { // Nothing to check return 1; } + int (*const warn) (char const *thorn, char const *format, ...) = + requirement_inconsistencies_are_fatal ? CCTK_VParamWarn : CCTK_VInfo; + // Convert argument types cFunctionData & function_data = (static_cast <t_attribute *> (attribute))->FunctionData; @@ -125,12 +130,12 @@ namespace Carpet { ri != required_but_not_provided.end(); ++ ri) { string const req = * ri; - CCTK_VParamWarn (CCTK_THORNSTRING, - "Requirement inconsistency:\n" - " Group %s, function %s::%s requires \"%s\" which has not been provided", - function_data.where, - function_data.thorn, function_data.routine, - req.c_str()); + warn (CCTK_THORNSTRING, + "Requirement inconsistency:\n" + " Group %s, function %s::%s requires \"%s\" which has not been provided", + function_data.where, + function_data.thorn, function_data.routine, + req.c_str()); } } @@ -144,11 +149,16 @@ namespace Carpet { CheckExit (void * const attribute, void * const data) { + DECLARE_CCTK_PARAMETERS; + if (not attribute) { // Nothing to check return 1; } + int (*const warn) (char const *thorn, char const *format, ...) = + requirement_inconsistencies_are_fatal ? CCTK_VParamWarn : CCTK_VInfo; + // Convert argument types cFunctionData & function_data = (static_cast <t_attribute *> (attribute))->FunctionData; @@ -187,12 +197,12 @@ namespace Carpet { pi != provided_too_often.end(); ++ pi) { string const prov = * pi; - CCTK_VParamWarn (CCTK_THORNSTRING, - "Requirement inconsistency:\n" - " Group %s, function %s::%s provides (and does not require) \"%s\" which has already been provided", - function_data.where, - function_data.thorn, function_data.routine, - prov.c_str()); + warn (CCTK_THORNSTRING, + "Requirement inconsistency:\n" + " Group %s, function %s::%s provides (and does not require) \"%s\" which has already been provided", + function_data.where, + function_data.thorn, function_data.routine, + prov.c_str()); } } diff --git a/Carpet/Carpet/src/SetupGH.cc b/Carpet/Carpet/src/SetupGH.cc index 3f7618e02..59cf77f50 100644 --- a/Carpet/Carpet/src/SetupGH.cc +++ b/Carpet/Carpet/src/SetupGH.cc @@ -254,16 +254,19 @@ namespace Carpet { MPI_Get_processor_name (hostnamebuf, &hostnamelen); string const hostname (hostnamebuf); #endif + DetermineHosts (hostname, true); +#if HAVE_GETPID int const mypid = static_cast<int> (getpid ()); +#else + int const mypid = -1; +#endif // Output CCTK_VInfo (CCTK_THORNSTRING, "This process runs on host %s, pid=%d", hostname.c_str(), mypid); if (verbose or veryverbose) { - // Collect host names - vector <string> hostnames = allgather_string (dist::comm(), hostname); - vector <int> pids (nprocs); // Collect process ids + vector <int> pids (nprocs); MPI_Allgather (const_cast <int *> (& mypid), 1, MPI_INT, & pids.front(), 1, MPI_INT, dist::comm()); @@ -276,9 +279,11 @@ namespace Carpet { CCTK_VInfo (CCTK_THORNSTRING, "Running on the following hosts:"); for (int n = 0; n < nprocs; ++ n) { + int const host_id = HostId(n); CCTK_VInfo (CCTK_THORNSTRING, - " %6d: %s, pid=%d, num_threads=%d", - n, hostnames.AT(n).c_str(), pids.AT(n), nthreads.AT(n)); + " %6d: hid=%d (%s), pid=%d, num_threads=%d", + n, host_id, Host(host_id).c_str(), + pids.AT(n), nthreads.AT(n)); } } diff --git a/Carpet/Carpet/src/Timing.cc b/Carpet/Carpet/src/Timing.cc index 43c230588..772abc54b 100644 --- a/Carpet/Carpet/src/Timing.cc +++ b/Carpet/Carpet/src/Timing.cc @@ -416,7 +416,7 @@ namespace Carpet { * current_physical_time_per_hour = * physical_time_per_hour; } else { CCTK_REAL const window = - min (* time_evolution, timing_average_window_minutes * 60.0); + min (* time_evolution, (CCTK_REAL) (timing_average_window_minutes * 60.0)); CCTK_REAL const alpha = exp (- (* time_evolution - last_time_evolution) / window); * current_physical_time_per_hour = diff --git a/Carpet/Carpet/src/functions.hh b/Carpet/Carpet/src/functions.hh index 6c1d3c84a..fb9afb76b 100644 --- a/Carpet/Carpet/src/functions.hh +++ b/Carpet/Carpet/src/functions.hh @@ -57,20 +57,45 @@ namespace Carpet { bool verbose); // Model id to model name - vector <string> Models (); - string Model (int id) CCTK_ATTRIBUTE_PURE; + vector <string> const & Models (); + string Model (int id); // Model name to model id - std::map <string, int> ModelMap (); - int ModelMap (string name) CCTK_ATTRIBUTE_PURE; + std::map <string, int> const & ModelMap (); + int ModelMap (string name); // Processor to model id - vector <int> ModelIds (); - int ModelId (int proc) CCTK_ATTRIBUTE_PURE; + vector <int> const & ModelIds (); + int ModelId (int proc); + + // Model id to processes + vector <vector <int> > const & ModelProcs (); + vector <int> const & ModelProcs (int id); + + + + // Host mapping + void + DetermineHosts (string host, + bool verbose); + + // Host id to host name + vector <string> const & Hosts (); + string Host (int id); + + // Host name to host id + std::map <string, int> const & HostMap (); + int HostMap (string name); + + // Processor to host id + vector <int> const & HostIds (); + int HostId (int proc); + + // Host id to processes + vector <vector <int> > const & HostProcs (); + vector <int> const & HostProcs (int id); + - // Model id to processors - vector <vector <int> > ModelProcs () CCTK_ATTRIBUTE_PURE; - vector <int> ModelProcs (int proc) CCTK_ATTRIBUTE_PURE; extern "C" { CCTK_POINTER_TO_CONST diff --git a/Carpet/Carpet/src/helpers.cc b/Carpet/Carpet/src/helpers.cc index afacfc802..ccf5f71cc 100644 --- a/Carpet/Carpet/src/helpers.cc +++ b/Carpet/Carpet/src/helpers.cc @@ -149,7 +149,44 @@ namespace Carpet { } - + + // Hosts + extern "C" + CCTK_INT Carpet_MyHost(CCTK_POINTER_TO_CONST const cctkGH_) + { + return HostId(dist::rank()); + } + + extern "C" + CCTK_INT Carpet_nHosts(CCTK_POINTER_TO_CONST const cctkGH_) + { + return Hosts().size(); + } + + extern "C" + CCTK_INT Carpet_nProcsOnHost(CCTK_POINTER_TO_CONST const cctkGH_, + CCTK_INT const host) + { + return HostProcs(host).size(); + } + + extern "C" + CCTK_INT Carpet_ProcsOnHost(CCTK_POINTER_TO_CONST const cctkGH_, + CCTK_INT const host, + CCTK_INT procs[], CCTK_INT const nprocs) + { + int const nprocs1 = HostProcs(host).size(); + for (int p=0; p<nprocs1; ++p) { + if (p >= nprocs) break; + procs[p] = HostProcs(host).AT(p); + } + return nprocs1; + } + + + + // Coordinates + CCTK_INT Carpet_GetCoordRange (CCTK_POINTER_TO_CONST const cctkGH_, CCTK_INT const m, diff --git a/Carpet/Carpet/src/make.code.defn b/Carpet/Carpet/src/make.code.defn index 92c781faf..28cb37f05 100644 --- a/Carpet/Carpet/src/make.code.defn +++ b/Carpet/Carpet/src/make.code.defn @@ -10,6 +10,7 @@ SRCS = CactusTimer.cc \ Comm.cc \ Cycle.cc \ Evolve.cc \ + Hosts.cc \ Initialise.cc \ MultiModel.cc \ OutputGH.cc \ diff --git a/Carpet/Carpet/src/variables.cc b/Carpet/Carpet/src/variables.cc index 1de61db65..1e1b31b06 100644 --- a/Carpet/Carpet/src/variables.cc +++ b/Carpet/Carpet/src/variables.cc @@ -106,6 +106,9 @@ namespace Carpet { // Should we warn about groups with insufficiently many time levels? bool do_warn_about_storage; + // Are we in the analysis bin? + bool in_analysis_bin; + // Data for grid functions diff --git a/Carpet/Carpet/src/variables.hh b/Carpet/Carpet/src/variables.hh index 778f6f516..707e6f1ae 100644 --- a/Carpet/Carpet/src/variables.hh +++ b/Carpet/Carpet/src/variables.hh @@ -147,6 +147,9 @@ namespace Carpet { // Should we warn about groups with insufficiently many time levels? extern bool do_warn_about_storage; + // Are we in the analysis bin? + extern bool in_analysis_bin; + // Data for grid functions diff --git a/Carpet/CarpetIOHDF5/src/make.configuration.deps b/Carpet/CarpetIOHDF5/src/make.configuration.deps index fb4771ddf..b118cf3b9 100644 --- a/Carpet/CarpetIOHDF5/src/make.configuration.deps +++ b/Carpet/CarpetIOHDF5/src/make.configuration.deps @@ -1,16 +1,16 @@ CARPETIOHDF5_BUILD_DIR = $(BUILD_DIR)/CarpetIOHDF5 CARPETIOHDF5_SRC_DIR = $(PACKAGE_DIR)/Carpet/CarpetIOHDF5/src/util -CARPETIOHDF5_CFLAGS = -DCCODE $(CFLAGS) +CARPETIOHDF5_CXXFLAGS = -DCCODE $(CXXFLAGS) CARPETIOHDF5_LDFLAGS = $(DEBUG_LD) $(LDFLAGS) $(EXTRAFLAGS) $(GENERAL_LIBRARIES) -# Extend CFLAGS if HDF5 library was built with LFS support +# Extend CXXFLAGS if HDF5 library was built with LFS support ifneq ($(strip $(HDF5_LFS_FLAGS)),) - CARPETIOHDF5_CFLAGS += $(HDF5_LFS_FLAGS) + CARPETIOHDF5_CXXFLAGS += $(HDF5_LFS_FLAGS) endif # add includes -CARPETIOHDF5_CFLAGS += -I$(CONFIG) -I$(BINDINGS_DIR)/include -I$(FLESH_DIR)/include -I$(PACKAGE_DIR) $(HDF5_INC_DIRS:%=-I%) +CARPETIOHDF5_CXXFLAGS += -I$(CONFIG) -I$(BINDINGS_DIR)/include -I$(FLESH_DIR)/include -I$(PACKAGE_DIR) $(HDF5_INC_DIRS:%=-I%) # general linking rule @@ -23,4 +23,4 @@ $(UTIL_DIR)/%: $(CARPETIOHDF5_BUILD_DIR)/%.o $(CARPETIOHDF5_BUILD_DIR)/%.o: $(CARPETIOHDF5_SRC_DIR)/%.cc @echo Compiling $< if [ ! -d $(CARPETIOHDF5_BUILD_DIR) ]; then $(MKDIR) $(MKDIRFLAGS) $(CARPETIOHDF5_BUILD_DIR) ; fi - $(CXX) $< $(CARPETIOHDF5_CFLAGS) -DTHORN_IS_CarpetIOHDF5 -c -o $@ + $(CXX) $< $(CARPETIOHDF5_CXXFLAGS) -DTHORN_IS_CarpetIOHDF5 -c -o $@ diff --git a/Carpet/CarpetInterp2/src/fasterp.cc b/Carpet/CarpetInterp2/src/fasterp.cc index 54848d6dc..9b8fd956b 100644 --- a/Carpet/CarpetInterp2/src/fasterp.cc +++ b/Carpet/CarpetInterp2/src/fasterp.cc @@ -1071,9 +1071,7 @@ namespace CarpetInterp2 { DECLARE_CCTK_PARAMETERS; // Check regridding epoch - if (regridding_epoch != (reflevel == -1 ? - Carpet::regridding_epoch : - Carpet::level_regridding_epochs.AT(reflevel))) + if (outofdate()) { if (reflevel == -1) { CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, diff --git a/Carpet/CarpetInterp2/src/fasterp.hh b/Carpet/CarpetInterp2/src/fasterp.hh index f02a93c02..138084d1d 100644 --- a/Carpet/CarpetInterp2/src/fasterp.hh +++ b/Carpet/CarpetInterp2/src/fasterp.hh @@ -317,6 +317,16 @@ namespace CarpetInterp2 { { return recv_descr.npoints; } + + bool + outofdate () + const + { + return + regridding_epoch != (reflevel == -1 ? + Carpet::regridding_epoch : + Carpet::level_regridding_epochs.AT(reflevel)); + } }; diff --git a/Carpet/CarpetLib/src/gdata.cc b/Carpet/CarpetLib/src/gdata.cc index 1a1a18693..14efde95e 100644 --- a/Carpet/CarpetLib/src/gdata.cc +++ b/Carpet/CarpetLib/src/gdata.cc @@ -40,7 +40,7 @@ ostream& operator<< (ostream& os, slab<T,D> const & slabinfo) } template ostream& operator<< (ostream& os, slab<int,dim> const & slabinfo); -template ostream& operator<< (ostream& os, slab<double,dim> const & slabinfo); +template ostream& operator<< (ostream& os, slab<CCTK_REAL,dim> const & slabinfo); template<typename T,int D> MPI_Datatype mpi_datatype (slab<T,D> const&) diff --git a/Carpet/CarpetLib/src/ggf.cc b/Carpet/CarpetLib/src/ggf.cc index 35bb913c8..dbabfe1c7 100644 --- a/Carpet/CarpetLib/src/ggf.cc +++ b/Carpet/CarpetLib/src/ggf.cc @@ -611,7 +611,7 @@ transfer_from_all (comm_state & state, } dst->transfer_from - (state, gsrcs, times, recv, send, slabinfo, p1, p2 , time, pos, pot); + (state, gsrcs, times, recv, send, slabinfo, p1, p2, time, pos, pot); } total.stop (0); |