MUQ  0.4.3
muq::SamplingAlgorithms::ParallelMIComponentFactory Class Reference

Wrapper for MIComponentFactory supporting parallel model setup. More...

#include <ParallelMIComponentFactory.h>

Inheritance diagram for muq::SamplingAlgorithms::ParallelMIComponentFactory:

Detailed Description

Wrapper for MIComponentFactory supporting parallel model setup.

This MIComponentFactory provides parallelized model setup initiated by rank zero of the given communicator and makes those models available to be controlled by the root rank. This allows rank zero to set up SaplingProblem's through this factory exactly as if it was sequential; this class ensures that the other worker ranks perform the same SamplingProblem construction at the same time. In particular, parallel models are guaranteed to be set up in sync, so most external model codes should just work once the appropriate communicator is passed to them. Further, once SamplingProblem's are set up, worker processes listen for LogDensity requests from the respective ParallelAbstractSamplingProblem.

Definition at line 30 of file ParallelMIComponentFactory.h.

Public Member Functions

 ParallelMIComponentFactory (std::shared_ptr< parcer::Communicator > comm, std::shared_ptr< parcer::Communicator > global_comm, std::shared_ptr< MIComponentFactory > componentFactory)
 
virtual bool IsInverseProblem () override
 
void finalize ()
 Stops worker processes command loop, freeing them for other tasks. More...
 
virtual std::shared_ptr< MCMCProposalProposal (std::shared_ptr< MultiIndex > const &index, std::shared_ptr< AbstractSamplingProblem > const &samplingProblem) override
 
virtual std::shared_ptr< MultiIndex > FinestIndex () override
 
virtual std::shared_ptr< MCMCProposalCoarseProposal (std::shared_ptr< MultiIndex > const &fineIndex, std::shared_ptr< MultiIndex > const &coarseIndex, std::shared_ptr< AbstractSamplingProblem > const &coarseProblem, std::shared_ptr< SingleChainMCMC > const &coarseChain) override
 
virtual std::shared_ptr< AbstractSamplingProblemSamplingProblem (std::shared_ptr< MultiIndex > const &index) override
 
virtual std::shared_ptr< MIInterpolationInterpolation (std::shared_ptr< MultiIndex > const &index) override
 
virtual Eigen::VectorXd StartingPoint (std::shared_ptr< MultiIndex > const &index) override
 
- Public Member Functions inherited from muq::SamplingAlgorithms::MIComponentFactory
virtual ~MIComponentFactory ()=default
 

Constructor & Destructor Documentation

◆ ParallelMIComponentFactory()

muq::SamplingAlgorithms::ParallelMIComponentFactory::ParallelMIComponentFactory ( std::shared_ptr< parcer::Communicator >  comm,
std::shared_ptr< parcer::Communicator >  global_comm,
std::shared_ptr< MIComponentFactory componentFactory 
)
inline

Member Function Documentation

◆ CoarseProposal()

virtual std::shared_ptr<MCMCProposal> muq::SamplingAlgorithms::ParallelMIComponentFactory::CoarseProposal ( std::shared_ptr< MultiIndex > const &  fineIndex,
std::shared_ptr< MultiIndex > const &  coarseIndex,
std::shared_ptr< AbstractSamplingProblem > const &  coarseProblem,
std::shared_ptr< SingleChainMCMC > const &  coarseChain 
)
inlineoverridevirtual

◆ finalize()

void muq::SamplingAlgorithms::ParallelMIComponentFactory::finalize ( )
inline

Stops worker processes command loop, freeing them for other tasks.

Definition at line 86 of file ParallelMIComponentFactory.h.

References comm, muq::SamplingAlgorithms::FINALIZE, samplingProblems, and muq::SamplingAlgorithms::WorkgroupTag.

◆ FinestIndex()

virtual std::shared_ptr<MultiIndex> muq::SamplingAlgorithms::ParallelMIComponentFactory::FinestIndex ( )
inlineoverridevirtual

◆ Interpolation()

virtual std::shared_ptr<MIInterpolation> muq::SamplingAlgorithms::ParallelMIComponentFactory::Interpolation ( std::shared_ptr< MultiIndex > const &  index)
inlineoverridevirtual

◆ IsInverseProblem()

virtual bool muq::SamplingAlgorithms::ParallelMIComponentFactory::IsInverseProblem ( )
inlineoverridevirtual

Reimplemented from muq::SamplingAlgorithms::MIComponentFactory.

Definition at line 78 of file ParallelMIComponentFactory.h.

References componentFactory.

◆ Proposal()

virtual std::shared_ptr<MCMCProposal> muq::SamplingAlgorithms::ParallelMIComponentFactory::Proposal ( std::shared_ptr< MultiIndex > const &  index,
std::shared_ptr< AbstractSamplingProblem > const &  samplingProblem 
)
inlineoverridevirtual

◆ SamplingProblem()

virtual std::shared_ptr<AbstractSamplingProblem> muq::SamplingAlgorithms::ParallelMIComponentFactory::SamplingProblem ( std::shared_ptr< MultiIndex > const &  index)
inlineoverridevirtual

◆ StartingPoint()

virtual Eigen::VectorXd muq::SamplingAlgorithms::ParallelMIComponentFactory::StartingPoint ( std::shared_ptr< MultiIndex > const &  index)
inlineoverridevirtual

Member Data Documentation

◆ comm

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

◆ componentFactory

std::shared_ptr<MIComponentFactory> muq::SamplingAlgorithms::ParallelMIComponentFactory::componentFactory
private

◆ global_comm

std::shared_ptr<parcer::Communicator> muq::SamplingAlgorithms::ParallelMIComponentFactory::global_comm
private

Definition at line 137 of file ParallelMIComponentFactory.h.

◆ idcnt

int muq::SamplingAlgorithms::ParallelMIComponentFactory::idcnt = 0
private

Definition at line 135 of file ParallelMIComponentFactory.h.

Referenced by SamplingProblem().

◆ samplingProblems

std::map<int, std::shared_ptr<AbstractSamplingProblem> > muq::SamplingAlgorithms::ParallelMIComponentFactory::samplingProblems
private

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