Example `examples/SamplingAlgorithms/MC/Example1_Gaussian/ParallelMultilevelMonteCarlo.cpp` is not working

Issue #30 new
Henrik Reinstädtler created an issue

Error #1

Trying to run this example, following errors occurs:

terminate called after throwing an instance of 'boost::wrapexcept<boost::property_tree::ptree_bad_path>'
  what():  No such node (MLMCMC.Subsampling_0)

terminate called after throwing an instance of 'boost::wrapexcept<boost::property_tree::ptree_bad_path>'
  what():  No such node (MLMCMC.Scheduling)

Fixable by adding the following properties to the tree.

  pt.put("MLMCMC.Scheduling", false);
  pt.put("MLMCMC.Subsampling_0", 10);
  pt.put("MLMCMC.Subsampling_1", 1);
  pt.put("MLMCMC.Subsampling_2", 3);
  pt.put("MLMCMC.Subsampling_3", 0);

Error #2

Now the following error pops up:

terminate called after throwing an instance of 'boost::wrapexcept<boost::bad_any_cast>'

This is error is located in the file MUQ/SamplingAlgorithms/ParallelMIMCMCWorker.h

By replacing the lines, containing:

comm->Send<double>(AnyCast(latestSample->meta["LogTarget"]), status.MPI_SOURCE, ControlTag);

by the following if statement:

if(latestSample->HasMeta("LogTarget"))
  comm->Send<double>(AnyCast(latestSample->meta["LogTarget"]), status.MPI_SOURCE, ControlTag);
  else {
   double d;
   comm->Send<double>(d, status.MPI_SOURCE, ControlTag);
 }

So I basically send a garbage value to the other nodes, if meta["LogTarget"] is not defined. This probably comes from the DummyKernel used, that is not setting the meta[”LogTarget”].

Error #3

This leads to the following error:

[milan01:766307] *** Process received signal ***
[milan01:766307] Signal: Segmentation fault (11)
[milan01:766307] Signal code: Address not mapped (1)

Test plattform

All errors occur on all platforms tested (ubuntu, Mac, Debian). On Debian and ubuntu gcc 11 is used. On Mac clang 13.

Btw. the following example works: examples/SamplingAlgorithms/MCMC/Example3_MultilevelGaussian/cpp/FullParallelMultilevelGaussianSampling.cpp

Comments (0)

  1. Log in to comment