11.07.2015 Views

Beyond Simple Monte-Carlo: Parallel Computing with QuantLib

Beyond Simple Monte-Carlo: Parallel Computing with QuantLib

Beyond Simple Monte-Carlo: Parallel Computing with QuantLib

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Message Passing Interface (MPI): Model Calibrationvoid MPICalibrationHelper::update() {if (world_->rank() == mpiRankId_) {modelValueF_ = std::async(std::launch::async,&CalibrationHelper::modelValue, helper_);}CalibrationHelper::update();}Real MPICalibrationHelper::modelValue() const {if (world_->rank() == mpiRankId_) {modelValue_ = modelValueF_.get();}boost::mpi::broadcast(*world_, modelValue_, mpiRankId_);}return modelValue_;int main(int argc, char* argv[]) {boost::mpi::environment env(argc, argv);....}Klaus Spanderen<strong>Beyond</strong> <strong>Simple</strong> <strong>Monte</strong>-<strong>Carlo</strong>: <strong>Parallel</strong> <strong>Computing</strong> <strong>with</strong> <strong>QuantLib</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!