diff options
author | Erik Schnetter <schnetter@aei.mpg.de> | 2005-06-06 14:55:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@aei.mpg.de> | 2005-06-06 14:55:00 +0000 |
commit | 51ee75534026ba344b0952978b251c6402fc4a83 (patch) | |
tree | 86b05a93df6c8a0927943188f0bd60ebd425e9a8 /Carpet/CarpetIOScalar/src | |
parent | 5be338f130a7c65d60846931e13b80071a5159ef (diff) |
CarpetIOScalar: Do not annotate output files when IO::out_fileinfo="none"
darcs-hash:20050606145519-891bb-ebfc8ce219c740c0b87947035d382487a852f8bc.gz
Diffstat (limited to 'Carpet/CarpetIOScalar/src')
-rw-r--r-- | Carpet/CarpetIOScalar/src/ioscalar.cc | 62 |
1 files changed, 44 insertions, 18 deletions
diff --git a/Carpet/CarpetIOScalar/src/ioscalar.cc b/Carpet/CarpetIOScalar/src/ioscalar.cc index d1a6f80bb..6f4f2c035 100644 --- a/Carpet/CarpetIOScalar/src/ioscalar.cc +++ b/Carpet/CarpetIOScalar/src/ioscalar.cc @@ -274,29 +274,55 @@ namespace CarpetIOScalar { if (do_truncate.at(n) && IO_TruncateOutputFiles (cctkGH)) { file.open (filename, ios::out | ios::trunc); { - char run_host [1000]; - Util_GetHostName (run_host, sizeof run_host); + bool want_date = false; + bool want_parfilename = false; + bool want_other = false; + if (CCTK_EQUALS (out_fileinfo, "none")) { + // do nothing + } else if (CCTK_EQUALS (out_fileinfo, "creation date")) { + want_date = true; + } else if (CCTK_EQUALS (out_fileinfo, "parameter filename")) { + want_parfilename = true; + } else if (CCTK_EQUALS (out_fileinfo, "all")) { + want_date = true; + want_parfilename = true; + want_other = true; + } else { + CCTK_WARN (0, "internal error"); + } + file << "# Scalar ASCII output created by CarpetIOScalar" << endl; + if (want_date) { + char run_host [1000]; + Util_GetHostName (run_host, sizeof run_host); #if 0 - char const * const run_user = CCTK_RunUser(); + char const * const run_user = CCTK_RunUser(); #else - char const * const run_user = getenv ("USER"); + char const * const run_user = getenv ("USER"); #endif - char run_date [1000]; - Util_CurrentDate (sizeof run_date, run_date); - char run_time [1000]; - Util_CurrentTime (sizeof run_time, run_time); - file << "# Scalar ASCII output created by CarpetIOScalar" << endl - << "# created on " << run_host - << " by " << run_user - << " on " << run_date - << " at " << run_time << endl; - if (CCTK_IsFunctionAliased ("UniqueSimulationID")) { - char const * const job_id - = static_cast<char const *> (UniqueSimulationID (cctkGH)); - file << "# Simulation ID: " << job_id << endl; + char run_date [1000]; + Util_CurrentDate (sizeof run_date, run_date); + char run_time [1000]; + Util_CurrentTime (sizeof run_time, run_time); + file << "# created on " << run_host + << " by " << run_user + << " on " << run_date + << " at " << run_time << endl; + } + if (want_parfilename) { + char parameter_filename [10000]; + CCTK_ParameterFilename + (sizeof parameter_filename, parameter_filename); + file << "# parameter filename: \"" << parameter_filename << "\"" << endl; + } + if (want_other) { + if (CCTK_IsFunctionAliased ("UniqueSimulationID")) { + char const * const job_id + = static_cast<char const *> (UniqueSimulationID (cctkGH)); + file << "# Simulation ID: " << job_id << endl; + } } + file << "#" << endl; } - file << "#" << endl; file << "# " << varname << " (" << alias << ")" << endl; file << "# iteration time data" << endl; if (one_file_per_group) { |