aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknarf <knarf@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a>2012-01-11 21:44:26 +0000
committerknarf <knarf@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a>2012-01-11 21:44:26 +0000
commit76e00e89876cc82865e52f7fa7c01f5914366c50 (patch)
treeba63df370999df489f92da8fd20ae0a24aa76544
parentea1ca471ae4b1b430ee85eb765a3c5dc77b8de9a (diff)
make checkpoint_dir steerable. This requires the checkpoint_dir to be created not only at startup, and the only point in which this can be helped with in this thorn is in IOUtil_AssembleFilename() which is called by using thorns to get the file name of the checkpoint - this is repeated there now
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOUtil/trunk@286 b32723a9-ab3a-4a60-88e2-2e5d99d7c17a
-rw-r--r--param.ccl2
-rw-r--r--src/CheckpointRecovery.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/param.ccl b/param.ccl
index affe632..da9f22f 100644
--- a/param.ccl
+++ b/param.ccl
@@ -167,7 +167,7 @@ STRING recover_file "Basename of recovery file" STEERABLE = ALWAYS
{
".+" :: "A valid filename"
} "checkpoint.chkpt"
-STRING checkpoint_dir "Output directory for checkpoint files" STEERABLE = RECOVER
+STRING checkpoint_dir "Output directory for checkpoint files" STEERABLE = ALWAYS
{
".+" :: "A valid directory name"
} "."
diff --git a/src/CheckpointRecovery.c b/src/CheckpointRecovery.c
index 2101857..0c27a7f 100644
--- a/src/CheckpointRecovery.c
+++ b/src/CheckpointRecovery.c
@@ -209,11 +209,19 @@ char *IOUtil_AssembleFilename (const cGH *GH,
case CP_INITIAL_DATA:
dir = checkpoint_dir;
basename = checkpoint_ID_file;
+ if (CCTK_CreateDirectory(0755, checkpoint_dir) < 0)
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Checkpoint directory %s could not be created",
+ checkpoint_dir);
break;
case CP_EVOLUTION_DATA:
dir = checkpoint_dir;
basename = checkpoint_file;
+ if (CCTK_CreateDirectory(0755, checkpoint_dir) < 0)
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Checkpoint directory %s could not be created",
+ checkpoint_dir);
break;
case CP_RECOVER_DATA: