MUQ  0.4.3
muq::SamplingAlgorithms::ParallelAbstractSamplingProblem Class Reference

Parallelization layer supporting parallel models underlying a SamplingProblem. More...

#include <ParallelAbstractSamplingProblem.h>

Inheritance diagram for muq::SamplingAlgorithms::ParallelAbstractSamplingProblem:

Detailed Description

Parallelization layer supporting parallel models underlying a SamplingProblem.

This class passes a LogDensity call to all other ranks of the given communicator, initiated by rank zero.

Each other rank receives a copy of the parameter vector to work with. This allows computing a model (e.g. a PDE) underlying the LogDensity in parallel across all these ranks. It is assumed that rank 0 returns the exact LogDensity value. The actual model parallelization of course lies in the responsiblity of the user, since parallelization strategies vary extremely between different models.

This class is used by the controller rank responsible for handling the MCMC chains in a distributed model MCMC setting. To the controller, the ParallelAbstractSamplingProblem looks like a sequential SamplingProblem. The controller rank handles MCMC proposals, MCMC kernels and sample storage while the other ranks stand by, only joining the LogDensity computations.

Definition at line 37 of file ParallelAbstractSamplingProblem.h.

Public Member Functions

 ParallelAbstractSamplingProblem (std::shared_ptr< parcer::Communicator > comm, int id, std::shared_ptr< AbstractSamplingProblem > abstractSamplingProblem)
 
virtual ~ParallelAbstractSamplingProblem ()=default
 
virtual double LogDensity (std::shared_ptr< SamplingState > const &state) override
 
virtual std::shared_ptr< SamplingStateQOI () override
 
std::shared_ptr< AbstractSamplingProblemGetSequentialProblem ()
 
- Public Member Functions inherited from muq::SamplingAlgorithms::AbstractSamplingProblem
 AbstractSamplingProblem (Eigen::VectorXi const &blockSizesIn, Eigen::VectorXi const &blockSizesQOIIn)
 
 AbstractSamplingProblem (Eigen::VectorXi const &blockSizesIn)
 
virtual ~AbstractSamplingProblem ()=default
 
virtual std::shared_ptr< AbstractSamplingProblemClone () const
 
virtual Eigen::VectorXd GradLogDensity (std::shared_ptr< SamplingState > const &state, unsigned const blockWrt)
 
virtual void AddOptions (boost::property_tree::ptree &pt) const
 

Additional Inherited Members

- Public Attributes inherited from muq::SamplingAlgorithms::AbstractSamplingProblem
const int numBlocks
 
const Eigen::VectorXi blockSizes
 
const int numBlocksQOI
 
const Eigen::VectorXi blockSizesQOI
 

Constructor & Destructor Documentation

◆ ParallelAbstractSamplingProblem()

muq::SamplingAlgorithms::ParallelAbstractSamplingProblem::ParallelAbstractSamplingProblem ( std::shared_ptr< parcer::Communicator >  comm,
int  id,
std::shared_ptr< AbstractSamplingProblem abstractSamplingProblem 
)
inline

Definition at line 41 of file ParallelAbstractSamplingProblem.h.

References abstractSamplingProblem, comm, and id.

◆ ~ParallelAbstractSamplingProblem()

virtual muq::SamplingAlgorithms::ParallelAbstractSamplingProblem::~ParallelAbstractSamplingProblem ( )
virtualdefault

Member Function Documentation

◆ GetSequentialProblem()

std::shared_ptr<AbstractSamplingProblem> muq::SamplingAlgorithms::ParallelAbstractSamplingProblem::GetSequentialProblem ( )
inline

Definition at line 68 of file ParallelAbstractSamplingProblem.h.

References abstractSamplingProblem.

◆ LogDensity()

virtual double muq::SamplingAlgorithms::ParallelAbstractSamplingProblem::LogDensity ( std::shared_ptr< SamplingState > const &  state)
inlineoverridevirtual

◆ QOI()

virtual std::shared_ptr<SamplingState> muq::SamplingAlgorithms::ParallelAbstractSamplingProblem::QOI ( )
inlineoverridevirtual

Member Data Documentation

◆ abstractSamplingProblem

std::shared_ptr<AbstractSamplingProblem> muq::SamplingAlgorithms::ParallelAbstractSamplingProblem::abstractSamplingProblem
private

◆ comm

std::shared_ptr<parcer::Communicator> muq::SamplingAlgorithms::ParallelAbstractSamplingProblem::comm
private

◆ id

int muq::SamplingAlgorithms::ParallelAbstractSamplingProblem::id
private

Definition at line 73 of file ParallelAbstractSamplingProblem.h.

Referenced by ParallelAbstractSamplingProblem().


The documentation for this class was generated from the following file: