Merge branch 'release-4-5-patches' into rotation-4-5
authorCarsten Kutzner <ckutzne@gwdg.de>
Fri, 5 Nov 2010 08:54:34 +0000 (09:54 +0100)
committerCarsten Kutzner <ckutzne@gwdg.de>
Fri, 5 Nov 2010 08:54:34 +0000 (09:54 +0100)
src/gmxlib/checkpoint.c
src/gmxlib/futil.c
src/gmxlib/main.c
src/kernel/mdrun.c

index c31137433a262beef2f9b0c62ec2206ee72fed9b..2218171eb63c82191ad532b4c281288c7806b801 100644 (file)
@@ -1745,8 +1745,16 @@ static void read_checkpoint(const char *fn,FILE **pfplog,
                 if (_locking(fileno(gmx_fio_getfp(chksum_file)), _LK_NBLCK, LONG_MAX)==-1)
 #endif
                 {
-                    gmx_fatal(FARGS,"Failed to lock: %s. Already running "
-                        "simulation?", outputfiles[i].filename);
+                    if (errno!=EACCES && errno!=EAGAIN)
+                    {
+                        gmx_fatal(FARGS,"Failed to lock: %s. %s.",
+                                  outputfiles[i].filename, strerror(errno));
+                    }
+                    else 
+                    {
+                        gmx_fatal(FARGS,"Failed to lock: %s. Already running "
+                                  "simulation?", outputfiles[i].filename);
+                    }
                 }
             }
             
index f06e09892c0c043c648a333adfcd82d10cc11cd7..1c58f6d73e17a80610bc5c2afa3fe370bd230eef 100644 (file)
@@ -454,7 +454,7 @@ FILE *ffopen(const char *file,const char *mode)
 
     bRead= (mode[0]=='r'&&mode[1]!='+');
     strcpy(buf,file);
-    if (gmx_fexist(buf) || !bRead) {
+    if (!bRead || gmx_fexist(buf)) {
         if ((ff=fopen(buf,mode))==NULL)
             gmx_file(buf);
         where();
index b50ded75b68478fffa99c586a93830d0a08e6ec9..aeda0e0a795081d4d37aa32a236e46c9db611bbe 100644 (file)
@@ -238,17 +238,13 @@ void gmx_log_open(const char *lognm,const t_commrec *cr,gmx_bool bMasterOnly,
   
     debug_gmx();
 
-    if (!bMasterOnly)
+    if (!bMasterOnly && !MASTER(cr))
     {
         /* Since log always ends with '.log' let's use this info */
         par_fn(tmpnm,efLOG,cr,FALSE,!bMasterOnly,buf,255);
         fp = gmx_fio_fopen(buf, bAppend ? "a+" : "w+" );
     }
-#ifdef GMX_FAHCORE
     else if (!bAppend)
-#else
-    else
-#endif
     {
         fp = gmx_fio_fopen(tmpnm, bAppend ? "a+" : "w+" );
     }
index fd82a96d2c2470af726aa89e1e809b0232882e2c..6aef0054619e96860e7e581c1aca0910f254cb5b 100644 (file)
@@ -558,6 +558,11 @@ int main(int argc,char *argv[])
   sim_part_fn = sim_part;
   if (opt2bSet("-cpi",NFILE,fnm))
   {
+      if (bSepPot && bAppendFiles)
+      {
+          gmx_fatal(FARGS,"Output file appending is not supported with -seppot");
+      }
+
       bAppendFiles =
                 read_checkpoint_simulation_part(opt2fn_master("-cpi", NFILE,
                                                               fnm,cr),