diff options
Diffstat (limited to 'src/GHExtension.c')
-rw-r--r-- | src/GHExtension.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c index 66d868d..d7d90e9 100644 --- a/src/GHExtension.c +++ b/src/GHExtension.c @@ -5,8 +5,6 @@ @desc IOUtil GH extension stuff. @enddesc - @history - @endhistory @version $Id$ @@*/ @@ -22,6 +20,7 @@ #include "util_String.h" #include "StoreNamedData.h" +#include "CactusBase/IOUtil/src/ioutil_Utils.h" #include "ioGH.h" @@ -101,23 +100,6 @@ int IOUtil_InitGH (cGH *GH) myGH = (ioGH *) CCTK_GHExtension (GH, "IO"); - /* Create the checkpoint directory */ - if (CCTK_MyProc (GH) == 0) - { - i = CCTK_CreateDirectory (0755, checkpoint_dir); - if (i < 0) - { - CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, - "Problem creating checkpoint directory '%s'", - checkpoint_dir); - } - else if (i > 0) - { - CCTK_VWarn (5, __LINE__, __FILE__, CCTK_THORNSTRING, - "Checkpoint directory '%s' already exists", checkpoint_dir); - } - } - if (CCTK_Equals (out3D_mode, "proc")) { myGH->ioproc = CCTK_MyProc (GH); @@ -168,6 +150,23 @@ int IOUtil_InitGH (cGH *GH) myGH->unchunked = 0; } + /* create the checkpoint directory */ + i = IOUtil_CreateDirectory (GH, checkpoint_dir, + ! CCTK_Equals (out3D_mode, "onefile"), + myGH->ioproc); + if (i < 0) + { + CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, + "Problem creating checkpoint directory '%s'", + checkpoint_dir); + } + else if (i > 0 && CCTK_Equals (newverbose, "full")) + { + CCTK_VInfo (CCTK_THORNSTRING, + "IOUtil_InitGH: checkpoint directory '%s' already exists", + checkpoint_dir); + } + /* save downsampling parameters in ioUtilGH because they are temporarily reset during checkpointing */ /* for now we have only parameters for the first 3 dimensions |