diff --git a/katana/src/NegociateWindow.cpp b/katana/src/NegociateWindow.cpp index 2da12bf1..fa86d881 100644 --- a/katana/src/NegociateWindow.cpp +++ b/katana/src/NegociateWindow.cpp @@ -661,51 +661,7 @@ namespace Katana { if (RoutingEvent::getProcesseds() >= limit) setInterrupt( true ); } //_pack( count, true ); - if (count and cmess2.enabled() and tty::enabled()) cmess1 << endl; - - //if (not _katana->isChannelMode() ) { - cdebug_log(9000,0) << "Deter| Repair Stage" << endl; - cmess1 << " o Repair Stage." << endl; - - cdebug_log(159,0) << "Loadind Repair queue." << endl; - _katana->setStage( StageRepair ); - for ( size_t i=0 ; (i<_eventHistory.size()) and not isInterrupted() ; i++ ) { - RoutingEvent* event = _eventHistory.getNth(i); - - if (not event->isCloned() and event->isUnimplemented()) { - event->reschedule( _eventQueue, 0 ); - } - } - _eventQueue.commit(); - cmess2 << " " << setfill(' ') << endl; - - count = 0; - //_eventQueue.prepareRepair(); - while ( not _eventQueue.empty() and not isInterrupted() ) { - RoutingEvent* event = _eventQueue.pop(); - - if (tty::enabled()) { - cmess2 << " " - << setfill(' ') << tty::reset << tty::cr; - cmess2.flush(); - } else { - cmess2 << " getEventLevel() << ":" << event->getPriority() << "> " - << event->getSegment() - << endl; - cmess2.flush(); - } - - event->process( _eventQueue, _eventHistory, _eventLoop ); - - count++; - if (RoutingEvent::getProcesseds() >= limit) setInterrupt( true ); - } + _negociateRepair(); if (_katana->getConfiguration()->runRealignStage()) { cmess1 << " o Realign Stage." << endl; @@ -742,6 +698,8 @@ namespace Katana { count++; if (RoutingEvent::getProcesseds() >= limit) setInterrupt( true ); } + + _negociateRepair(); } if (count and cmess2.enabled() and tty::enabled()) cmess1 << endl; @@ -764,6 +722,58 @@ namespace Katana { } + void NegociateWindow::_negociateRepair () + { + cdebug_log(159,1) << "NegociateWindow::_negociateRepair() - " << _segments.size() << endl; + + uint64_t limit = _katana->getEventsLimit(); + uint64_t count = 0; + if (count and cmess2.enabled() and tty::enabled()) cmess1 << endl; + + cmess1 << " o Repair Stage." << endl; + cdebug_log(159,0) << "Loadind Repair queue." << endl; + + _katana->setStage( StageRepair ); + for ( size_t i=0 ; (i<_eventHistory.size()) and not isInterrupted() ; i++ ) { + RoutingEvent* event = _eventHistory.getNth(i); + if (not event->isCloned() and (event->getState() >= DataNegociate::Unimplemented)) { + event->setState( DataNegociate::Repair ); + event->reschedule( _eventQueue, 0 ); + } + } + _eventQueue.commit(); + cmess2 << " " << setfill(' ') << endl; + + while ( not _eventQueue.empty() and not isInterrupted() ) { + RoutingEvent* event = _eventQueue.pop(); + + if (tty::enabled()) { + cmess2 << " " + << setfill(' ') << tty::reset << tty::cr; + cmess2.flush(); + } else { + cmess2 << " getEventLevel() << ":" << event->getPriority() << "> " + << event->getSegment() + << endl; + cmess2.flush(); + } + + event->process( _eventQueue, _eventHistory, _eventLoop ); + + count++; + if (RoutingEvent::getProcesseds() >= limit) setInterrupt( true ); + } + + cdebug_tabw(159,-1); + } + + void NegociateWindow::run ( Flags flags ) { cdebug_log(159,1) << "NegociateWindow::run()" << endl; diff --git a/katana/src/katana/DataNegociate.h b/katana/src/katana/DataNegociate.h index 70a41dae..31cf4360 100644 --- a/katana/src/katana/DataNegociate.h +++ b/katana/src/katana/DataNegociate.h @@ -47,19 +47,18 @@ namespace Katana { class DataNegociate { public: - enum SlackState { RipupPerpandiculars = 1 - , Minimize = 2 - , Dogleg = 3 - , Slacken = 4 - , ConflictSolveByHistory = 5 - , ConflictSolveByPlaceds = 6 - , LocalVsGlobal = 7 - , MoveUp = 8 - , MaximumSlack = 9 - , Unimplemented = 10 - , Repair = 11 - , RepairFailed = 12 - }; + static const uint32_t RipupPerpandiculars = 1; + static const uint32_t Minimize = 2; + static const uint32_t Dogleg = 3; + static const uint32_t Slacken = 4; + static const uint32_t ConflictSolveByHistory = 5; + static const uint32_t ConflictSolveByPlaceds = 6; + static const uint32_t LocalVsGlobal = 7; + static const uint32_t MoveUp = 8; + static const uint32_t MaximumSlack = 9; + static const uint32_t Unimplemented = 10; + static const uint32_t Repair = 11; + static const uint32_t RepairFailed = 12; public: DataNegociate ( TrackElement* ); ~DataNegociate (); diff --git a/katana/src/katana/NegociateWindow.h b/katana/src/katana/NegociateWindow.h index 2bc04b2d..a48cc587 100644 --- a/katana/src/katana/NegociateWindow.h +++ b/katana/src/katana/NegociateWindow.h @@ -110,6 +110,7 @@ namespace Katana { void _associateSymmetrics (); void _pack ( size_t& count, bool last ); size_t _negociate (); + void _negociateRepair (); Hurricane::Record* _getRecord () const; std::string _getString () const; inline std::string _getTypeName () const; diff --git a/katana/src/katana/RoutingEvent.h b/katana/src/katana/RoutingEvent.h index b0037b2e..4ad0f848 100644 --- a/katana/src/katana/RoutingEvent.h +++ b/katana/src/katana/RoutingEvent.h @@ -1,14 +1,14 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2018, All Rights Reserved +// Copyright (c) Sorbonne Université 2008-2022, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | // | K i t e - D e t a i l e d R o u t e r | // | | // | Author : Jean-Paul CHAPUT | -// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Header : "./katana/RoutingEvent.h" | // +-----------------------------------------------------------------+