diff --git a/src/Solver/DualDecomp/DdDriverMpi.cpp b/src/Solver/DualDecomp/DdDriverMpi.cpp index 67219412..6a5d4f4a 100644 --- a/src/Solver/DualDecomp/DdDriverMpi.cpp +++ b/src/Solver/DualDecomp/DdDriverMpi.cpp @@ -121,7 +121,11 @@ DSP_RTN_CODE DdDriverMpi::run() dualsol_.resize(ndualsol); CoinCopyN(mw_->master_->getBestDualSolution(), ndualsol, &dualsol_[0]); - numNodes_ = mw_->master_->getDspOsiPtr()->getNumNodes(); + if (mw_->master_->getDspOsiPtr()) { + numNodes_ = mw_->master_->getDspOsiPtr()->getNumNodes(); + } else { + numNodes_ = 0; + } numIterations_ = mw_->getIterationCount(); /** communicate */ diff --git a/src/Solver/DualDecomp/DdDriverSerial.cpp b/src/Solver/DualDecomp/DdDriverSerial.cpp index f7d638e0..07eedadc 100644 --- a/src/Solver/DualDecomp/DdDriverSerial.cpp +++ b/src/Solver/DualDecomp/DdDriverSerial.cpp @@ -50,7 +50,6 @@ DSP_RTN_CODE DdDriverSerial::run() /** run */ DSP_RTN_CHECK_THROW(mw_->run()); - /** toc */ cputime_ = CoinCpuTime() - cputime_; walltime_ = CoinGetTimeOfDay() - walltime_; @@ -70,7 +69,11 @@ DSP_RTN_CODE DdDriverSerial::run() CoinCopyN(master->getBestDualSolution(), model_->getNumCouplingRows(), &dualsol_[0]); bestprimsol_ = primsol_; bestdualsol_ = dualsol_; - numNodes_ = master->getDspOsiPtr()->getNumNodes(); + if (master->getDspOsiPtr()) { + numNodes_ = master->getDspOsiPtr()->getNumNodes(); + } else { + numNodes_ = 0; + } numIterations_ = mw_->getIterationCount(); } /** nullify master pointer */