45#ifdef UG_DEBUG_SOLUTION
46#ifndef WITH_DEBUG_SOLUTION
47#define WITH_DEBUG_SOLUTION
49#include "scip/debug.h"
62#if ( defined(_COMM_PTH) || defined(_COMM_CPP11) )
66static int parseLine(
char* line){
70 while (*p <'0' || *p >
'9') p++;
76static long long getVmSize(){
77 FILE* file = fopen(
"/proc/self/status",
"r");
78 long long result = -1;
81 while (fgets(line, 128, file) != NULL){
82 if (strncmp(line,
"VmSize:", 7) == 0){
83 result = parseLine(line);
94ScipParaInitiator::addRootNodeCuts(
97 SCIP_Longint originalLimitsNodes;
98 SCIP_CALL_ABORT( SCIPgetLongintParam(
scip,
"limits/nodes", &originalLimitsNodes) );
99 SCIP_CALL_ABORT( SCIPsetLongintParam(
scip,
"limits/nodes", 1) );
105 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/time", timeRemains) );
107 SCIP_RETCODE ret = SCIPsolve(
scip);
108 if( ret != SCIP_OKAY )
110#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
111 SCIPprintError(ret, NULL);
119 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
122 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/maxrounds", 0));
133 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"misc/catchctrlc", FALSE) );
135 SCIP_STATUS status = SCIPgetStatus(
scip);
136 if( status == SCIP_STATUS_OPTIMAL )
142 if( status == SCIP_STATUS_MEMLIMIT )
144 std::cout <<
"Warning: SCIP was interrupted because the memory limit was reached" << std::endl;
159 cuts = SCIPgetPoolCuts(
scip);
160 ncuts = SCIPgetNPoolCuts(
scip);
161 for(
int c = 0; c < ncuts; ++c )
165 row = SCIPcutGetRow(cuts[c]);
166 assert(!SCIProwIsLocal(row));
167 assert(!SCIProwIsModifiable(row));
168 if( SCIPcutGetAge(cuts[c]) == 0 && SCIProwIsInLP(row) )
170 char name[SCIP_MAXSTRLEN];
178 cols = SCIProwGetCols(row);
179 ncols = SCIProwGetNNonz(row);
181 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vars, ncols) );
182 for( i = 0; i < ncols; ++i )
183 vars[i] = SCIPcolGetVar(cols[i]);
185 (void) SCIPsnprintf(name, SCIP_MAXSTRLEN,
"%s_%d", SCIProwGetName(row), SCIPgetNRuns(
scip));
186 SCIP_CALL_ABORT( SCIPcreateConsLinear(
scip, &cons, name, ncols, vars, SCIProwGetVals(row),
187 SCIProwGetLhs(row) - SCIProwGetConstant(row), SCIProwGetRhs(row) - SCIProwGetConstant(row),
188 TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) );
189 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
190 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
192 SCIPfreeBufferArray(
scip, &vars);
213#if ( defined(_COMM_PTH) || defined(_COMM_CPP11) )
214 bool noUpgrade =
false;
239 for( i = 3; i < argc; ++i )
242 if( strcmp(argv[i],
"-l") == 0 )
249 std::cerr <<
"missing log filename after parameter '-l'" << std::endl;
253 else if( strcmp(argv[i],
"-q") == 0 )
255 else if( strcmp(argv[i],
"-s") == 0 )
262 std::cerr <<
"missing settings filename after parameter '-s'" << std::endl;
266 else if( strcmp(argv[i],
"-sr") == 0 )
273 std::cerr <<
"missing settings filename after parameter '-sr'" << std::endl;
277 else if( strcmp(argv[i],
"-sl") == 0 )
284 std::cerr <<
"missing settings filename after parameter '-sl'" << std::endl;
288 else if( strcmp(argv[i],
"-w") == 0)
295 char nodesFileName[SCIP_MAXSTRLEN];
296 (void) SCIPsnprintf(nodesFileName, SCIP_MAXSTRLEN,
"%s_nodes_LC0.gz",
prefixWarm);
299 std::cerr <<
"ERROR: Opening file `" << nodesFileName <<
"' failed.\n";
305 std::cerr <<
"missing settings filename after parameter '-w'" << std::endl;
309 std::cerr <<
"Cannot work with parameter '-w' compiling without zlib" << std::endl;
313 else if( strcmp(argv[i],
"-racing") == 0 )
322 std::cerr <<
"missing settings filename after parameter '-racing'" << std::endl;
326 else if ( strcmp(argv[i],
"-isol") == 0 )
335 std::cerr <<
"missing settings filename after parameter '-isol'" << std::endl;
339 else if( strcmp(argv[i],
"-objlimit") == 0 )
348 std::cerr <<
"missing objective limit after parameter '-objlimit'" << std::endl;
352 else if ( strcmp(argv[i],
"-sth") == 0 )
356 else if ( strcmp(argv[i],
"-fsol" ) == 0 )
365 std::cerr <<
"missing solution filename after parameter '-fsol'" << std::endl;
369#if ( defined(_COMM_PTH) || defined(_COMM_CPP11) )
370 else if ( strcmp(argv[i],
"-nou" ) == 0 )
376 else if( strcmp(argv[i],
"-ugsc") == 0 )
381 else if ( strcmp(argv[i],
"-omit1" ) == 0 )
384 else if ( strcmp(argv[i],
"-omit2" ) == 0 )
398 SCIP_CALL( SCIPcreate(&
scip) );
403 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
407 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/time", timeRemains) );
414 SCIP_CALL( SCIPincludeDefaultPlugins(
scip) );
427 SCIP_RETCODE paramretcode = SCIPsetBoolParam(
scip,
"constraints/orbisack/forceconscopy", TRUE);
428 if( paramretcode != SCIP_OKAY && paramretcode != SCIP_PARAMETERUNKNOWN )
430 SCIP_CALL_ABORT( paramretcode );
432 paramretcode = SCIPsetBoolParam(
scip,
"constraints/orbitope/forceconscopy", TRUE);
433 if( paramretcode != SCIP_OKAY && paramretcode != SCIP_PARAMETERUNKNOWN )
435 SCIP_CALL_ABORT( paramretcode );
437 paramretcode = SCIPsetBoolParam(
scip,
"constraints/symresack/forceconscopy", TRUE);
438 if( paramretcode != SCIP_OKAY && paramretcode != SCIP_PARAMETERUNKNOWN )
440 SCIP_CALL_ABORT( paramretcode );
450 SCIP_CALL_ABORT( SCIPcreateObjMessagehdlr(&
messagehdlr, objmessagehdlr, TRUE) );
451#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
452 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
455 SCIP_CALL_ABORT( SCIPmessagehdlrRelease(&
messagehdlr));
457 SCIPmessageSetErrorPrinting(ParaSCIP::scip_errorfunction, (
void*) objmessagehdlr);
465 std::ostringstream os;
467 logfile = fopen(os.str().c_str(),
"a");
475 SCIP_CALL_ABORT( SCIPcreateObjMessagehdlr(&
messagehdlr, objmessagehdlr, TRUE) );
476#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
477 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
480 SCIP_CALL_ABORT( SCIPmessagehdlrRelease(&
messagehdlr));
482 SCIPmessageSetErrorPrinting(ParaSCIP::scip_errorfunction, (
void*) objmessagehdlr);
491#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
492 SCIPprintVersion(NULL);
494 SCIPprintVersion(
scip, NULL);
496 SCIPinfoMessage(
scip, NULL,
"\n");
505 SCIP_CALL( SCIPcreate(¶mScip) );
507 SCIP_CALL( SCIPincludeDefaultPlugins(paramScip) );
514 SCIP_CALL_ABORT( SCIPreadParams(paramScip,
settingsName) );
521 std::cout <<
"** RampUpPhaseProcess is switched to 1, since gap for solvers is specified" << std::endl;
533 std::cout <<
"** RampUpPhaseProcess is switched to 1, since gap for solvers is specified" << std::endl;
551 std::cout <<
"** RampUpPhaseProcess is switched to 1, since gap for root node is specified" << std::endl;
563 std::cout <<
"** RampUpPhaseProcess is switched to 1, since gap for root node is specified" << std::endl;
572 std::cout <<
"** applied absolute gap = " <<
getAbsgapValue() << std::endl;
573 std::cout <<
"** applied relative gap = " <<
getGapValue() << std::endl;
579 std::cout <<
"** RampUpPhaseProcess is switched to 1, since gap is specified" << std::endl;
587 SCIP_CALL_ABORT( SCIPfree(¶mScip) );
600 SCIP_RETCODE retcode = SCIPreadProb(
scip,
probname, NULL);
601 if( retcode != SCIP_OKAY )
603 std::cout <<
"error reading file <" <<
probname <<
">" << std::endl;
604 SCIP_CALL( SCIPfreeProb(
scip) );
609 SCIP_CALL_ABORT( SCIPtransformProb(
scip));
621 char *probNameFromFileName;
622 char *temp =
new char[strlen(
probname)+1];
624 SCIPsplitFilename(temp, NULL, &probNameFromFileName, NULL, NULL);
625 SCIP_CALL_ABORT( SCIPsetProbName(
scip, probNameFromFileName));
631 if( SCIPfindConshdlr(
scip,
"pseudoboolean") == NULL || SCIPconshdlrGetNConss(SCIPfindConshdlr(
scip,
"pseudoboolean")) == 0 )
633 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/maxrounds", 0) );
634 std::cout <<
"No LC presolving is specified." << std::endl;
638 std::cout <<
"Default LC presolving (default)." << std::endl;
646 std::cout <<
"LC presolving settings file is specified." << std::endl;
651 std::cout <<
"Default LC presolving (default)." << std::endl;
658 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"misc/catchctrlc", FALSE) );
671 SCIP_Bool originalUpgradeKnapsack;
672 SCIP_Bool originalUpgradeLogicor;
673 SCIP_Bool originalUpgradeSetppc;
674 SCIP_Bool originalUpgradeVarbound;
676#ifdef _COMM_MPI_WORLD
677 if( onlyLinearConss )
679 std::cout <<
"** Original problem has only linear constraints" << std::endl;
683 std::cout <<
"** Original problem has non-linear constraints" << std::endl;
687 if( onlyLinearConss )
689 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/knapsack", &originalUpgradeKnapsack));
690 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/logicor", &originalUpgradeLogicor));
691 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/setppc", &originalUpgradeSetppc));
692 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/varbound", &originalUpgradeVarbound));
693 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/knapsack", FALSE));
694 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/logicor", FALSE));
695 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/setppc", FALSE));
696 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/varbound", FALSE));
702 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/knapsack", &originalUpgradeKnapsack));
703 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/logicor", &originalUpgradeLogicor));
704 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/setppc", &originalUpgradeSetppc));
705 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/varbound", &originalUpgradeVarbound));
706 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/knapsack", FALSE));
707 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/logicor", FALSE));
708 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/setppc", FALSE));
709 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/varbound", FALSE));
713#ifdef UG_DEBUG_SOLUTION
714 SCIPdebugSolDisable(
scip);
721 std::ostringstream os;
741#if defined(_COMM_PTH) || defined (_COMM_CPP11)
743 long long vmSizeBeforePresolving = getVmSize();
745 std::cout <<
"** Before presolving: virtualMemUsedAtLc = " <<
virtualMemUsedAtLc <<
", getVmSize() = " << getVmSize() <<
", SCIPgetMemUsed() = " << SCIPgetMemUsed(
scip) <<
", SCIPgetMemTotal() = " << SCIPgetMemTotal(
scip) <<
", SCIPgetMemExternEstim() = " << SCIPgetMemExternEstim(
scip) << std::endl;
748 std::cout <<
"** Before presolving: virtualMemUsedAtLc = " <<
virtualMemUsedAtLc <<
", SCIPgetMemUsed() = " << SCIPgetMemUsed(
scip) <<
", SCIPgetMemTotal() = " << SCIPgetMemTotal(
scip) <<
", SCIPgetMemExternEstim() = " << SCIPgetMemExternEstim(
scip) << std::endl;
758 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/maxrounds", 0) );
759 std::cout <<
"** No LC presolving is applied, since memory limit becomes "
766 SCIP_CALL( SCIPpresolve(
scip) );
770 std::cout <<
"=== solved at Init ===" << std::endl;
779 std::cout <<
"** set memory limit for presolving in LC and solvers to " <<
dynamic_cast<ScipParaParamSet *
>(
paraParams)->getRealParamValue(
MemoryLimit) <<
" for each SCIP **" << std::endl;
782#if SCIP_APIVERSION >= 101
783 SCIP_PARAM* milp_threads = SCIPgetParam(
scip,
"presolving/milp/threads");
784 if( milp_threads != NULL && SCIPparamGetIntMax(milp_threads) > 1 )
786#ifdef _COMM_MPI_WORLD
787 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/milp/threads", 0) );
789 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/milp/threads", (
paraComm->
getSize() - 1)) );
797 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
798 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/time", timeRemains) );
801 SCIP_CALL( SCIPpresolve(
scip) );
802 SCIP_STATUS scipStatus = SCIPgetStatus(
scip);
804 if( scipStatus == SCIP_STATUS_OPTIMAL ||
805 scipStatus == SCIP_STATUS_INFEASIBLE )
810 std::cout <<
"=== solved at Init ===" << std::endl;
815 else if( scipStatus == SCIP_STATUS_MEMLIMIT )
820 std::cout <<
"=== solved at Init ===" << std::endl;
827 if( scipStatus == SCIP_STATUS_TIMELIMIT )
832 std::cout <<
"=== solved at Init ===" << std::endl;
847 std::cout <<
"=== solved at Init ===" << std::endl;
860 std::cout <<
"=== solved at Init ===" << std::endl;
870#if defined(_COMM_PTH) || defined (_COMM_CPP11)
873 long long vmSize = getVmSize();
874 long long vmSizeForSolver = (vmSize - vmSizeBeforePresolving)/
paraComm->
getSize() + vmSizeBeforePresolving;
876 std::cout <<
"** Estimated virtualMemUsedAtSolver = " <<
virtualMemUsedAtLc <<
", getVmSize() = " << vmSize <<
", SCIPgetMemUsed() = " << SCIPgetMemUsed(
scip) <<
", SCIPgetMemTotal() = " << SCIPgetMemTotal(
scip) <<
", SCIPgetMemExternEstim() = " << SCIPgetMemExternEstim(
scip) << std::endl;
879 std::cout <<
"** Estimated virtualMemUsedAtSolver = " <<
virtualMemUsedAtLc <<
", SCIPgetMemUsed() = " << SCIPgetMemUsed(
scip) <<
", SCIPgetMemTotal() = " << SCIPgetMemTotal(
scip) <<
", SCIPgetMemExternEstim() = " << SCIPgetMemExternEstim(
scip) << std::endl;
883 std::cout <<
"** set memory limit for solvers to " <<
memoryLimitOfSolverSCIP <<
" for each SCIP **" << std::endl;
889 std::cout <<
"=== solved at Init ===" << std::endl;
897 int nNonLinearConsHdlrs = 0;
899#ifdef _COMM_MPI_WORLD
900 if( SCIPgetNActiveBenders(
scip) > 0 ) nNonLinearConsHdlrs++;
904 if( nNonLinearConsHdlrs > 0 )
911 if( SCIPgetNVars(
scip) == 0 )
913 SCIP_CALL( SCIPsolve(
scip) );
917 std::cout <<
"=== solved at Init ===" << std::endl;
924 SCIP_SOL *sol = SCIPgetBestSol(
scip);
930 if( ( SCIPgetObjsense(
scip) == SCIP_OBJSENSE_MINIMIZE && SCIPgetSolOrigObj(
scip, sol) <
objlimit ) ||
931 ( SCIPgetObjsense(
scip) == SCIP_OBJSENSE_MAXIMIZE && SCIPgetSolOrigObj(
scip, sol) >
objlimit ) )
933 int nVars = SCIPgetNVars(
scip);
934 SCIP_VAR **vars = SCIPgetVars(
scip);
935 SCIP_Real *vals =
new SCIP_Real[nVars];
936 SCIP_CALL_ABORT( SCIPgetSolVals(
scip, sol, nVars, vars, vals) );
937 solution = scipParaComm->createScipParaSolution(
939 SCIPgetSolTransObj(
scip, sol),
948 solution = scipParaComm->createScipParaSolution(
950 ( (
objlimit / ( SCIPgetTransObjscale(
scip) * SCIPgetObjsense(
scip) ) ) - SCIPgetTransObjoffset(
scip) ),
959 int nVars = SCIPgetNVars(
scip);
960 SCIP_VAR **vars = SCIPgetVars(
scip);
961 SCIP_Real *vals =
new SCIP_Real[nVars];
962 SCIP_CALL_ABORT( SCIPgetSolVals(
scip, sol, nVars, vars, vals) );
963 solution = scipParaComm->createScipParaSolution(
965 SCIPgetSolTransObj(
scip, sol),
977 solution = scipParaComm->createScipParaSolution(
979 ( (
objlimit / ( SCIPgetTransObjscale(
scip) * SCIPgetObjsense(
scip) ) ) - SCIPgetTransObjoffset(
scip) ),
990 #ifdef _COMM_MPI_WORLD
1011#ifdef _COMM_MPI_WORLD
1015 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/knapsack", originalUpgradeKnapsack));
1016 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/logicor", originalUpgradeLogicor));
1017 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/setppc", originalUpgradeSetppc));
1018 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/varbound", originalUpgradeVarbound));
1023 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/knapsack", originalUpgradeKnapsack));
1024 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/logicor", originalUpgradeLogicor));
1025 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/setppc", originalUpgradeSetppc));
1026 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/varbound", originalUpgradeVarbound));
1031 SCIP_CALL_ABORT( SCIPgetIntParam(
scip,
"presolving/maxrounds", &maxrounds));
1043 std::ostringstream os2;
1045 if( onlyLinearConss )
1053 SCIP_CALL_ABORT( SCIPwriteTransProblem(
scip, os2.str().c_str(), NULL, FALSE));
1058 std::cout << std::endl;
1059 std::cout <<
"syntax: " << argv[0] <<
" fscip_param_file problem_file_name "
1060 <<
"[-l <logfile>] [-q] [-sl <settings>] [-s <settings>] [-sr <root_settings>] [-w <prefix_warm>] [-sth <number>] [-fsol <solution_file>] [-isol <initial solution file]" << std::endl;
1061 std::cout <<
" -l <logfile> : copy output into log file" << std::endl;
1062 std::cout <<
" -q : suppress screen messages" << std::endl;
1063 std::cout <<
" -sl <settings> : load parameter settings (.set) file for LC presolving" << std::endl;
1064 std::cout <<
" -s <settings> : load parameter settings (.set) file for solvers" << std::endl;
1065 std::cout <<
" -sr <root_settings> : load parameter settings (.set) file for root" << std::endl;
1066 std::cout <<
" -w <prefix_warm> : warm start file prefix ( prefix_warm_nodes.gz and prefix_warm_solution.txt are read )" << std::endl;
1067 std::cout <<
" -sth <number> : the number of solver threads used" << std::endl;
1068 std::cout <<
" -fsol <solution file> : specify output solution file" << std::endl;
1069 std::cout <<
" -qsol : quit to output solution file" << std::endl;
1070 std::cout <<
" -isol <intial solution file> : specify initial solution file" << std::endl;
1092 int nRestartedRacing
1096 char initSolFileName[SCIP_MAXSTRLEN];
1100 (void) SCIPsnprintf(initSolFileName, SCIP_MAXSTRLEN,
"%s.%d",
isolname, nRestartedRacing);
1101 if( !rename(
isolname, initSolFileName ) )
1103 std::cout <<
"Warning: initial solution file name cannot rename: " <<
isolname <<
", " << nRestartedRacing <<
"'th restarted file." << std::endl;
1109 (void) SCIPsnprintf(initSolFileName, SCIP_MAXSTRLEN,
"%s",
isolname);
1118 (void) SCIPsnprintf(initSolFileName, SCIP_MAXSTRLEN,
"i_%s.sol",
instance->
getProbName());
1127 std::cout <<
"Could not open " <<
generatedIsolname <<
" file to reinitialize for restart." << std::endl;
1130 assert( SCIPgetBestSol(
scip) );
1131 SCIP_CALL_ABORT( SCIPprintBestSol(
scip, fp, FALSE) );
1135 SCIP_RETCODE retcode = SCIPreadProb(
scip,
probname, NULL);
1136 if( retcode != SCIP_OKAY )
1138 std::cout <<
"error reading file <" <<
probname <<
">" << std::endl;
1139 SCIP_CALL( SCIPfreeProb(
scip) );
1145 SCIP_CALL_ABORT( SCIPtransformProb(
scip));
1151 char *probNameFromFileName;
1152 char *temp =
new char[strlen(
probname)+1];
1154 SCIPsplitFilename(temp, NULL, &probNameFromFileName, NULL, NULL);
1155 SCIP_CALL_ABORT( SCIPsetProbName(
scip, probNameFromFileName));
1158#if ( defined(_COMM_PTH) || defined(_COMM_CPP11) )
1159 SCIP_CALL( SCIPsetBoolParam(
scip,
"misc/catchctrlc", FALSE) );
1162#ifdef _COMM_MPI_WORLD
1163 SCIP_Bool originalUpgradeKnapsack;
1164 SCIP_Bool originalUpgradeLogicor;
1165 SCIP_Bool originalUpgradeSetppc;
1166 SCIP_Bool originalUpgradeVarbound;
1168 if( onlyLinearConss )
1170 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/knapsack", &originalUpgradeKnapsack));
1171 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/logicor", &originalUpgradeLogicor));
1172 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/setppc", &originalUpgradeSetppc));
1173 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/upgrade/varbound", &originalUpgradeVarbound));
1174 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/knapsack", FALSE));
1175 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/logicor", FALSE));
1176 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/setppc", FALSE));
1177 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/varbound", FALSE));
1181 SCIP_CALL( SCIPpresolve(
scip) );
1182 SCIP_STATUS scipStatus = SCIPgetStatus(
scip);
1185 int nNonLinearConsHdlrs = 0;
1188 if( scipStatus == SCIP_STATUS_OPTIMAL ||
1189 scipStatus == SCIP_STATUS_INFEASIBLE )
1194 std::cout <<
"=== solved at reInit ===" << std::endl;
1209 std::cout <<
"=== solved at reInit ===" << std::endl;
1217 if( SCIPgetNVars(
scip) == 0 )
1219 SCIP_CALL( SCIPsolve(
scip) );
1223 std::cout <<
"=== solved at reInit ===" << std::endl;
1231 SCIP_SOL *sol = SCIPgetBestSol(
scip);
1233 int nVars = SCIPgetNVars(
scip);
1234 SCIP_VAR **vars = SCIPgetVars(
scip);
1235 SCIP_Real *vals =
new SCIP_Real[nVars];
1236 SCIP_CALL_ABORT( SCIPgetSolVals(
scip, sol, nVars, vars, vals) );
1239 solution = scipParaComm->createScipParaSolution(
1241 SCIPgetSolTransObj(
scip, sol),
1269#ifdef _COMM_MPI_WORLD
1270 if( onlyLinearConss )
1273 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/knapsack", originalUpgradeKnapsack));
1274 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/logicor", originalUpgradeLogicor));
1275 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/setppc", originalUpgradeSetppc));
1276 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/upgrade/varbound", originalUpgradeVarbound));
1302 if( checksol && SCIPgetNActiveBenders(
scip) > 0 )
1317 SCIP_VAR** vars = 0;
1333 if( checksol && SCIPgetNVars(
scip) > tempSol->
getNVars() )
1335 std::cout <<
"*** You should check the solution! ***" << std::endl;
1336 std::cout <<
"checksol = " << checksol << std::endl;
1337 std::cout <<
"SCIPgetNVars(scip) = " << SCIPgetNVars(
scip) <<
", " << tempSol->
getNVars() << std::endl;
1342 SCIP_CALL_ABORT( SCIPcreateSol(
scip, &newsol, 0) );
1343 vars = SCIPgetVars(
scip);
1349 int n = SCIPgetNVars(
scip);
1350 SCIP_Real *orgSolValues =
new SCIP_Real[tempSol->
getNVars()];
1354 for( i = 0; i < n; i++ )
1357 SCIP_CALL_ABORT( SCIPsetSolVal(
scip, newsol, vars[i], orgSolValues[i]) );
1368 delete [] orgSolValues;
1383 for( i = 0; i < tempSol->
getNVars(); i++ )
1433 bool primalValueUpdated =
false;
1440#if (SCIP_VERSION < 321 || ( SCIP_VERSION == 321 && SCIP_SUBVERSION < 2) )
1441 SCIP_CALL_ABORT( SCIPtrySolFree(
scip, &newsol, FALSE, TRUE, TRUE, TRUE, &success) );
1443 SCIP_CALL_ABORT( SCIPtrySolFree(
scip, &newsol, FALSE, TRUE, TRUE, TRUE, TRUE, &success) );
1448 if( SCIPisTransformed(
scip) && SCIPgetNSols(
scip) > 0 )
1450 double prevValue = SCIPgetPrimalbound(
scip);
1451 SCIP_CALL_ABORT( SCIPaddSolFree(
scip, &newsol, &success) );
1455 primalValueUpdated =
true;
1460 SCIP_CALL_ABORT( SCIPaddSolFree(
scip, &newsol, &success) );
1461 primalValueUpdated =
true;
1471 if( success && primalValueUpdated )
1490 std::cout <<
"*** A new solution generated in a Solver does not match with the upperbound in LC ***" << std::endl;
1491 std::cout <<
"SCIPgetUpperbound(scip) = " << SCIPgetUpperbound(
scip) << std::endl;
1494 <<
", SCIPfeastol(scip) = " << SCIPfeastol(
scip) << std::endl;
1502 SCIP_CALL_ABORT( SCIPcreateOrigSol(
scip, &newsol, 0) );
1503 vars = SCIPgetOrigVars(
scip);
1506 for( i = 0; i < tempSol->
getNVars(); i++ )
1511 if( probindex < 0 )
continue;
1515 SCIP_CALL_ABORT( SCIPsetSolVal(
scip, newsol, vars[probindex], tempSol->
getValues()[i]) );
1520 for( i = 0; i < tempSol->
getNVars(); i++ )
1523 SCIP_CALL_ABORT( SCIPsetSolVal(
scip, newsol, vars[i], tempSol->
getValues()[i]) );
1537#if (SCIP_VERSION < 321 || ( SCIP_VERSION == 321 && SCIP_SUBVERSION < 2) )
1538 SCIP_CALL_ABORT( SCIPtrySolFree(
scip, &newsol, FALSE, TRUE, TRUE, TRUE, &success) );
1540 SCIP_CALL_ABORT( SCIPtrySolFree(
scip, &newsol, FALSE, TRUE, TRUE, TRUE, TRUE, &success) );
1582#if (SCIP_VERSION < 321 || ( SCIP_VERSION == 321 && SCIP_SUBVERSION < 2) )
1583 SCIP_CALL_ABORT( SCIPtrySolFree(
scip, &newsol, FALSE, TRUE, TRUE, TRUE, &success) );
1585 SCIP_CALL_ABORT( SCIPtrySolFree(
scip, &newsol, FALSE, TRUE, TRUE, TRUE, TRUE, &success) );
1611 for( i = 0; i < tempSol->
getNVars(); i++ )
1616 if( probindex < 0 )
continue;
1618 assert(i == probindex);
1620 var = vars[probindex];
1622 if( SCIPvarGetType(var) == SCIP_VARTYPE_CONTINUOUS )
continue;
1631 SCIP_CALL_ABORT( SCIPsetSolVal(
scip, newsol, var, tempSol->
getValues()[i]) );
1634#if (SCIP_VERSION < 321 || ( SCIP_VERSION == 321 && SCIP_SUBVERSION < 2) )
1635 SCIP_CALL_ABORT( SCIPtrySol(
scip, newsol, FALSE, TRUE, TRUE, TRUE, &success) );
1637 SCIP_CALL_ABORT( SCIPtrySol(
scip, newsol, FALSE, TRUE, TRUE, TRUE, TRUE, &success) );
1642 SCIP_CALL_ABORT( SCIPfreeSol(
scip, &newsol) );
1673 std::cout <<
"Current scip primal value = " << SCIPgetPrimalbound(
scip) << std::endl;
1675 std::cout <<
"Initiator did not accept solution!" << std::endl;
1678 SCIP_CALL_ABORT( SCIPfreeSol(
scip, &newsol) );
1694 int warmStarted = 0;
1700 double incumbentValue;
1707 SCIP_SOL *sol = SCIPgetBestSol(
scip);
1710 int nVars = SCIPgetNVars(
scip);
1711 SCIP_VAR **vars = SCIPgetVars(
scip);
1712 SCIP_Real *vals =
new SCIP_Real[nVars];
1713 SCIP_CALL_ABORT( SCIPgetSolVals(
scip, sol, nVars, vars, vals) );
1715 solution = scipParaComm->createScipParaSolution(
1717 SCIPgetSolTransObj(
scip,sol),
1727 incumbentValue = DBL_MAX;
1734 int solutionExists = 0;
1743 int solutionExists = 0;
1779 double dualBoundValue
1785 return REALABS((primalbound - dualbound));
1791 double dualBoundValue
1798 if( SCIPisEQ(
scip, primalbound, dualbound) )
1800 else if( SCIPisZero(
scip, dualbound)
1801 || SCIPisZero(
scip, primalbound)
1804 || primalbound * dualbound < 0.0 )
1805 return SCIPinfinity(
scip);
1816 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/epsilon", &epsilon));
1822 const std::string& message
1826 std::ostringstream osold;
1827 if( message ==
"Final Solution" )
1829#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
1832 SCIPmessageSetDefaultHandler();
1844 else if ( message ==
"Updated" )
1848 std::ostringstream os;
1862 if( rename(os.str().c_str(), osold.str().c_str()) )
1864 std::cerr <<
"Rename falied from " <<
"File Name: " << os.str().c_str() <<
" to " << osold.str().c_str() << std::endl;
1878 SCIP_SOL* sol = SCIPgetBestSol(
scip);
1887 if( SCIPsolGetOrigin(sol) != SCIP_SOLORIGIN_ORIGINAL )
1901 fprintf(
transSolutionFile,
"best solution is defined in original space - cannot print it as transformed solution\n");
1919 if ( message ==
"Updated" )
1921 remove(osold.str().c_str());
1927 const std::string& filename
1930 FILE *file = fopen(filename.c_str(),
"a");
1933 std::cout <<
"file : " << filename <<
"cannot open." << std::endl;
1939 SCIP_CALL_ABORT( SCIPprintOrigProblem(scipInstance->
getParaInstanceScip(), file,
"lp", FALSE) );
1943 SCIP_CALL_ABORT( SCIPprintTransProblem(
scip, file,
"lp", FALSE) );
1955 *os <<
"[ SCIP parameters for root Solver are all default values ]" << std::endl;
1959 *os <<
"[ Not default SCIP parameters for root Solver are as follows ]" << std::endl;
1965 *os <<
"[ SCIP parameters for NOT root Solvers are all default values ]" << std::endl;
1969 *os <<
"[ Not default SCIP parameters for NOT root Solvers are as follows ]" << std::endl;
1979 const std::string& filename
1982 gzstream::ogzstream checkpointSolutionStream;
1983 checkpointSolutionStream.open(filename.c_str(), std::ios::out | std::ios::binary);
1984 if( !checkpointSolutionStream )
1986 std::cout <<
"Checkpoint file for solution cannot open. file name = " << filename << std::endl;
1991 checkpointSolutionStream.close();
1998 char *afterCheckpointingSolutionFileName
2001 char tempSolutionFileName[SCIP_MAXSTRLEN];
2002 (void) SCIPsnprintf(tempSolutionFileName, SCIP_MAXSTRLEN,
"%s_solution.gz",
prefixWarm);
2003 gzstream::igzstream checkpointSolutionStream;
2004 checkpointSolutionStream.open(tempSolutionFileName, std::ios::in | std::ios::binary);
2005 if( !checkpointSolutionStream )
2007 std::cout <<
"checkpoint solution file cannot open: file name = " << tempSolutionFileName << std::endl;
2033 checkpointSolutionStream.close();
2036 checkpointSolutionStream.close();
2041 std::cout <<
"***** Given solution is wrong! ***************************" << std::endl;
2042 std::cout <<
"***** If the solution was given from checkpoint file, ***" << std::endl;
2043 std::cout <<
"***** it might be generated in original problem space **" << std::endl;
2044 std::cout <<
"***** Only primal value is used. *************************" << std::endl;
2045 std::cout <<
"***** You should better to use -isol option. ************" << std::endl;
2046 std::cout <<
"***** Or, better to use no distribute solution option. ***" << std::endl;
2051 checkpointSolutionStream.open(afterCheckpointingSolutionFileName, std::ios::in | std::ios::binary);
2052 if( checkpointSolutionStream )
2063 std::cout <<
"***** After checkpoint solution is RIGHT! ****************" << std::endl;
2074 std::cout <<
"***** After checkpoint solution is RIGHT! ****************" << std::endl;
2083 checkpointSolutionStream.close();
2110 for(
int n = 1; n < nParamSets + 1 ; n++ )
2112 std::ostringstream oss;
2115 << std::setfill(
'0') << std::setw(5)
2119 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
2120 if( SCIPreadParams(
scip, oss.str().c_str()) != SCIP_OKAY )
2122 std::cout <<
"Cannot read racing parameter file = " << oss.str().c_str() << std::endl;
2126 racingScipDiffParamSet = scipParaComm->createScipDiffParamSet(
scip);
2127 racingRampUpParamSets[n-1] = scipParaComm->createScipParaRacingRampUpParamSet(
2134 racingScipDiffParamSet
2136 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
2143 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
2157#if (SCIP_VERSION < 321 || ( SCIP_VERSION == 321 && SCIP_SUBVERSION < 2) )
2170#if (SCIP_VERSION < 321 || ( SCIP_VERSION == 321 && SCIP_SUBVERSION < 2) )
2178 racingScipDiffParamSet = scipParaComm->createScipDiffParamSet(
scip);
2180 racingRampUpParamSets[n] = scipParaComm->createScipParaRacingRampUpParamSet(
2187 racingScipDiffParamSet
2192 if( n >= nParamSets )
return;
2197 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
2207 SCIP_SOL* sol = SCIPgetBestSol(
scip);
2210 return std::string(
"solution found exist");
2214 return std::string(
"no solution");
2224#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
2225 SCIPprintVersion( NULL );
2227 SCIPprintVersion(
scip, NULL );
2230 SCIPprintExternalCodes(
scip, NULL);
2315 *os <<
"SCIP Status : ";
2321 *os <<
"initial nodes were generated" << std::endl;
2327 *os <<
"solving was interrupted [hard time limit reached]" << std::endl;
2330 *os <<
"solving was interrupted [memory limit reached]" << std::endl;
2333 *os <<
"solving was interrupted [given gap reached]" << std::endl;
2336 *os <<
"solving was interrupted" << std::endl;
2339 if( SCIPgetNSols(
scip) > 0 )
2341 *os <<
"problem is solved" << std::endl;
2345 *os <<
"problem is solved [infeasible]" << std::endl;
2349 *os <<
"requested subproblems are solved" << std::endl;
2355 *os <<
"Total Time : " << time << std::endl;
2356 *os <<
" solving : " << time << std::endl;
2357 *os <<
" presolving : " << SCIPgetPresolvingTime(
scip) <<
" (included in solving)" << std::endl;
2358 *os <<
"B&B Tree :" << std::endl;
2359 *os <<
" nodes (total) : " <<
nSolved << std::endl;
2360 *os <<
"Solution :" << std::endl;
2361 *os <<
" Solutions found : " << SCIPgetNSols(
scip) << std::endl;
2362 SCIP_Real primalbound = SCIPinfinity(
scip);
2368 if( SCIPgetNSols(
scip) != 0 )
2370 primalbound = SCIPgetPrimalbound(
scip);
2387 *os <<
" Primal Bound : ";
2390 *os <<
" -" << std::endl;
2394 (*os).setf(std::ios::showpos);
2395 *os << std::scientific << std::showpoint << std::setprecision(14) << primalbound << std::endl;
2396 (*os).unsetf(std::ios::showpos);
2400 SCIP_Real finalGap = 0.0;
2404 || SCIPisZero(
scip, primalbound)
2408 finalGap = SCIPinfinity(
scip);
2412#if SCIP_VERSION > 302 || ( SCIP_VERSION == 302 && SCIP_SUBVERSION == 1 )
2413 *os <<
" Dual Bound : ";
2415 *os <<
"Dual Bound : ";
2418 *os <<
" -" << std::endl;
2421 (*os).setf(std::ios::showpos);
2422 *os << std::scientific << std::showpoint << std::setprecision(14)
2424 (*os).unsetf(std::ios::showpos);
2427 if( SCIPgetNSols(
scip) == 0 )
2429 *os <<
" -" << std::endl;
2431 else if( SCIPisInfinity(
scip, finalGap ) )
2432 *os <<
" infinite" << std::endl;
2435 *os << std::fixed << std::setprecision(5) << 100.0 * finalGap <<
" %" << std::endl;
2437 if( finalGap > SCIPepsilon(
scip) && !SCIPisInfinity(
scip,
REALABS(primalbound) ) )
2439 *os << std::scientific <<
"* Warning: final gap: " << finalGap <<
" is greater than SCIPepsilon: " << SCIPepsilon(
scip) << std::endl;
2453 int *nNonLinearConsHdlrs
2456 std::cout <<
"Original Problem :" << std::endl;
2457 std::cout <<
" Problem name : " << SCIPgetProbName(
scip) << std::endl;
2458 std::cout <<
" Variables : " << SCIPgetNOrigVars(
scip)
2459 <<
" (" << SCIPgetNOrigBinVars(
scip) <<
" binary, "
2460 << SCIPgetNOrigIntVars(
scip) <<
" integer, "
2461 << SCIPgetNOrigImplVars(
scip) <<
" implicit integer, "
2462 << SCIPgetNOrigContVars(
scip) <<
" continuous)" << std::endl;
2463 std::cout <<
" Constraints : " << SCIPgetNOrigConss(
scip) << std::endl;
2464 std::cout <<
" Objective sense : " << (SCIPgetObjsense(
scip) == SCIP_OBJSENSE_MINIMIZE ?
"minimize" :
"maximize") << std::endl;
2465 std::cout <<
"Presolved Problem :" << std::endl;
2466 std::cout <<
" Variables : " << SCIPgetNVars(
scip)
2467 <<
" (" << SCIPgetNBinVars(
scip) <<
" binary, "
2468 << SCIPgetNIntVars(
scip) <<
" integer, "
2469 << SCIPgetNImplVars(
scip) <<
" implicit integer, "
2470 << SCIPgetNContVars(
scip) <<
" continuous)" << std::endl;
2471 std::cout <<
" Constraints : " << SCIPgetNConss(
scip) << std::endl;
2473 std::cout <<
"Constraints : Number" << std::endl;
2474 for(
int i = 0; i < SCIPgetNConshdlrs(
scip); ++i )
2476 SCIP_CONSHDLR* conshdlr;
2477 int startnactiveconss;
2478 int maxnactiveconss;
2479 conshdlr = SCIPgetConshdlrs(
scip)[i];
2480 startnactiveconss = SCIPconshdlrGetStartNActiveConss(conshdlr);
2481 maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
2482 if( startnactiveconss > 0 )
2484 std::cout <<
" " << std::setw(17) << std::left << SCIPconshdlrGetName(conshdlr) <<
": "
2485 << startnactiveconss << ( maxnactiveconss > startnactiveconss ?
'+' :
' ') << std::endl;
2486 if ( std::string(SCIPconshdlrGetName(conshdlr)) != std::string(
"linear") )
2488 *nNonLinearConsHdlrs += startnactiveconss;
2498 for(
int i = 0; i < SCIPgetNConss(
scip); ++i )
2500 SCIP_CONS** conss = SCIPgetConss(
scip);
2501 SCIP_CONSHDLR* conshdlr = SCIPconsGetHdlr(conss[i]);
2502 if( std::string(SCIPconshdlrGetName(conshdlr)) != std::string(
"linear") )
2521ScipParaInitiator::readUgsIncumbentSolution(
2522 UGS::UgsParaCommMpi *ugsComm,
2526 UGS::UgsUpdateIncumbent *updateIncumbent =
new UGS::UgsUpdateIncumbent();
2527 updateIncumbent->receive(ugsComm->getMyComm(), source);
2534 std::ostringstream s;
2535 s << ugsComm->getSolverName(updateIncumbent->getUpdatedSolverId()) <<
"-" << updateIncumbent->getSeqNumber() <<
".sol";
2537 SCIP_CALL_ABORT( SCIPcreateOrigSol(
scip, &origSol, NULL) );
2538 SCIP_Bool partial = FALSE;
2539 SCIP_Bool error = FALSE;
2540 SCIP_CALL_ABORT( SCIPreadSolFile(
scip, s.str().c_str(), origSol, FALSE, &partial, &error ) );
2547 if( (!partial) && (!error) )
2549 SCIP_Bool stored = FALSE;
2550 SCIP_CALL_ABORT( SCIPtrySol(
scip, origSol, FALSE, TRUE, TRUE, TRUE, FALSE, &stored) );
2556 SCIP_SOL *sol = SCIPgetBestSol(
scip);
2557 int nVars = SCIPgetNVars(
scip);
2558 SCIP_VAR **vars = SCIPgetVars(
scip);
2559 SCIP_Real *vals =
new SCIP_Real[nVars];
2560 SCIP_CALL_ABORT( SCIPgetSolVals(
scip, sol, nVars, vars, vals) );
2561 solution = scipParaComm->createScipParaSolution(
2563 SCIPgetSolTransObj(
scip, sol),
2572 solution = scipParaComm->createScipParaSolution(
2583 solution = scipParaComm->createScipParaSolution(
2592 SCIP_CALL_ABORT( SCIPfreeSol(
scip, &origSol) );
2594 delete updateIncumbent;
2601 delete updateIncumbent;
2608ScipParaInitiator::writeUgsIncumbentSolution(
2609 UGS::UgsParaCommMpi *ugsComm
2614 std::ostringstream s;
2615 s << ugsComm->getMySolverName() <<
"-" << seqNumber <<
".sol";
2616 FILE *fp = fopen(s.str().c_str(),
"w");
2619 fprintf (stderr,
"Cannot open solution file to write. File name = %s\n", s.str().c_str());
2623 SCIP_SOL* sol = SCIPgetBestSol(
scip);
2628 SCIP_CALL_ABORT( SCIPprintSol(
scip, sol, fp, TRUE) );
2633 uui->send(ugsComm->getMyComm(),0);
void setParametersInScip(SCIP *scip)
virtual int bcast(UG::ParaComm *comm, int root)=0
void addInitialBranchVarStats(int minDepth, int maxDepth, SCIP *scip)
void accumulateOn(SCIP *scip)
void sendSolverInitializationMessage()
bool tryToSetIncumbentSolution(UG::BbParaSolution *sol, bool checksol)
double convertToInternalValue(double externalValue)
void outputFinalSolverStatistics(std::ostream *os, double time)
void generateRacingRampUpParameterSets(int nParamSets, UG::ParaRacingRampUpParamSet **racingRampUpParamSets)
void writeSolverParameters(std::ostream *os)
void writeSolution(const std::string &message)
void writeCheckpointSolution(const std::string &filename)
char * racingSettingsName
SCIP_MESSAGEHDLR * messagehdlr
void setInitialStatOnDiffSubproblem(int minDepth, int maxDepth, UG::BbParaDiffSubproblem *diffSubproblem)
double getGap(double dualBoundValue)
double readSolutionFromCheckpointFile(char *afterCheckpointingSolutionFileName)
ScipDiffParamSet * scipDiffParamSet
void printSolverVersion(std::ostream *os)
double getAbsgap(double dualBoundValue)
double convertToExternalValue(double internalValue)
ScipUserPlugins * userPlugins
void writeParaInstance(const std::string &filename)
void setDualBound(double bound)
void setFinalSolverStatus(UG::FinalSolverState status)
virtual int init(UG::ParaParamSet *paraParams, int argc, char **argv)
void setUserPlugins(ScipUserPlugins *inUi)
void outputProblemInfo(int *nNonLinearConsHdlrs)
void setNumberOfNodesSolved(long long n)
ScipParaInstance * instance
int reInit(int nRestartedRacing)
ScipParaSolution * solution
void accumulateInitialStat(UG::ParaInitialStat *initialStat)
UG::FinalSolverState finalState
UG::ParaParamSet * paraParams
ScipDiffParamSet * scipDiffParamSetRoot
bool onlyLinearConsHandler()
void includeUserPlugins(SCIP *inScip)
double convertToInternalValue(double externalValue)
SCIP * getParaInstanceScip()
void getSolValuesForOriginalProblem(ScipParaSolution *sol, SCIP_Real *vals)
int getOrigProbIndex(int index)
double convertToExternalValue(double internalValue)
const char * getProbName()
bool isOriginalIndeciesMap()
void setObjectiveFuntionValue(SCIP_Real val)
int indexAmongSolvers(int index)
bool read(UG::ParaComm *comm, gzstream::igzstream &in)
void write(gzstream::ogzstream &out)
double getObjectiveFunctionValue()
void setValue(int i, SCIP_Real val)
virtual void writeUserSolution(SCIP *scip, int nSolvers, double dual)
Class for the difference between instance and subproblem.
bool solvedAtReInit
solved at reInit
double * tightenedVarUbs
array of tightened upper bound of variable
double * tightenedVarLbs
array of tightened lower bound of variable
bool solvedAtInit
solved at init
gzstream::igzstream checkpointTasksStream
gzstream for checkpoint tasks file
virtual void lockApp()=0
lock UG application to synchronize with other threads
virtual ParaSolution * createParaSolution()=0
create ParaSolution object by default constructor
virtual int getSize()=0
get number of UG processes or UG threads depending on run-time environment
virtual void unlockApp()=0
unlock UG application to synchronize with other threads
virtual int bcast(void *buffer, int count, const int datatypeId, int root)=0
Some action need to be taken for fault tolerant, when the functions return. So, they rerun status val...
virtual int getRank()=0
get rank of this process or this thread depending on run-time environment
class for initial statistics collecting after racing
ParaComm * paraComm
communicator used
char * prefixWarm
prefix of warm start files
ParaTimer * timer
timer used
bool isWarmStarted()
check if the execution is warm started (restarted) or not
bool getBoolParamValue(int param)
get bool parameter value
void setIntParamValue(int param, int value)
set int parameter value
double getRealParamValue(int param)
get real 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 ParaSolution * clone(ParaComm *comm)=0
create clone of this object
virtual void bcast(ParaComm *comm, int root)=0
broadcast solution data
virtual double getElapsedTime()=0
get elapsed time
static const int MemoryLimit
static const int RacingParamsDirPath
static const int OutputPresolvedInstance
static const int TryNBranchingOrderInRacing
static const int NoUpperBoundTransferInRacing
static const int RacingRampUpTerminationCriteria
static const int NMaxRacingBaseParameters
static const int SolverSettingsExceptRootNode
static const int UseRootNodeCuts
static const int SolutionFilePath
static const int StopRacingTimeLimit
FinalSolverState
Final status of computation.
@ MemoryLimitIsReached
memory limit is reached in a solver
@ ComputingWasInterrupted
computing was interrupted
@ GivenGapIsReached
given gap is reached for the computation
@ ProblemWasSolved
problem was solved
@ HardTimeLimitIsReached
hard time limit is reached
@ RequestedSubProblemsWereSolved
requested subproblem was solved
@ InitialNodesGenerated
initial nodes were generated
static const int TryNVariablegOrderInRacing
static const int SolverSettingsForInitialPresolving
static const int InstanceTransferMethod
static const int MaxNRacingParamSetSeed
static const int CheckFeasibilityInLC
static const int LogSolvingStatusFilePath
static const int NoPreprocessingInLC
static const int TimeLimit
static const int SolverSettingsAtRacing
static const int RampUpPhaseProcess
static const int SolverSettingsAtRootNode
static const int DistributeBestPrimalSolution
static const int StopRacingNumberOfNodesLeft
static const int ParaDOUBLE
static const int CommunicateTighterBoundsInRacing
#define PARA_COMM_CALL(paracommcall)
#define THROW_LOGICAL_ERROR1(msg1)
#define THROW_LOGICAL_ERROR3(msg1, msg2, msg3)
#define DEF_SCIP_PARA_COMM(scip_para_comm, comm)
ParaInitialStat extension for SCIP solver.
double memoryLimitOfSolverSCIP
long long virtualMemUsedAtLc
ParaInitiator extension for SCIP solver.
ParaInstance extenstion for SCIP solver.
SCIP message handler for ParaSCIP and FiberSCIP.
#define SCIP_FIXED_MEMORY_FACTOR
#define SCIP_PRESOLVIG_MEMORY_FACTOR
#define SCIP_MEMORY_COPY_FACTOR