Skip to content

bug fix initialization - #74

Merged
oschulz merged 11 commits into
bat:masterfrom
fredRos:mcmcinitialize
Sep 22, 2015
Merged

oschulz merged 11 commits into
bat:masterfrom
fredRos:mcmcinitialize

Conversation

@fredRos

@fredRos fredRos commented Sep 16, 2015

Copy link
Copy Markdown
Contributor

fix seg faults in examples deriving from BCFitter mentioned in #72

@fredRos fredRos added the bug label Sep 16, 2015
@fredRos fredRos added this to the 1.0 milestone Sep 16, 2015
@fredRos

fredRos commented Sep 16, 2015

Copy link
Copy Markdown
Contributor Author

There still is a segfault if bat is compiled with threads and optimization as in

./configure --enable-parallelization

but there is no issue with

/configure --enable-parallelization --enable-debug

with root 6.04.02 on linux.

@fredRos

fredRos commented Sep 21, 2015

Copy link
Copy Markdown
Contributor Author

With root 6.04.02 and 6.05.02 on linux, in the current version of my branch rebased to master, 2dce4b9, make check works with

./configure --disable-static --enable-roostats --with-cuba=...

but with

./configure --disable-static --enable-roostats --with-cuba=... --enable-parallelization

I get these errors with efficiencyFitter

...
Summary : Opening logfile log.txt
Summary : Marginalize using Metropolis
Summary : Pre-run Metropolis MCMC for model "fitter_model_f1" ...
Summary :  --> Perform MCMC pre-run with 2 chains, each with maximum 10000 iterations
Error in <GSLError>: Error 1 in /mnt/vdb/lsf/workspace/root-release-6.04/BUILDTYPE/Release/COMPILER/native/LABEL/ubuntu14/build/root_v6.04.02-cmake/GSL-prefix/src/GSL/integration/workspace.c at 33 : workspace length n must be positive integer
Error in <GSLError>: Error 1 in /mnt/vdb/lsf/workspace/root-release-6.04/BUILDTYPE/Release/COMPILER/native/LABEL/ubuntu14/build/root_v6.04.02-cmake/GSL-prefix/src/GSL/integration/workspace.c at 33 : workspace length n must be positive integer

 *** Break *** segmentation violation

 *** Break *** segmentation violation

or more telling

#4  <signal handler called>
#5  0x00007f4a3442c7a0 in initialise () from /home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.04.02/lib/libMathMore.so
#6  0x00007f4a3442e11a in qags () from /home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.04.02/lib/libMathMore.so
#7  0x00007f4a3442dc29 in gsl_integration_qags () from /home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.04.02/lib/libMathMore.so
#8  0x00007f4a34416747 in ROOT::Math::GSLIntegrator::Integral(double, double) () from /home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.04.02/lib/libMathMore.so
#9  0x00007f4a3798c8f1 in TF1::IntegralOneDim(double, double, double, double, double&) () from /home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.04.02/lib/libHist.so
#10 0x00007f4a37980d97 in TF1::Integral(double, double, double) () from /home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.04.02/lib/libHist.so
#11 0x00007f4a379815a5 in TF1::Update() () from /home/beaujean/.local/sw/root/linux-ubuntu-14.04-x86_64/6.04.02/lib/libHist.so
#12 0x00007f4a358c3787 in BCEfficiencyFitter::LogLikelihood(std::vector<double, std::allocator<double> > const&) () from /home/beaujean/.local/sw/bat/linux-ubuntu-14.04-x86_64/mcmcinit/lib/libBATmodels.so.4.0.0
#13 0x00007f4a37ced1f5 in BCModel::LogProbabilityNN(std::vector<double, std::allocator<double> > const&) () from /home/beaujean/.local/sw/bat/linux-ubuntu-14.04-x86_64/mcmcinit/lib/libBAT.so.6.0.0
#14 0x00007f4a37cc000d in BCEngineMCMC::MCMCGetNewPointMetropolis(unsigned int, unsigned int) () from /home/beaujean/.local/sw/bat/linux-ubuntu-14.04-x86_64/mcmcinit/lib/libBAT.so.6.0.0
#15 0x00007f4a37cc0482 in BCEngineMCMC::MCMCGetNewPointMetropolis() [clone ._omp_fn.0] () from /home/beaujean/.local/sw/bat/linux-ubuntu-14.04-x86_64/mcmcinit/lib/libBAT.so.6.0.0

The example works with export OMP_NUM_THREADS=1. I have a number of questions, perhaps @oschulz knows:

  • If I update the parameters, some integral is computed. Why? I don't see why it's needed and I would like to turn it off
  • why is the call to GSL incorrect only when using multiple threads? Is that a bug in root itself? Is the TF1 created with the copy ctor not independent, thus not thread safe?
  • Does the problem arise because we create a function by a formula? In efficiencyFitter,
    TF1* f1 = new TF1("f1", "0.5*(1 + TMath::Erf((x-[0])/[1]))", 0.0, 100.0);
  • I copied the code into a compiled example and get the same errors. If I try to compile the old-school way with root efficiencyFitter.C++, it fails with missing includes. But I guess that's useless anways for root 6.

@fredRos

fredRos commented Sep 21, 2015

Copy link
Copy Markdown
Contributor Author

I think we can accept this pull request as I fixed many issues in bat. The latest error is different and is covered in #81

oschulz added a commit that referenced this pull request Sep 22, 2015
@oschulz
oschulz merged commit 05946f8 into bat:master Sep 22, 2015
fredRos pushed a commit to fredRos/bat that referenced this pull request Sep 29, 2015
@fredRos
fredRos deleted the mcmcinitialize branch January 19, 2016 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants