Nils,
I have seen this behavior as well. Did you see Steve’s suggestion in an earlier post? Here it is again (below). Can you test his change and see if it fixes the problem (without having to close/open the file each time)?
Thanks,
Stan
Here is Steve’s suggestion:
Maybe the file needs to be truncated in overwrite mode,
in case the new version is shorter than the old.
Try adding the 2nd overwrite if clause in fix_ave_correlate.cpp:
// output result to file
if (fp && me == 0) {
if (overwrite) fseek(fp,filepos,SEEK_SET);
fprintf(fp,BIGINT_FORMAT " %d\n",ntimestep,nrepeat);
for (i = 0; i < nrepeat; i++) {
fprintf(fp,"%d %d %d",i+1,inevery,count[i]);
if (count[i])
for (j = 0; j < npair; j++)
fprintf(fp," %g",prefactorcorr[i][j]/
count[i]);
else
for (j = 0; j < npair; j++)
fprintf(fp," 0.0");
fprintf(fp,"\n");
}
fflush(fp);
if (overwrite) { // add these lines
long fileend = ftell(fp);
ftruncate(fileno(fp),fileend);
}
}
You also need #include “unistd.h” at the top.
If that fixes the issue, I’ll post a patch.
Steve