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);
+ }
}
}
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();
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+" );
}
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),