luntergroup / smcsmc

Demographic inference from whole genomes
GNU General Public License v3.0
11 stars 4 forks source link

debug for memory leak and assertion #17

Closed shajoezhu closed 9 years ago

shajoezhu commented 9 years ago

assertion fails at

shajoezhu commented 9 years ago

recheck the code for tracking local branch length, see https://github.com/shajoezhu/smcsmc/tree/testingDebuggingTraceTreeBL

shajoezhu commented 9 years ago

found another assertion failed https://github.com/shajoezhu/smcsmc/commit/187380450bf38c76c833297edeb720eaf25059a6

shajoezhu commented 9 years ago

Hi @gerton,

Donna and I have fixed the following assertion

    assert ( (segment_state == SEGMENT_INVARIANT) || (localTreeBranchLength == 0 ));

we were looking at the failing of the assertion, what I did was using the debug version to check the assertion, I ran the following:

$ ./smcsmc_dbg -Np 1 -seed 1

and it fails, and says

        scrm ===== BUILDING NEXT GENEALOGY =====
        scrm Segment Nr: 2
        scrm Sequence position: 77398.5
        scrm * Recombination at height 2650.67 (above 0xbe0c70)
        scrm * Cutting subtree below recombination 
        scrm * * New leaf of local tree: 0xbe10a0
        scrm * * New root of subtree: 0xbe1110
        scrm * * Done
        scrm * Starting coalescence
        scrm * * Time interval: 2650.67 - 4931.07 (Last event at 2650.67)
        scrm * * * Active Nodes: a0:0xbe1110:s1(p0) a1:0xbe0d90:s0(p0)
        scrm * * * Total Rates: 0.0001 0 0
        scrm * * * No Event

    ForestState Start Recording 

        scrm * * Time interval: 4931.07 - 1.79769e+308 (Last event at -1)
        scrm * * * Active Nodes: a0:0xbe1110:s1(p0) a1:0xbe0d90:s1(p0)
        scrm * * * Total Rates: 5e-05 0 0
        scrm * * * Event at time 26255.3: Pair-wise coalescence

    ForestState Start Recording 

        scrm * * Both nodes coalesced together
        scrm * * Implementing... done

    ForestState  Build new genealogy, compute the recombination opportunity at each level 
    ForestState  * * Time interval: 0 - 2650.67 , with 2 local Contemporaries, 2 * ( 2650.67 - 0)
    ForestState  * * Time interval: 2650.67 - 4931.07 , with 2 local Contemporaries, 2 * ( 4931.07 - 2650.67)
    ForestState  * * Time interval: 4931.07 - 26255.3 , with 2 local Contemporaries, 2 * ( 26255.3 - 4931.07)
    ForestState  * * Time interval: 26255.3 - 1.79769e+308 , with 0 local Contemporaries, 0 * ( 1.79769e+308 - 26255.3)
