1 #ifndef REMOTEMIPROPOSAL_H_
2 #define REMOTEMIPROPOSAL_H_
13 #include <boost/property_tree/ptree.hpp>
16 #include <boost/property_tree/ptree.hpp>
17 namespace pt = boost::property_tree;
20 namespace SamplingAlgorithms {
40 std::shared_ptr<SamplingState>
Sample(std::shared_ptr<SamplingState>
const& currentState) {
46 Eigen::VectorXd remoteState =
comm->Recv<Eigen::VectorXd>(remoteRank,
ControlTag);
47 double remoteLogTarget =
comm->Recv<
double>(remoteRank,
ControlTag);
48 Eigen::VectorXd remoteQOI =
comm->Recv<Eigen::VectorXd>(remoteRank,
ControlTag);
50 auto proposal = std::make_shared<SamplingState>(remoteState);
51 proposal->meta[
"QOI"] = std::make_shared<SamplingState>(remoteQOI);
52 proposal->meta[
"LogTarget"] = remoteLogTarget;
57 double LogDensity(std::shared_ptr<SamplingState>
const& currState,
58 std::shared_ptr<SamplingState>
const& propState) {
66 std::shared_ptr<parcer::Communicator>
comm;
std::shared_ptr< AbstractSamplingProblem > prob
Proposal retrieving samples from other ranks.
RemoteMIProposal(pt::ptree const &pt, std::shared_ptr< AbstractSamplingProblem > prob, std::shared_ptr< parcer::Communicator > comm, std::shared_ptr< MultiIndex > remoteIndex, std::shared_ptr< MultiIndex > sourceIndex, std::shared_ptr< PhonebookClient > phonebookClient)
std::shared_ptr< parcer::Communicator > comm
double LogDensity(std::shared_ptr< SamplingState > const &currState, std::shared_ptr< SamplingState > const &propState)
std::shared_ptr< MultiIndex > sourceIndex
std::shared_ptr< MultiIndex > remoteIndex
std::shared_ptr< SamplingState > Sample(std::shared_ptr< SamplingState > const ¤tState)
std::shared_ptr< PhonebookClient > phonebookClient
const int ControlTag
Tags separating MPI communication between control level processes and internal work group communicati...