diff --git a/apps/test_suite_runner/StringToScheduler/run_bsp_scheduler.hpp b/apps/test_suite_runner/StringToScheduler/run_bsp_scheduler.hpp index b1d934d6..d3fc8813 100644 --- a/apps/test_suite_runner/StringToScheduler/run_bsp_scheduler.hpp +++ b/apps/test_suite_runner/StringToScheduler/run_bsp_scheduler.hpp @@ -198,7 +198,8 @@ RETURN_STATUS run_bsp_scheduler(const ConfigParser &parser, const boost::propert if (status != RETURN_STATUS::OSP_SUCCESS && status != RETURN_STATUS::BEST_FOUND) { throw std::invalid_argument("Error while computing initial solution.\n"); } - scheduler.setInitialSolutionFromBspSchedule(initial_schedule); + BspScheduleCS initial_schedule_cs(initial_schedule); + scheduler.setInitialSolutionFromBspSchedule(initial_schedule_cs); } // intermediate solutions diff --git a/include/osp/bsp/model/BspScheduleCS.hpp b/include/osp/bsp/model/BspScheduleCS.hpp index 81fc2269..48fac842 100644 --- a/include/osp/bsp/model/BspScheduleCS.hpp +++ b/include/osp/bsp/model/BspScheduleCS.hpp @@ -112,7 +112,7 @@ class BspScheduleCS : public BspSchedule { const std::map &comm_) : BspSchedule(inst, processor_assignment_, superstep_assignment_), commSchedule(comm_) {} - BspScheduleCS(BspSchedule &&schedule) : BspSchedule(std::move(schedule)) { + explicit BspScheduleCS(BspSchedule &&schedule) : BspSchedule(std::move(schedule)) { setAutoCommunicationSchedule(); } @@ -124,7 +124,7 @@ class BspScheduleCS : public BspSchedule { comm_.clear(); } - BspScheduleCS(const BspSchedule &schedule) : BspSchedule(schedule) { + explicit BspScheduleCS(const BspSchedule &schedule) : BspSchedule(schedule) { setAutoCommunicationSchedule(); } diff --git a/tests/ilp_bsp_scheduler.cpp b/tests/ilp_bsp_scheduler.cpp index cd6b6f5f..1d93549d 100644 --- a/tests/ilp_bsp_scheduler.cpp +++ b/tests/ilp_bsp_scheduler.cpp @@ -174,13 +174,13 @@ BOOST_AUTO_TEST_CASE(test_full) { MaxBspScheduleCS schedule_max(instance); scheduler_max.setTimeLimitSeconds(10); const auto result_max = scheduler_max.computeMaxBspScheduleCS(schedule_max); - BOOST_CHECK_EQUAL(RETURN_STATUS::BEST_FOUND, result_max); + BOOST_CHECK(result_max == RETURN_STATUS::OSP_SUCCESS || result_max == RETURN_STATUS::BEST_FOUND); BOOST_CHECK(schedule_max.satisfiesPrecedenceConstraints()); BOOST_CHECK(schedule_max.hasValidCommSchedule()); scheduler_max.setInitialSolutionFromBspSchedule(schedule_max); const auto result_max2 = scheduler_max.computeMaxBspScheduleCS(schedule_max); - BOOST_CHECK_EQUAL(RETURN_STATUS::BEST_FOUND, result_max2); + BOOST_CHECK(result_max2 == RETURN_STATUS::OSP_SUCCESS || result_max2 == RETURN_STATUS::BEST_FOUND); BOOST_CHECK(schedule_max.satisfiesPrecedenceConstraints()); BOOST_CHECK(schedule_max.hasValidCommSchedule());