brettc / partitionfinder

PartitionFinder discovers optimal partitioning schemes for DNA sequences.
Other
61 stars 44 forks source link

Catch segmentation faults from RAxML / PhyML #11

Open roblanf opened 10 years ago

roblanf commented 10 years ago

The basic idea here is that sometimes other programs we rely on will die horribly, for reasons we don't understand and can't fix. Right now, PF just exits saying that RAxML (or whatever) didn't execute successfully. It would be helpful to provide more information. The tips below from a user are to help sort that out.

INFO | 2014-02-18 00:35:33,405 | raxml | Estimating LG+G branch lengths on tree using RAxML ERROR | 2014-02-18 00:35:46,995 | raxml | RAxML did not execute successfully ERROR | 2014-02-18 00:35:48,179 | raxml | RAxML output follows, in case it's helpful for finding the problem ERROR | 2014-02-18 00:35:48,179 | raxml | ERROR | 2014-02-18 00:35:48,179 | raxml | ERROR | 2014-02-18 00:35:48,878 | main | Failed to run. See previous errors.

Email from the user:

we have been trying to get PartitionFinder 1.1.1 to run on a Linux machine of Dani Bartel with 8 GB of RAM. the test alignment file is 12 MB in size and has about 338,000 amino acid positions in 1348 partitions (I ran it on my machine in Aussie successfully, the one we both started together).

We compiled standard RAxML version from Brett's github 1 using the Makefile for GCC. RAxML crashed during LG+G branch length estimation (BLTREE) with a segmentation fault. We found out by running RAxML manually using this command (PartitionFinder runs it during its analysis):

raxml -f -e -s DATEN.phy -t TREE.phy -m PROTGAMMALG -n BLTREE -w START_TREE -e 1.0 -O

While a segmentation fault is never pretty and this is a RAxML issue (has already been posted to its developers) it would be nice if PartitionFinder would trap that segfault and provide a more useful error message than in the attached file.

You could trap the segmentation fault signal (SIGSEGV) using the signal module 2 and write a handler like described in [3] that at least tells the user that something terribly wrong happened to the subprocess. [this here was written by Malte Petersen with helps me currently here in the US ti get run everything)

Would this be possible? I'm sure future users would greatly appreciate this improvement!

[3]: http://stackoverflow.com/questions/10929162/how-can-i-catch-a-seg-fault-while-importing-an-f2py-module/10929333#10929333