#716: Adding steerable checkpoint directories --------------------+------------------------------------------------------- Reporter: ashley | Type: enhancement Status: new | Priority: minor Milestone: | Component: Other Version: | Keywords: --------------------+------------------------------------------------------- Hello!
With help from Frank and Erik I wrote a quick patch to enable steerable checkpoint directories in IOUtil. Here is what it looks like:
Index: param.ccl =================================================================== --- param.ccl (revision 285) +++ param.ccl (working copy) @@ -167,7 +167,7 @@ { ".+" :: "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" } "."
Index: CheckpointRecovery.c =================================================================== --- CheckpointRecovery.c (revision 285) +++ CheckpointRecovery.c (working copy) @@ -200,8 +200,8 @@ char *filename; const char *dir, *basename; char iteration_postfix[32], filenumber_postfix[32]; + int ierr;
- /* get the right parameters */ dir = basename = NULL; switch (called_from) @@ -209,11 +209,17 @@ case CP_INITIAL_DATA: dir = checkpoint_dir; basename = checkpoint_ID_file; + ierr = CCTK_CreateDirectory(0755, checkpoint_dir); + if(ierr<0) + CCTK_VWarn(0, __LINE__, __FILE__, "Checkpoint directory %s could not be created", checkpoint_dir); break;
case CP_EVOLUTION_DATA: dir = checkpoint_dir; basename = checkpoint_file; + ierr = CCTK_CreateDirectory(0755, checkpoint_dir); + if(ierr<0) + CCTK_VWarn(0, __LINE__, __FILE__, "Checkpoint directory %s could not be created", checkpoint_dir); break;
case CP_RECOVER_DATA:
I'm not 100% sure that this will work out in all cases, but I thought I'd put this here in case it was useful :)
#716: Adding steerable checkpoint directories --------------------------+------------------------------------------------- Reporter: ashley | Owner: Type: enhancement | Status: closed Priority: minor | Milestone: Component: Other | Version: Resolution: fixed | Keywords: --------------------------+------------------------------------------------- Changes (by knarf):
* status: new => closed * resolution: => fixed
trac@lists.einsteintoolkit.org