From 461ebf3df853b7b2655a182e2718534d1b8fbc09 Mon Sep 17 00:00:00 2001 From: tradke Date: Thu, 11 May 2006 14:22:06 +0000 Subject: Introduce new boolean parameter IO::truncate_files. Currently Cactus always truncates existing output files unless the simulation has been recovered from a checkpoint (in which case existing output files will get appended unless the parameter IO::truncate_files_after_recovering is set to true). Christian Ott requested that it should also be possible to always append new datasets to existing output files. The new boolean I/O parameter IO::truncate_files implements that. Its default value is true, preserving the existing Cactus behaviour. This applies patch http://www.cactuscode.org/old/pipermail/patches/2006-May/000169.html. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOUtil/trunk@240 b32723a9-ab3a-4a60-88e2-2e5d99d7c17a --- param.ccl | 4 ++++ src/Startup.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/param.ccl b/param.ccl index 1471218..11e8002 100644 --- a/param.ccl +++ b/param.ccl @@ -313,6 +313,10 @@ INT out_xyplane_zi "z-index (from 0) for 2D planes in xy, overrrides IO::out_xyp private: +BOOLEAN truncate_files "Truncate existing output files from previous runs (except when recovering) ?" STEERABLE = ALWAYS +{ +} "yes" + BOOLEAN truncate_files_after_recovering "Truncate existing output files after recovering ?" STEERABLE = RECOVER { } "no" diff --git a/src/Startup.c b/src/Startup.c index 4f70c4c..75890fe 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -175,7 +175,9 @@ CCTK_INT IOUtil_TruncateOutputFiles (const CCTK_POINTER_TO_CONST GH) return (-1); } - return (! myGH->recovered || truncate_files_after_recovering); + return (truncate_files || + truncate_files_after_recovering || + ! myGH->recovered); } -- cgit v1.2.3