current_time_idx_ =  0 = [0,1.79769e+308
start_height 4931.07
recomb_t_position 2650.67
smcsmc_dbg: src/coalevent.hpp:147: void EvolutionaryEvent::set_recomb_event_time(double): Assertion `start_height <= recomb_t_position' failed.
Aborted (core dumped)

was wondering would you have some time this week we can have a go with this?

Best Joe

gerton commented 9 years ago

Hi Joe,

Would Wednesday 9.15 work for you?

BW Gerton

On 15 Jun 2015, at 15:58, Joe Zhu notifications@github.com wrote:

Hi @gerton https://github.com/gerton,

Donna and I have fixed the following assertion

assert ( (segment_state == SEGMENT_INVARIANT) || (localTreeBranchLength == 0 ));

we were looking at the failing of the assertion, what I did was using the debug version to check the assertion, I ran the following:

$ ./smcsmc_dbg -Np 1 -seed 1 and it fails, and says

    scrm ===== BUILDING NEXT GENEALOGY =====
    scrm Segment Nr: 2
    scrm Sequence position: 77398.5
    scrm * Recombination at height 2650.67 (above 0xbe0c70)
    scrm * Cutting subtree below recombination 
    scrm * * New leaf of local tree: 0xbe10a0
    scrm * * New root of subtree: 0xbe1110
    scrm * * Done
    scrm * Starting coalescence
    scrm * * Time interval: 2650.67 - 4931.07 (Last event at 2650.67)
    scrm * * * Active Nodes: a0:0xbe1110:s1(p0) a1:0xbe0d90:s0(p0)
    scrm * * * Total Rates: 0.0001 0 0
    scrm * * * No Event

ForestState Start Recording 

    scrm * * Time interval: 4931.07 - 1.79769e+308 (Last event at -1)
    scrm * * * Active Nodes: a0:0xbe1110:s1(p0) a1:0xbe0d90:s1(p0)
    scrm * * * Total Rates: 5e-05 0 0
    scrm * * * Event at time 26255.3: Pair-wise coalescence

ForestState Start Recording 

    scrm * * Both nodes coalesced together
    scrm * * Implementing... done

ForestState  Build new genealogy, compute the recombination opportunity at each level 
ForestState  * * Time interval: 0 - 2650.67 , with 2 local Contemporaries, 2 * ( 2650.67 - 0)
ForestState  * * Time interval: 2650.67 - 4931.07 , with 2 local Contemporaries, 2 * ( 4931.07 - 2650.67)
ForestState  * * Time interval: 4931.07 - 26255.3 , with 2 local Contemporaries, 2 * ( 26255.3 - 4931.07)
ForestState  * * Time interval: 26255.3 - 1.79769e+308 , with 0 local Contemporaries, 0 * ( 1.79769e+308 - 26255.3)

current_timeidx = 0 = [0,1.79769e+308 start_height 4931.07 recomb_t_position 2650.67 smcsmc_dbg: src/coalevent.hpp:147: void EvolutionaryEvent::set_recomb_event_time(double): Assertion `start_height <= recomb_t_position' failed. Aborted (core dumped) was wondering would you have some time this week we can have a go with this?

Best Joe

— Reply to this email directly or view it on GitHub https://github.com/luntergroup/smcsmc/pull/17#issuecomment-112097829.

shajoezhu commented 9 years ago

Hi Gerton

Yes, it works! Thank you very much. I will see you then.

best joe

On Mon, Jun 15, 2015 at 5:27 PM, gerton notifications@github.com wrote:

Hi Joe,

Would Wednesday 9.15 work for you?

BW Gerton

On 15 Jun 2015, at 15:58, Joe Zhu notifications@github.com wrote:

Hi @gerton https://github.com/gerton,

Donna and I have fixed the following assertion

assert ( (segment_state == SEGMENT_INVARIANT) || (localTreeBranchLength == 0 )); we were looking at the failing of the assertion, what I did was using the debug version to check the assertion, I ran the following:

$ ./smcsmc_dbg -Np 1 -seed 1 and it fails, and says

scrm ===== BUILDING NEXT GENEALOGY ===== scrm Segment Nr: 2 scrm Sequence position: 77398.5 scrm * Recombination at height 2650.67 (above 0xbe0c70) scrm * Cutting subtree below recombination scrm * * New leaf of local tree: 0xbe10a0 scrm * * New root of subtree: 0xbe1110 scrm * * Done scrm * Starting coalescence scrm * * Time interval: 2650.67 - 4931.07 (Last event at 2650.67) scrm * * * Active Nodes: a0:0xbe1110:s1(p0) a1:0xbe0d90:s0(p0) scrm * * * Total Rates: 0.0001 0 0 scrm * * * No Event

ForestState Start Recording

scrm * * Time interval: 4931.07 - 1.79769e+308 (Last event at -1) scrm * * * Active Nodes: a0:0xbe1110:s1(p0) a1:0xbe0d90:s1(p0) scrm * * * Total Rates: 5e-05 0 0 scrm * * * Event at time 26255.3: Pair-wise coalescence

ForestState Start Recording

scrm * * Both nodes coalesced together scrm * * Implementing... done

ForestState Build new genealogy, compute the recombination opportunity at each level ForestState * * Time interval: 0 - 2650.67 , with 2 local Contemporaries, 2 * ( 2650.67 - 0) ForestState * * Time interval: 2650.67 - 4931.07 , with 2 local Contemporaries, 2 * ( 4931.07 - 2650.67) ForestState * * Time interval: 4931.07 - 26255.3 , with 2 local Contemporaries, 2 * ( 26255.3 - 4931.07) ForestState * * Time interval: 26255.3 - 1.79769e+308 , with 0 local Contemporaries, 0 * ( 1.79769e+308 - 26255.3) current_timeidx = 0 = [0,1.79769e+308 start_height 4931.07 recomb_t_position 2650.67 smcsmc_dbg: src/coalevent.hpp:147: void EvolutionaryEvent::set_recomb_event_time(double): Assertion `start_height <= recomb_t_position' failed. Aborted (core dumped) was wondering would you have some time this week we can have a go with this?

Best Joe

— Reply to this email directly or view it on GitHub < https://github.com/luntergroup/smcsmc/pull/17#issuecomment-112097829>.

— Reply to this email directly or view it on GitHub https://github.com/luntergroup/smcsmc/pull/17#issuecomment-112127622.