diff options
-rw-r--r-- | param.ccl | 2 | ||||
-rw-r--r-- | src/CheckpointRecovery.c | 8 |
2 files changed, 9 insertions, 1 deletions
@@ -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: |