@@ -445,13 +445,17 @@ class TotalCommunicationScheduler : public Scheduler<GraphT> {
445445 Expr expr1, expr2;
446446 assert (maxNumberSupersteps_ <= std::numeric_limits<int >::max ());
447447 for (unsigned step = 0 ; step < maxNumberSupersteps_; step++) {
448- expr1 += nodeToProcessorSuperstepVar_[ep.source ][p1][static_cast <int >(step)];
449- expr2 += nodeToProcessorSuperstepVar_[ep.target ][p2][static_cast <int >(step)];
448+ expr1 += nodeToProcessorSuperstepVar_[Source (ep, instance.GetComputationalDag ())][p1]
449+ [static_cast <int >(step)];
450+ expr2 += nodeToProcessorSuperstepVar_[Target (ep, instance.GetComputationalDag ())][p2]
451+ [static_cast <int >(step)];
450452 }
451453 model_.AddConstr (edgeVars_[p1][p2][edgeId] >= expr1 + expr2 - 1.001 );
452454
453- totalEdgesCut += edgeVars_[p1][p2][edgeId] * instance.GetComputationalDag ().VertexCommWeight (ep.source )
454- * instance.SendCosts (p1, p2);
455+ totalEdgesCut
456+ += edgeVars_[p1][p2][edgeId]
457+ * instance.GetComputationalDag ().VertexCommWeight (Source (ep, instance.GetComputationalDag ()))
458+ * instance.SendCosts (p1, p2);
455459
456460 edgeId++;
457461 }
@@ -469,20 +473,23 @@ class TotalCommunicationScheduler : public Scheduler<GraphT> {
469473 for (unsigned p1 = 0 ; p1 < instance.NumberOfProcessors (); p1++) {
470474 Expr expr1, expr2;
471475 for (unsigned step = 0 ; step < maxNumberSupersteps_; step++) {
472- expr1 += nodeToProcessorSuperstepVar_[ep.source ][p1][static_cast <int >(step)];
476+ expr1
477+ += nodeToProcessorSuperstepVar_[Source (ep, instance.GetComputationalDag ())][p1][static_cast <int >(step)];
473478 }
474479
475480 for (unsigned p2 = 0 ; p2 < instance.NumberOfProcessors (); p2++) {
476481 if (p1 != p2) {
477482 for (unsigned step = 0 ; step < maxNumberSupersteps_; step++) {
478- expr2 += nodeToProcessorSuperstepVar_[ep.target ][p2][static_cast <int >(step)];
483+ expr2 += nodeToProcessorSuperstepVar_[Target (ep, instance.GetComputationalDag ())][p2]
484+ [static_cast <int >(step)];
479485 }
480486 }
481487 }
482488 model_.AddConstr (edgeVars_[0 ][0 ][edgeId] >= expr1 + expr2 - 1.001 );
483489 }
484490
485- totalEdgesCut += instance.GetComputationalDag ().VertexCommWeight (ep.source ) * edgeVars_[0 ][0 ][edgeId];
491+ totalEdgesCut += instance.GetComputationalDag ().VertexCommWeight (Source (ep, instance.GetComputationalDag ()))
492+ * edgeVars_[0 ][0 ][edgeId];
486493
487494 edgeId++;
488495 }
@@ -606,6 +613,7 @@ class TotalCommunicationScheduler : public Scheduler<GraphT> {
606613 LoadInitialSchedule ();
607614 }
608615
616+ model_.SetDblParam (COPT_DBLPARAM_TIMELIMIT, timeLimitSeconds_);
609617 model_.SetIntParam (COPT_INTPARAM_THREADS, 128 );
610618 model_.SetIntParam (COPT_INTPARAM_STRONGBRANCHING, 1 );
611619 model_.SetIntParam (COPT_INTPARAM_LPMETHOD, 1 );
0 commit comments