Scippy

UG

Ubiquity Generator framework

ParaCalculationState Class Referenceabstract

Base class of Calculation state in a ParaSolver. More...

#include <paraCalculationState.h>

+ Inheritance diagram for ParaCalculationState:

Public Member Functions

 ParaCalculationState ()
 Default Constructor. More...
 
 ParaCalculationState (double inCompTime, int inNSolved, int inTerminationState)
 Constructor. More...
 
virtual ~ParaCalculationState ()
 Destructor. More...
 
double getCompTime ()
 getter of computing time of a subproblem More...
 
int getNSolved ()
 geeter of the number of tasks solved in a subproblem More...
 
int getTerminationState ()
 getter of the termination state for solving the subproblem More...
 
virtual std::string toString ()=0
 stringfy ParaCalculationState More...
 
virtual std::string toSimpleString ()=0
 stringfy ParaCalculationState (simple string version) More...
 
virtual void send (ParaComm *comm, int destination, int tag)=0
 send this object to destination More...
 
virtual void receive (ParaComm *comm, int source, int tag)=0
 send this object to destination More...
 

Protected Attributes

double compTime
 computation time of this ParaTask More...
 
int nSolved
 the number of tasks solved More...
 
int terminationState
 indicate whether if this computation is terminationState or not. 0: no, 1: terminationState meaning can be defined in derived class More...
 

Detailed Description

Base class of Calculation state in a ParaSolver.

Definition at line 51 of file paraCalculationState.h.

Constructor & Destructor Documentation

◆ ParaCalculationState() [1/2]

Default Constructor.

Definition at line 63 of file paraCalculationState.h.

◆ ParaCalculationState() [2/2]

ParaCalculationState ( double  inCompTime,
int  inNSolved,
int  inTerminationState 
)

Constructor.

Parameters
inCompTimecomputation time of this ParaTask
inNSolvedthe number of tasks solved
inTerminationStateindicate whether if this computation is terminationState or not. 0: no, 1: terminationState

Definition at line 74 of file paraCalculationState.h.

◆ ~ParaCalculationState()

virtual ~ParaCalculationState ( )
virtual

Destructor.

Definition at line 89 of file paraCalculationState.h.

Member Function Documentation

◆ getCompTime()

double getCompTime ( )

◆ getNSolved()

int getNSolved ( )

◆ getTerminationState()

int getTerminationState ( )

getter of the termination state for solving the subproblem

Returns
the termination state

Definition at line 118 of file paraCalculationState.h.

References comm, ParaCalculationState::receive(), ParaCalculationState::send(), ParaCalculationState::terminationState, ParaCalculationState::toSimpleString(), and ParaCalculationState::toString().

◆ receive()

virtual void receive ( ParaComm comm,
int  source,
int  tag 
)
pure virtual

send this object to destination

Parameters
commcommunicator used to receive this object
sourcesource rank to receive this object
tagtag to show this object

Implemented in BbParaCalculationStateMpi, and BbParaCalculationStateTh.

Referenced by ParaCalculationState::getTerminationState(), BbParaLoadCoordinator::processRacingRampUpTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), and BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState().

◆ send()

virtual void send ( ParaComm comm,
int  destination,
int  tag 
)
pure virtual

send this object to destination

Parameters
commcommunicator used to send this object
destinationdestination rank to send
tagtag to show this object

Implemented in BbParaCalculationStateMpi, and BbParaCalculationStateTh.

Referenced by ParaCalculationState::getTerminationState(), BbParaSolver::sendCompletionOfCalculation(), and BbParaSolver::sendCompletionOfCalculationWithoutSolving().

◆ toSimpleString()

virtual std::string toSimpleString ( )
pure virtual

stringfy ParaCalculationState (simple string version)

Returns
simple string to show this object

Implemented in BbParaCalculationState.

Referenced by ParaCalculationState::getTerminationState(), and BbParaLoadCoordinator::writeSubtreeInfo().

◆ toString()

virtual std::string toString ( )
pure virtual

Member Data Documentation

◆ compTime

◆ nSolved

◆ terminationState

int terminationState
protected

indicate whether if this computation is terminationState or not. 0: no, 1: terminationState meaning can be defined in derived class

Definition at line 56 of file paraCalculationState.h.

Referenced by BbParaCalculationStateTh::createDatatype(), BbParaCalculationStateMpi::createDatatype(), ParaCalculationState::getTerminationState(), BbParaCalculationState::getTerminationState(), BbParaCalculationStateTh::receive(), and BbParaCalculationState::toString().