kr-colab / discoal

discoal is a coalescent simulation program capable of simulating models with recombination, selective sweeps, and demographic changes including population splits, admixture events, and ancient samples
GNU General Public License v3.0
48 stars 10 forks source link

Trajectory realloc #6

Closed molpopgen closed 4 years ago

molpopgen commented 6 years ago

Skips the really big allocation of currentTrajectory in favor of realloc.

Changes:

Note that MAXTRAJSIZE is set too small. This was intentional, in order to stress test the realloc code.

I also thing I added -g to the Makefile as I was tracking down a double free issue for a bit there...

andrewkern commented 6 years ago

i've been dragging my heels on this PR as it changes a lot of code. Have you been using this successfully? no issues?

molpopgen commented 6 years ago

My inclination would be to not merge this until a formal code review is conducted and/or unit tests are put in place.

I did use this for the case of running a single replicate, and results were identical to the current release. A good test would be to run a lot of replicates with both versions and compare output, but that wouldn't make a good integrated test.

The other oddity is that the VIRT allocations are still massive. Not sure why. When I get time, I'll throw some stronger profilers at the code, like a full-blown valgrind session, etc.

molpopgen commented 4 years ago

Closing due to inactivity.