[aspect-devel] Statistics file is easily deleted during model run

Eric Heien emheien at ucdavis.edu
Wed Jun 27 14:09:31 PDT 2012


This is probably due to the vagaries of Unix and the file system rather than any problem with Aspect.  To my understanding, Aspect rewrites the statistics file each time step with the whole simulation history.  If you happen to copy the statistics file after it's opened but before it is completely written and closed it will likely be empty.

The easy way to fix this is to write statistics each time step to a temporary file, then move this temporary file to overwrite the old one.  If there are no objections I can easily add this to Aspect.

-Eric

On Jun 27, 2012, at 11:59 AM, John Naliboff wrote:

> Hi all,
> 
> I've come across an issue with the statistics output file being easily deleted during a model run.  In the example below, I copied a statistics file from an active run to a new file, which deleted all of its contents:
> 
> 	naliboff >> du -sh bkb1Ra1e5/output_bkb1Ra1e5/statistics
> 	5.1M	bkb1Ra1e5/output_bkb1Ra1e5/statistics
> 	naliboff >> cp bkb1Ra1e5/output_bkb1Ra1e5/statistics stat
> 	naliboff >> du -sh bkb1Ra1e5/output_bkb1Ra1e5/statistics
> 	0	bkb1Ra1e5/output_bkb1Ra1e5/statistics
> 	naliboff >> 
> 
> The copy of the statistics file also has no contents:
> 	naliboff >> du -sh stat
> 	0	stat
> 	naliboff >> 
> 
> The same thing has definitely happened when I've open a statistics file with vi from an active model.  
> 
> Doing "du -sh" within the same folder as the statistics file may also erase the contents:
> 	naliboff >> du -sh output_bkb1Ra1e5/statistics 
> 	0	output_bkb1Ra1e5/statistics
> In the above case, at least, I don't remember going into the output folder prior to this morning, but another nefarious unix command may have killed the statistics file and I just don't remember.
> 
> Anyhow, I guess one solution to this problem is to not do any operation on the statistics file until the model is done running.
> 
> However, often times I want to plot some of the values within the statistics file during a run.  In that case, is there a way around the apparent sensitivity of the statistics file to various unix commands?
> 
> I guess another question is whether this issue is specific to the cluster I'm running aspect on at Davis.
> 
> Cheers,
> John
> 
> 
> 
> _______________________________________________
> Aspect-devel mailing list
> Aspect-devel at geodynamics.org
> http://geodynamics.org/cgi-bin/mailman/listinfo/aspect-devel



More information about the Aspect-devel mailing list