bayesiancook / pbmpi

phylobayes mpi
GNU General Public License v2.0
23 stars 9 forks source link

Performance and Correctness Improvements #9

Open H2CO3 opened 6 years ago

H2CO3 commented 6 years ago

There is a potentially large (O(data size)) stack allocation in BPCompare(), which caused bpcomp to crash when run on a bigger data set and number of cycles (~500 proteins, 20 000 cycles). This has been mitigated by modifying the function so that is uses std::vector for heap allocation in place of VLAs on the stack (which aren't portable/standard C++ anyway).

The Makefile has also been modified so that the compiler and the linker receives the -flto flag. Most modern C++ compilers support this flag, and it demonstrably improves the performance of the emitted code.