/******************************************************************* * Declaration: This class is partially based on Glinsky's version that * can be found in the "oldsource" directory. * * DESCRIPTION: class ParallelNodeCoordinatorState * * AUTHOR: Qi (Jacky) Liu * * EMAIL: mailto://liuqi@sce.carleton.ca * * DATE: Sept, 2005 * *******************************************************************/ #include "pNCoordState.h" #include "pncoord.h" //Nov. 14, 2005 #include "event.h" #include "eventlist.h" #include "JackyDebugStream.h" //Nov. 14, 2005 /******************************************************************* * Function Name: constructor ********************************************************************/ inline ParallelNodeCoordinatorState::ParallelNodeCoordinatorState(){ } /******************************************************************* * Function Name: destructor ********************************************************************/ inline ParallelNodeCoordinatorState::~ParallelNodeCoordinatorState() { } /******************************************************************* * Function Name: operator = ********************************************************************/ ParallelNodeCoordinatorState& ParallelNodeCoordinatorState::operator=(ParallelNodeCoordinatorState& thisState) { (ParallelProcessorState &)*this = (ParallelProcessorState &) thisState; this->nextMsgType = thisState.nextMsgType; //eventsCursor is now defined in the ParallelNodeCoordinator class //since we don't want to rollback this cursor. i.e. if an external event has been sent out, //after a rollback, it will be unprocessed, and we don't send it again!!! (this->eventsCursor) = (thisState.eventsCursor); //Nov. 14, 2005 this->dormant = thisState.dormant; this->remoteNCList = thisState.remoteNCList; // Oct. 19, 2005 //*(this->bag) = *(thisState.bag); // Oct. 26, 2005 //this->bagref = thisState.bagref; //[2006-03-15] return *this; } /******************************************************************* * Function Name: copyState() ********************************************************************/ void ParallelNodeCoordinatorState::copyState(BasicState *rhs) { *this = *((ParallelNodeCoordinatorState *) rhs); } /******************************************************************* * Function Name: getSize() ********************************************************************/ int ParallelNodeCoordinatorState::getSize() const { return sizeof(ParallelNodeCoordinatorState); } #ifdef JACKY_DEBUG // Nov. 14, 2005 =================================================================== void ParallelNodeCoordinatorState::showCurrentEvent( ostream& out ) const { MachineId mid = ParallelMainSimulator::Instance().getMachineID(); ProcId NCId = ParallelMainSimulator::Instance().nodeCoordinatorsList[mid]; ParallelNodeCoordinator& nc = (ParallelNodeCoordinator&)(SingleParallelProcessorAdmin::Instance().processor(NCId)); for (EventList::const_iterator cursor = nc.events().begin() ; cursor != nc.events().end() ; cursor++ ) { if( cursor == nc.currentEvent() ){ out << "<*>" << flush; } out << cursor->asString() << endl << flush; } if( nc.endOfEvents() == true ){ out << "==== currentEvent() -> END ====" << endl << flush; } } #endif //==============================================================================================