Scippy

UG

Ubiquity Generator framework

ParaInitiator Class Referenceabstract

Class for initiator. More...

#include <paraInitiator.h>

Inheritance diagram for ParaInitiator:
BbParaInitiator ScipParaInitiator

Public Member Functions

 ParaInitiator (ParaComm *inComm, ParaTimer *inTimer)
 constructor More...
 
virtual ~ParaInitiator ()
 destructor More...
 
bool isWarmStarted ()
 check if the execution is warm started (restarted) or not More...
 
const char * getPrefixWarm ()
 get prefix of warm start (restart) files More...
 
ParaCommgetParaComm ()
 get communicator being used More...
 
virtual int init (ParaParamSet *params, int argc, char **argv)=0
 initialize initiator More...
 
virtual int reInit (int nRestartedRacing)=0
 reinitizalie initiator TODO: this function should be in inherited class More...
 
virtual ParaInstancegetParaInstance ()=0
 get instance object More...
 
virtual void sendSolverInitializationMessage ()=0
 send solver initialization message More...
 
virtual void generateRacingRampUpParameterSets (int nParamSets, ParaRacingRampUpParamSet **racingRampUpParamSets)=0
 generate racing ramp-up parameter sets TODO: this function may be in inherited class More...
 
virtual double getEpsilon ()=0
 get epsilon specified More...
 
virtual void writeSolution (const std::string &message)=0
 write solution More...
 
virtual void writeParaInstance (const std::string &filename)=0
 write ParaInstance More...
 
virtual void writeCheckpointSolution (const std::string &filename)=0
 write checkpoint solution More...
 
virtual double readSolutionFromCheckpointFile (char *afterCheckpointingSolutionFileName)=0
 read solution from checkpoint file More...
 
virtual void writeSolverParameters (std::ostream *os)=0
 write solver runtime parameters More...
 
virtual void outputFinalSolverStatistics (std::ostream *os, double time)=0
 output final solver statistics More...
 
virtual std::string getStatus ()=0
 get solving status string More...
 
virtual void printSolverVersion (std::ostream *os)=0
 print solver version More...
 

Protected Attributes

ParaCommparaComm
 communicator used More...
 
ParaTimertimer
 timer used More...
 
char * prefixWarm
 prefix of warm start files More...
 

Detailed Description

Class for initiator.

Definition at line 62 of file paraInitiator.h.

Constructor & Destructor Documentation

◆ ParaInitiator()

ParaInitiator ( ParaComm inComm,
ParaTimer inTimer 
)

constructor

Parameters
inCommcommunicator used
inTimertimer used

Definition at line 75 of file paraInitiator.h.

References UG::getGitHash(), and UG_VERSION.

◆ ~ParaInitiator()

virtual ~ParaInitiator ( )
virtual

destructor

Definition at line 91 of file paraInitiator.h.

Member Function Documentation

◆ generateRacingRampUpParameterSets()

virtual void generateRacingRampUpParameterSets ( int  nParamSets,
ParaRacingRampUpParamSet **  racingRampUpParamSets 
)
pure virtual

generate racing ramp-up parameter sets TODO: this function may be in inherited class

Parameters
nParamSetsnumber of parameter sets to be generated
racingRampUpParamSetsarray of the racing parameter sets

Implemented in ScipParaInitiator.

Referenced by BbParaLoadCoordinator::warmStart().

◆ getEpsilon()

◆ getParaComm()

ParaComm * getParaComm ( )

get communicator being used

Returns
pointer to communicator object

Definition at line 120 of file paraInitiator.h.

References ParaInitiator::paraComm.

◆ getParaInstance()

◆ getPrefixWarm()

const char * getPrefixWarm ( )

◆ getStatus()

virtual std::string getStatus ( )
pure virtual

get solving status string

Returns
string to show solving status

Implemented in ScipParaInitiator.

◆ init()

virtual int init ( ParaParamSet params,
int  argc,
char **  argv 
)
pure virtual

initialize initiator

Returns
0 if initialized normally, 1 if the problem is solved in init
Parameters
paramsUG parameter used
argcthe number of command line arguments
argvarray of the arguments

Implemented in ScipParaInitiator.

◆ isWarmStarted()

bool isWarmStarted ( )

check if the execution is warm started (restarted) or not

Returns
true if warm stated (restarted), false if it is not

Definition at line 100 of file paraInitiator.h.

References ParaInitiator::prefixWarm.

Referenced by main(), and ScipParaInitiator::sendSolverInitializationMessage().

◆ outputFinalSolverStatistics()

virtual void outputFinalSolverStatistics ( std::ostream *  os,
double  time 
)
pure virtual

output final solver statistics

Parameters
osoutput stream to write final solver statistics
timecomputing time

Implemented in ScipParaInitiator.

Referenced by BbParaLoadCoordinator::~BbParaLoadCoordinator().

◆ printSolverVersion()

virtual void printSolverVersion ( std::ostream *  os)
pure virtual

print solver version

Parameters
osoutput file (or NULL for standard output)

Implemented in ScipParaInitiator.

◆ readSolutionFromCheckpointFile()

virtual double readSolutionFromCheckpointFile ( char *  afterCheckpointingSolutionFileName)
pure virtual

read solution from checkpoint file

Returns
objective function value of the solution
Parameters
afterCheckpointingSolutionFileNamename of after checkpointing solution file

Implemented in ScipParaInitiator.

Referenced by BbParaLoadCoordinator::warmStart().

◆ reInit()

virtual int reInit ( int  nRestartedRacing)
pure virtual

reinitizalie initiator TODO: this function should be in inherited class

Returns
0 if reinitialized normally, 1 if the problem is solved in reinit
Parameters
nRestartedRacingthe number of restarted racing

Implemented in ScipParaInitiator.

Referenced by BbParaLoadCoordinator::restartRacing().

◆ sendSolverInitializationMessage()

virtual void sendSolverInitializationMessage ( )
pure virtual

send solver initialization message

Implemented in ScipParaInitiator.

◆ writeCheckpointSolution()

virtual void writeCheckpointSolution ( const std::string &  filename)
pure virtual

write checkpoint solution

Parameters
filenameoutput file name

Implemented in ScipParaInitiator.

Referenced by BbParaLoadCoordinator::processTagSolution(), and BbParaLoadCoordinator::updateCheckpointFiles().

◆ writeParaInstance()

virtual void writeParaInstance ( const std::string &  filename)
pure virtual

write ParaInstance

Parameters
filenameoutput file name

Implemented in ScipParaInitiator.

◆ writeSolution()

virtual void writeSolution ( const std::string &  message)
pure virtual

write solution

Parameters
messagemessage head string

Implemented in ScipParaInitiator.

Referenced by BbParaLoadCoordinator::warmStart(), and BbParaLoadCoordinator::~BbParaLoadCoordinator().

◆ writeSolverParameters()

virtual void writeSolverParameters ( std::ostream *  os)
pure virtual

write solver runtime parameters

Parameters
osoutput stream to write solver parameters

Implemented in ScipParaInitiator.

Member Data Documentation

◆ paraComm

◆ prefixWarm

char* prefixWarm
protected

◆ timer

ParaTimer* timer
protected

timer used

Definition at line 67 of file paraInitiator.h.

Referenced by ScipParaInitiator::addRootNodeCuts(), and ScipParaInitiator::init().