Parallelization layer supporting parallel models underlying a SamplingProblem. More...
#include <ParallelAbstractSamplingProblem.h>
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< SamplingState > | QOI () override |
std::shared_ptr< AbstractSamplingProblem > | GetSequentialProblem () |
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< AbstractSamplingProblem > | Clone () 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 |
|
inline |
Definition at line 41 of file ParallelAbstractSamplingProblem.h.
References abstractSamplingProblem, comm, and id.
|
virtualdefault |
|
inline |
Definition at line 68 of file ParallelAbstractSamplingProblem.h.
References abstractSamplingProblem.
|
inlineoverridevirtual |
Implements muq::SamplingAlgorithms::AbstractSamplingProblem.
Definition at line 51 of file ParallelAbstractSamplingProblem.h.
References abstractSamplingProblem, comm, muq::SamplingAlgorithms::LOGDENSITY, and muq::SamplingAlgorithms::WorkgroupTag.
|
inlineoverridevirtual |
Reimplemented from muq::SamplingAlgorithms::AbstractSamplingProblem.
Definition at line 64 of file ParallelAbstractSamplingProblem.h.
References abstractSamplingProblem.
|
private |
Definition at line 75 of file ParallelAbstractSamplingProblem.h.
Referenced by GetSequentialProblem(), LogDensity(), ParallelAbstractSamplingProblem(), and QOI().
|
private |
Definition at line 74 of file ParallelAbstractSamplingProblem.h.
Referenced by LogDensity(), and ParallelAbstractSamplingProblem().
|
private |
Definition at line 73 of file ParallelAbstractSamplingProblem.h.
Referenced by ParallelAbstractSamplingProblem().