From 16020fed3e14236968d593c5422d60b49730b0dd Mon Sep 17 00:00:00 2001 From: Hideaki Nakao Date: Wed, 15 Feb 2023 10:44:38 -0600 Subject: [PATCH 1/3] separated has_integer check from the loop --- src/Solver/DualDecomp/DdWorkerUB.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Solver/DualDecomp/DdWorkerUB.cpp b/src/Solver/DualDecomp/DdWorkerUB.cpp index 6f6b9441..35612347 100644 --- a/src/Solver/DualDecomp/DdWorkerUB.cpp +++ b/src/Solver/DualDecomp/DdWorkerUB.cpp @@ -132,6 +132,10 @@ DSP_RTN_CODE DdWorkerUB::createProblem() { for (int j = 0; j < mat_reco->getNumCols(); ++j) { obj_reco[j] *= tss->getProbability()[sind]; + } + + for (int j = 0; j < mat_reco->getNumCols(); ++j) + { if (ctype_reco[j] != 'C') { has_integer = true; From 7f7ad035be2ce39158c027dc0ed90b8148143811 Mon Sep 17 00:00:00 2001 From: Hideaki Nakao Date: Wed, 15 Feb 2023 11:52:13 -0600 Subject: [PATCH 2/3] changed version patch to 3 --- src/DspConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DspConfig.h b/src/DspConfig.h index 8ecba478..c6e36814 100644 --- a/src/DspConfig.h +++ b/src/DspConfig.h @@ -6,7 +6,7 @@ */ #define DSP_VERSION_MAJOR 1 #define DSP_VERSION_MINOR 5 -#define DSP_VERSION_PATCH 2 +#define DSP_VERSION_PATCH 3 #include From f57fd8437bd6f485ea7e83d6b81298db72e0d874 Mon Sep 17 00:00:00 2001 From: Hideaki Nakao Date: Fri, 17 Feb 2023 14:52:30 -0600 Subject: [PATCH 3/3] make chekc if Osi exists --- src/Solver/DualDecomp/DdDriverMpi.cpp | 6 +++++- src/Solver/DualDecomp/DdDriverSerial.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) 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 */