Skip to content

Commit

Permalink
Merge pull request #259 from Argonne-National-Laboratory/issue#258patch
Browse files Browse the repository at this point in the history
Issue#258patch
  • Loading branch information
kibaekkim authored Mar 2, 2023
2 parents a000f10 + 98f0b4b commit 918333d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/Solver/DualDecomp/DdDriverMpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
7 changes: 5 additions & 2 deletions src/Solver/DualDecomp/DdDriverSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ DSP_RTN_CODE DdDriverSerial::run()

/** run */
DSP_RTN_CHECK_THROW(mw_->run());

/** toc */
cputime_ = CoinCpuTime() - cputime_;
walltime_ = CoinGetTimeOfDay() - walltime_;
Expand All @@ -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 */
Expand Down

0 comments on commit 918333d

Please sign in to comment.