Skip to content

Fix performance test suite #17

Closed
Closed

Description

@fredRos

Breaks with parallel build

$ make
...
g++ -g -Wall -fPIC -Wno-deprecated -O2 -pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.02.00/include/root -I./ -I./include -I/src -I/home/beaujean/.local/sw/bat/linux-ubuntu-14.04-x86_64/0.9.4/include -pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.02.00/include/root -g -O2  obj/runTestSuite.o -lBATTS -L. -L/home/beaujean/.local/sw/bat/linux-ubuntu-14.04-x86_64/0.9.4/lib -lBAT -lBATmodels -lBATmtf -lBATmvc -L/home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.02.00/lib/root -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMinuit -lRooFitCore -lRooFit -lRooStats -lFoam   -o runTestSuite
/usr/bin/ld: cannot find -lBATTS
collect2: error: ld returned 1 exit status
make: *** [runTestSuite] Error 1
make: *** Waiting for unfinished jobs....

but typing make again finished the linking

Activity

  1. self-assigned this
    on Nov 20, 2014
  2. added this to the 1.0 milestone on Nov 20, 2014
  3. changed the title [-]Fix performance test suite build[/-] [+]Fix performance test suite[/+] on Aug 24, 2015
  4. fredRos commented on Aug 24, 2015

    @fredRos
    ContributorAuthor
    • The binomial example seemed to have issues with --enable-parallelization. This is not true anymore.
    • at run time, this error was continuously emitted Error in <TH1D::ComputeIntegral>: Integral = zero
  5. fredRos commented on Aug 28, 2015

    @fredRos
    ContributorAuthor

    The parallel build still doesn't work but it is not important. I updated the tests to make sure they pass. A summary of the findings:

    Multivariate proposal

    • works with one and multiple threads
    • observe rather strong correlation between samples. the chi2 test is sensitive to independent samples so it passes only with a lag of 10 or 20
    • the bimodal examples are hard. This is expected because at the moment it draws from a multivariate Gaussian and thus the tail is light and transitions between modes are rare

    Product proposal

    • works with multiple threads
    • similar problems with chi2 test as for multivariate if autocorrelation is high

    General

    I get occasional segfaults, usually in some root destructors but it is not reproducible. I need to test on another machine and with other root versions. I think the heap is corrupted and I fear BAT is the cause. It could also be related to thread safety. The crashed usually happen after all tests ran.

    I used root 6.04.00

  6. fredRos commented on Sep 8, 2015

    @fredRos
    ContributorAuthor

    I tried to understand the segfaults closer. I didn't see any problem in any of the many examples I tried. So I think the problem is only in the performance test suite itself. With my development version c01690a I often (but not always) see this error

    $ ./runTestSuite 
    
     *** Break *** floating point exception
    
    
    
    ===========================================================
    There was a crash.
    This is the entire stack trace of all threads:
    ===========================================================
        from libstdcxx.v6.printers import register_libstdcxx_printers
    #0  0x00007f699e560b4c in __libc_waitpid (pid=6815, stat_loc=stat_loc
    entry=0x7ffe3cde7d40, options=options
    entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:31
    #1  0x00007f699e4e62e2 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
    #2  0x00007f699f298893 in TUnixSystem::StackTrace() () from /home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.04.02/lib/libCore.so
    #3  0x00007f699f29b0dc in TUnixSystem::DispatchSignals(ESignals) () from /home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.04.02/lib/libCore.so
    #4  <signal handler called>
    #5  TestSuite::SetLag (this=this
    entry=0x7ffe3cdea450, lag=lag
    entry=1) at src/TestSuite.cxx:51
    #6  0x0000000000400c75 in main () at runTestSuite.cxx:27
    ===========================================================
    
    
    The lines below might hint at the cause of the crash.
    If they do not help you then please submit a bug report at
    http://root.cern.ch/bugs. Please post the ENTIRE stack trace
    from above as an attachment in addition to anything else
    that might help us fixing this issue.
    ===========================================================
    #5  TestSuite::SetLag (this=this
    entry=0x7ffe3cdea450, lag=lag
    entry=1) at src/TestSuite.cxx:51
    #6  0x0000000000400c75 in main () at runTestSuite.cxx:27
    ===========================================================
    
    

    I used valgrind to analyze the problem. Ignoring many false(?) positives from ROOT, here the one useful thing valgrind tells me

    ==3244== Invalid read of size 4
    ==3244==    at 0x4E40772: TestSuite::SetLag(unsigned int) (TestSuite.cxx:51)
    ==3244==    by 0x400C74: main (runTestSuite.cxx:27)
    ==3244==  Address 0x145f5a84 is not stack'd, malloc'd or (recently) free'd
    ==3244== 
    ==3244== 
    

    The method in question is

    void TestSuite::SetLag(unsigned lag)
    {
        for (unsigned i = 0; i < GetNTests(); ++i) {
            PerfTestMCMC* m = static_cast<PerfTestMCMC*>(fTestContainer.at(i));
            // interpret NIterationsRun as desired #independent samples
            unsigned temp(m->MCMCGetNIterationsRun() * lag);
            unsigned iter = temp / m->MCMCGetNLag();
            m->MCMCSetNLag(lag);
            m->MCMCSetNIterationsRun(iter);
        }
    }

    and the line in question is

    unsigned iter = temp / m->MCMCGetNLag();

    unsigned iter = temp / m->MCMCGetNLag();

    Perhaps the memory at which this model m resides has been freed elsewhere? Usually valgrind would help but here it doesn't really help other than suggesting that the heap is corrupted. By default, valgrind spits out a lot of errors related to ROOT only. I updated the wiki how I proceeded.

    For reference, I used ROOT 6.04.02 precompiled from https://root.cern.ch/download/root_v6.04.02.Linux-ubuntu14-x86_64-gcc4.8.tar.gz

  7. fredRos commented on Sep 9, 2015

    @fredRos
    ContributorAuthor

    My bad, it was the evil static_cast to the wrong object that caused the invalid read. I fixed it in #67. In the future, we have to stay clear of this nasty stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions