aboutsummaryrefslogtreecommitdiff
path: root/CarpetDev/CarpetIOF5/src/timestep.cc
diff options
context:
space:
mode:
Diffstat (limited to 'CarpetDev/CarpetIOF5/src/timestep.cc')
-rw-r--r--CarpetDev/CarpetIOF5/src/timestep.cc35
1 files changed, 14 insertions, 21 deletions
diff --git a/CarpetDev/CarpetIOF5/src/timestep.cc b/CarpetDev/CarpetIOF5/src/timestep.cc
index 73d106a92..409f47221 100644
--- a/CarpetDev/CarpetIOF5/src/timestep.cc
+++ b/CarpetDev/CarpetIOF5/src/timestep.cc
@@ -9,6 +9,8 @@
#include "cctk.h"
#include "cctk_Functions.h"
+#include "defs.hh"
+
#include "timestep.hh"
#include "utils.hh"
@@ -42,21 +44,14 @@ namespace CarpetIOF5 {
{
// Create a string from the time without losing information
int const precision = numeric_limits<CCTK_REAL>::digits10 + 2;
- buf << setprecision (precision) << "t=" << time;
+ buf << setprecision (precision) << "T=" << time;
}
m_name = buf.str();
m_hdf5_timestep
= open_or_create_group (m_file.get_hdf5_file(), m_name.c_str());
assert (m_hdf5_timestep >= 0);
- write_or_check_attribute (m_hdf5_timestep, "time", time);
-
- if (CCTK_IsFunctionAliased ("UniqueSimulationID")) {
- cGH const * const cctkGH = get_file().get_cctkGH();
- char const * const job_id
- = static_cast<char const *> (UniqueSimulationID (cctkGH));
- write_or_check_attribute (m_hdf5_timestep, "simulation id", job_id);
- }
+ write_or_check_attribute (m_hdf5_timestep, "Time", time);
assert (invariant());
}
@@ -66,8 +61,7 @@ namespace CarpetIOF5 {
timestep_t::
~ timestep_t()
{
- herr_t const herr = H5Gclose (m_hdf5_timestep);
- assert (not herr);
+ check (not H5Gclose (m_hdf5_timestep));
}
@@ -100,21 +94,20 @@ namespace CarpetIOF5 {
void timestep_t::
- get_link_destination (string & filename,
+ get_link_destination (int const proc,
+ string & filename,
string & objectname)
const
{
- static bool initialised = false;
- static string l_filename;
- static string l_objectname;
- if (not initialised)
+ get_file().get_link_destination (proc, filename, objectname);
+ if (objectname.empty())
+ {
+ objectname = m_name;
+ }
+ else
{
- initialised = true;
- get_file().get_link_destination (l_filename, l_objectname);
- l_objectname += string ("/") + m_name;
+ objectname += string ("/") + m_name;
}
- filename = l_filename;
- objectname = l_objectname;
}