[aspect-devel] Writing output in parallel

Wolfgang Bangerth bangerth at math.tamu.edu
Tue Feb 28 10:01:52 PST 2012


On 02/28/2012 06:08 PM, Thomas Geenen wrote:
> yep that looks like it
> but rather system ("mv tmp_filename filename &");

I'm already doing this on a background thread, so the '&' is somewhat 
implied :-) Your solution is dangerous since if the program terminates, 
it will also kill the descendent move job you start here. On a 
background job I have the option of at least waiting for the thread to 
finish in the destructor before the program terminates.


> beeing able to set the /scratch dir from the input(prm) file would be
> nice as well.

Why would you care to set it to something else than the system tmp 
directory?


> an added benefit of doing it like this is that you do not have to wait
> till the end of the run to inspect your results
> for curious people like me thats a huge advantage.....

Yes. Plus I think it's going to be a problem if many processors all at 
the same time start to move *all* of their big files -- at least it's 
going to take a while.

OK, so I think we have two solutions:
- Timo's MPI I/O solution for big machines with fast interconnects
- the background writer job above. I've just implemented this -- take a
   look. I do have a problem here, though: all functions like tmpname,
   tempnam, mktemp etc are marked as "do not use this function" and
   produce a linker warning. The only one one should use is mkstemp
   but this function creates a file handle that points to a file that
   is destroyed upon closing the file handle. How am I supposed to
   copy this file around then if it gets deleted right away?

Cheers
  W.

------------------------------------------------------------------------
Wolfgang Bangerth               email:            bangerth at math.tamu.edu
                                 www: http://www.math.tamu.edu/~bangerth/



More information about the Aspect-devel mailing list