Add a second repair stage after the realing stage of the router.

* New: In Katana::NegotiateWindow::_negociate(), if the realign stage is
    enabled, perform a second stage of repair after it. To do this we
    need to reverse the state of events marked as FailedRepair to Repair.
      We isolate the repair stage in a new dedicated function,
    NegociateWindow::_negociateRepair(). Maybe should do the same for
    each other negociate stage.
This commit is contained in:
Jean-Paul Chaput 2022-11-03 00:21:51 +01:00
parent 8c182672dd
commit 15412317ec
4 changed files with 70 additions and 60 deletions

View File

@ -661,51 +661,7 @@ namespace Katana {
if (RoutingEvent::getProcesseds() >= limit) setInterrupt( true ); if (RoutingEvent::getProcesseds() >= limit) setInterrupt( true );
} }
//_pack( count, true ); //_pack( count, true );
if (count and cmess2.enabled() and tty::enabled()) cmess1 << endl; _negociateRepair();
//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 << " <repair.queue:" << right << setw(8) << setfill('0')
<< _eventQueue.size() << ">" << setfill(' ') << endl;
count = 0;
//_eventQueue.prepareRepair();
while ( not _eventQueue.empty() and not isInterrupted() ) {
RoutingEvent* event = _eventQueue.pop();
if (tty::enabled()) {
cmess2 << " <repair.event:" << tty::bold << setw(8) << setfill('0')
<< RoutingEvent::getProcesseds() << tty::reset
<< " remains:" << right << setw(8) << setfill('0')
<< _eventQueue.size() << ">"
<< setfill(' ') << tty::reset << tty::cr;
cmess2.flush();
} else {
cmess2 << " <repair.event:" << setw(8) << setfill('0')
<< RoutingEvent::getProcesseds() << setfill(' ') << " "
<< event->getEventLevel() << ":" << event->getPriority() << "> "
<< event->getSegment()
<< endl;
cmess2.flush();
}
event->process( _eventQueue, _eventHistory, _eventLoop );
count++;
if (RoutingEvent::getProcesseds() >= limit) setInterrupt( true );
}
if (_katana->getConfiguration()->runRealignStage()) { if (_katana->getConfiguration()->runRealignStage()) {
cmess1 << " o Realign Stage." << endl; cmess1 << " o Realign Stage." << endl;
@ -742,6 +698,8 @@ namespace Katana {
count++; count++;
if (RoutingEvent::getProcesseds() >= limit) setInterrupt( true ); if (RoutingEvent::getProcesseds() >= limit) setInterrupt( true );
} }
_negociateRepair();
} }
if (count and cmess2.enabled() and tty::enabled()) cmess1 << endl; 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 << " <repair.queue:" << right << setw(8) << setfill('0')
<< _eventQueue.size() << ">" << setfill(' ') << endl;
while ( not _eventQueue.empty() and not isInterrupted() ) {
RoutingEvent* event = _eventQueue.pop();
if (tty::enabled()) {
cmess2 << " <repair.event:" << tty::bold << setw(8) << setfill('0')
<< RoutingEvent::getProcesseds() << tty::reset
<< " remains:" << right << setw(8) << setfill('0')
<< _eventQueue.size() << ">"
<< setfill(' ') << tty::reset << tty::cr;
cmess2.flush();
} else {
cmess2 << " <repair.event:" << setw(8) << setfill('0')
<< RoutingEvent::getProcesseds() << setfill(' ') << " "
<< event->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 ) void NegociateWindow::run ( Flags flags )
{ {
cdebug_log(159,1) << "NegociateWindow::run()" << endl; cdebug_log(159,1) << "NegociateWindow::run()" << endl;

View File

@ -47,19 +47,18 @@ namespace Katana {
class DataNegociate { class DataNegociate {
public: public:
enum SlackState { RipupPerpandiculars = 1 static const uint32_t RipupPerpandiculars = 1;
, Minimize = 2 static const uint32_t Minimize = 2;
, Dogleg = 3 static const uint32_t Dogleg = 3;
, Slacken = 4 static const uint32_t Slacken = 4;
, ConflictSolveByHistory = 5 static const uint32_t ConflictSolveByHistory = 5;
, ConflictSolveByPlaceds = 6 static const uint32_t ConflictSolveByPlaceds = 6;
, LocalVsGlobal = 7 static const uint32_t LocalVsGlobal = 7;
, MoveUp = 8 static const uint32_t MoveUp = 8;
, MaximumSlack = 9 static const uint32_t MaximumSlack = 9;
, Unimplemented = 10 static const uint32_t Unimplemented = 10;
, Repair = 11 static const uint32_t Repair = 11;
, RepairFailed = 12 static const uint32_t RepairFailed = 12;
};
public: public:
DataNegociate ( TrackElement* ); DataNegociate ( TrackElement* );
~DataNegociate (); ~DataNegociate ();

View File

@ -110,6 +110,7 @@ namespace Katana {
void _associateSymmetrics (); void _associateSymmetrics ();
void _pack ( size_t& count, bool last ); void _pack ( size_t& count, bool last );
size_t _negociate (); size_t _negociate ();
void _negociateRepair ();
Hurricane::Record* _getRecord () const; Hurricane::Record* _getRecord () const;
std::string _getString () const; std::string _getString () const;
inline std::string _getTypeName () const; inline std::string _getTypeName () const;

View File

@ -1,14 +1,14 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // 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 | // | 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 | // | K i t e - D e t a i l e d R o u t e r |
// | | // | |
// | Author : Jean-Paul CHAPUT | // | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Header : "./katana/RoutingEvent.h" | // | C++ Header : "./katana/RoutingEvent.h" |
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+