68 std::cout << std::endl;
69 std::cout <<
"syntax: " << argv[0] <<
" #MPI_processes(#solvers + 1) parascip_param_file problem_file_name "
70 <<
"[-l <logfile>] [-q] [-sl <settings>] [-s <settings>] [-sr <root_settings>] [-w <prefix_warm>] [-sth <number>] [-fsol <solution_file>] [-isol <initial solution file]" << std::endl;
71 std::cout <<
" -l <logfile> : copy output into log file" << std::endl;
72 std::cout <<
" -q : suppress screen messages" << std::endl;
73 std::cout <<
" -sl <settings> : load parameter settings (.set) file for LC presolving" << std::endl;
74 std::cout <<
" -s <settings> : load parameter settings (.set) file for solvers" << std::endl;
75 std::cout <<
" -sr <root_settings> : load parameter settings (.set) file for root" << std::endl;
76 std::cout <<
" -w <prefix_warm> : warm start file prefix ( prefix_warm_nodes.gz and prefix_warm_solution.txt are read )" << std::endl;
77 std::cout <<
" -fsol <solution file> : specify output solution file" << std::endl;
78 std::cout <<
" -isol <intial solution file> : specify initial solution file" << std::endl;
79 std::cout <<
"File names need to be specified by full path form." << std::endl;
90 std::ofstream ofsParamsOutputFile;
102 ofsParamsOutputFile.open(s.str().c_str());
103 if( !ofsParamsOutputFile ){
104 std::cout <<
"Cannot open ParaParams output file: file name = " << s.str() << std::endl;
108 ofsParamsOutputFile.close();
120 std::ofstream ofsSolverParamsOutputFile;
121 std::ostringstream s;
132 ofsSolverParamsOutputFile.open(s.str().c_str());
133 if( !ofsSolverParamsOutputFile ){
134 std::cout <<
"Cannot open Solver parameters output file: file name = " << s.str() << std::endl;
138 ofsSolverParamsOutputFile.close();
154 static const int solverOrigin = 1;
156 bool racingSolversExist =
false;
163 char *configFileName = 0;
164 for(
int i = 1; i < argc; ++i )
166 if ( strcmp(argv[i],
"-ugsc") == 0 )
171 configFileName = argv[i];
176 std::cerr <<
"missing file name after parameter '-ugsc" << std::endl;
183 UGS::UgsParaCommMpi *commUgs = 0;
186 commUgs =
new UGS::UgsParaCommMpi();
187 commUgs->init(argc,argv);
189 comm->setUgsComm(commUgs);
207#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
208 SCIP_CALL_ABORT( SCIPcreateMesshdlrPThreads(1) );
209 SCIPmessageSetDefaultHandler();
233 if( detTimer )
delete detTimer;
240 if( commUgs )
delete commUgs;
245 std::cout <<
"** Initiatior was initilized after " << paraTimer->
getElapsedTime() <<
" sec." << std::endl;
254 std::cout <<
"** Instance data were sent to all solvers after " << paraTimer->
getElapsedTime() <<
" sec." << std::endl;
271 if( detTimer )
delete detTimer;
280 if( commUgs )
delete commUgs;
320 racingRampUpParams[i-solverOrigin]->send(
comm, i)
329 if( racingRampUpParams[i-solverOrigin] )
delete racingRampUpParams[i-solverOrigin];
331 delete [] racingRampUpParams;
349 int nNonLinearConsHdlrs = 0;
355 if( nNonLinearConsHdlrs > 0 )
371 dynamic_cast<ScipParaSolver *
>(paraSolver)->setProblemFileName(argv[2]);
392 dynamic_cast<BbParaSolver *
>(paraSolver)->setKeepRacing(
false);
396 dynamic_cast<BbParaSolver *
>(paraSolver)->setKeepRacing(
true);
403 paraSolver->
run( racingRampUpParamSet );
436#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
437 SCIPfreeMesshdlrPThreads();
441 if( detTimer )
delete detTimer;
448 if( commUgs )
delete commUgs;
BbParaNode extension for MIP communication.
UG::ParaInstance * createParaInstance()
UG::ParaParamSet * createParaParamSet()
void sendSolverInitializationMessage()
void outputFinalSolverStatistics(std::ostream *os, double time)
void generateRacingRampUpParameterSets(int nParamSets, UG::ParaRacingRampUpParamSet **racingRampUpParamSets)
void writeSolverParameters(std::ostream *os)
UG::ParaInstance * getParaInstance()
virtual int init(UG::ParaParamSet *paraParams, int argc, char **argv)
void setFileName(const char *inFileName)
Class for LoadCoordinator.
virtual void run()
run function to start main process
virtual void warmStart()
warm start (restart)
void read(ParaComm *comm, const char *filename)
read ParaParams from file
virtual void solverInit(ParaParamSet *paraParamSet)
initializer for Solvers
bool probe(int *source, int *tag)
probe function which waits a new message
int send(void *bufer, int count, const int datatypeId, int dest, const int tag)
send function for standard ParaData types
int receive(void *bufer, int count, const int datatypeId, int source, const int tag)
receive function for standard ParaData types
int getSize()
get size of this communicator, which indicates how many threads in a UG process
int getRank()
get rank of caller's thread
virtual void init(int argc, char **argv)
initializer of this communicator
void abort()
abort. How it works sometimes depends on communicator used
int bcast(void *buffer, int count, const int datatypeId, int root)
broadcast function for standard ParaData types
virtual void lcInit(ParaParamSet *paraParamSet)
initializer for LoadCoordinator
class for deterministic timer
const char * getPrefixWarm()
get prefix of warm start (restart) files
bool isWarmStarted()
check if the execution is warm started (restarted) or not
virtual int bcast(ParaComm *comm, int rank, int method)=0
broadcast function to all solvers
virtual const char * getProbName()=0
get problem name
Class for LoadCoordinator.
int bcast(ParaComm *comm, int root)
broadcast ParaParams
bool getBoolParamValue(int param)
get bool parameter value
void write(std::ostream *os)
write ParaParams to output stream
void setIntParamValue(int param, int value)
set int parameter value
int getIntParamValue(int param)
get int parameter value
const char * getStringParamValue(int param)
get string parameter value
class ParaRacingRampUpParamSet (parameter set for racing ramp-up)
virtual int receive(ParaComm *comm, int source)=0
receive ParaRacingRampUpParamSet
virtual void run()=0
run this Solver
void start(void)
start timer
class ParaTimerMpi (Timer used in MPI communication)
virtual void init(ParaComm *paraComm)=0
initialize timer
virtual double getElapsedTime()=0
get elapsed time
static ScipParaCommTh * comm
static ScipParaLoadCoordinator * paraLc
static ScipParaInitiator * paraInitiator
static ScipParaParamSet * paraParamSet
static const int OutputParaParams
static const int InstanceTransferMethod
static const int LogSolvingStatusFilePath
static const int TagTerminateRequest
static const int ParaBYTE
static const int Deterministic
static const int RampUpPhaseProcess
static const int TagKeepRacing
#define PARA_COMM_CALL(paracommcall)
#define THROW_LOGICAL_ERROR2(msg1, msg2)
Base class of initiator that maintains original problem and incumbent solution.
Base class for instance data.
Parameter set for UG framework.
Base class for racing ramp-up parameter set.
int main(int argc, char **argv)
void outputParaParamSet(ParaParamSet *paraParamSet, ParaInitiator *paraInitiator)
void outputCommandLineMessages(char **argv)
void setUserPlugins(ParaInitiator *initiator)
void outputSolverParams(ParaParamSet *paraParamSet, ParaInitiator *paraInitiator)
SCIP ParaComm extension for MPI communication.
ParaDeterministicTimer extension for SCIP.
ParaInitiator extension for SCIP solver.
ParaInstance extenstion for SCIP solver.
ParaSolver extension for SCIP: Parallelized solver implementation for SCIP.