matsen / pplacer

Phylogenetic placement and downstream analysis
http://matsen.fredhutch.org/pplacer/
GNU General Public License v3.0
75 stars 18 forks source link

Removal of files created by --mmap-file #286

Closed koadman closed 12 years ago

koadman commented 12 years ago

When processing large trees on machines with solid state storage but without enough RAM the --mmap-file helps to improve performance. However, these files are very large and the space is not freed at the end of a pplacer run. I would suggest a more usable interface would be to provide a parent directory via --mmap-file and that pplacer would create a temporary file (e.g. using a library call to generate a secure/random temp file name), and unlink the file immediately after opening. In doing so, the file will be guaranteed to be deleted as soon as pplacer exits, either normally or by force.

habnabit commented 12 years ago

Sure, --mmap-file can be changed to accept a file or a directory and immediately unlink the file in the directory case. Originally there was hope that the argument to --mmap-file could be reused for later runs of pplacer, but it turned out to be infeasible.