@@ -25,7 +25,7 @@ limitations under the License.
2525namespace osp {
2626
2727template <typename Graph_t>
28- class AcyclicPartitioningILP : public Scheduler <Graph_t> {
28+ class AcyclicPartitioningILP {
2929
3030 static_assert (is_computational_dag_v<Graph_t>, " PebblingSchedule can only be used with computational DAGs." );
3131
@@ -64,6 +64,8 @@ class AcyclicPartitioningILP : public Scheduler<Graph_t> {
6464
6565 std::vector<bool > is_original_source;
6666
67+ unsigned time_limit_seconds;
68+
6769 protected:
6870 std::vector<VarArray> node_in_partition;
6971 std::vector<VarArray> hyperedge_intersects_partition;
@@ -84,9 +86,6 @@ class AcyclicPartitioningILP : public Scheduler<Graph_t> {
8486
8587 RETURN_STATUS computePartitioning (const BspInstance<Graph_t> &instance, std::vector<unsigned >& partitioning);
8688
87- // not used, only here for using scheduler class base functionality (status enums, timelimits, etc)
88- virtual RETURN_STATUS computeSchedule (BspSchedule<Graph_t> &schedule) override ;
89-
9089 /* *
9190 * @brief Enables writing intermediate solutions.
9291 *
@@ -139,7 +138,7 @@ class AcyclicPartitioningILP : public Scheduler<Graph_t> {
139138 *
140139 * @return The name of the schedule.
141140 */
142- virtual std::string getScheduleName () const override { return " AcyclicPartitioningILP" ; }
141+ virtual std::string getScheduleName () const { return " AcyclicPartitioningILP" ; }
143142
144143 // getters and setters for problem parameters
145144 inline std::pair<unsigned , unsigned > getMinAndMaxSize () const { return std::make_pair (minPartitionSize, maxPartitionSize); }
@@ -149,14 +148,15 @@ class AcyclicPartitioningILP : public Scheduler<Graph_t> {
149148 inline void setNumberOfParts (const unsigned number_of_parts) {numberOfParts = number_of_parts; }
150149 inline void setIgnoreSourceForConstraint (const bool ignore_) {ignore_sources_for_constraint = ignore_; }
151150 inline void setIsOriginalSource (const std::vector<bool >& is_original_source_) {is_original_source = is_original_source_; }
151+ void setTimeLimitSeconds (unsigned time_limit_seconds_) { time_limit_seconds = time_limit_seconds_; }
152152};
153153
154154template <typename Graph_t>
155155void AcyclicPartitioningILP<Graph_t>::solveILP() {
156156
157157 model.SetIntParam (COPT_INTPARAM_LOGTOCONSOLE, 0 );
158158
159- model.SetDblParam (COPT_DBLPARAM_TIMELIMIT, Scheduler<Graph_t>::timeLimitSeconds );
159+ model.SetDblParam (COPT_DBLPARAM_TIMELIMIT, time_limit_seconds );
160160 model.SetIntParam (COPT_INTPARAM_THREADS, 128 );
161161
162162 model.SetIntParam (COPT_INTPARAM_STRONGBRANCHING, 1 );
@@ -347,9 +347,4 @@ std::vector<unsigned> AcyclicPartitioningILP<Graph_t>::returnAssignment(const Bs
347347 return node_to_partition;
348348}
349349
350- template <typename Graph_t>
351- RETURN_STATUS AcyclicPartitioningILP<Graph_t>::computeSchedule(BspSchedule<Graph_t> &) {
352- return RETURN_STATUS::ERROR;
353- }
354-
355350}
0 commit comments