#include <scipParaInstanceMpi.h>
Public Member Functions | |
ScipParaInstanceMpi () | |
ScipParaInstanceMpi (SCIP *scip, int method) | |
~ScipParaInstanceMpi () | |
void | copyScipEnvironment (SCIP **scip) |
SCIP * | getScip () |
void | setFileName (const char *inFileName) |
int | bcast (UG::ParaComm *comm, int rank, int method) |
int | getVarIndexRange () |
bool | isCopyIncreasedVariables () |
void | copyIncrasedVariables () |
Public Member Functions inherited from ScipParaInstance | |
ScipParaInstance () | |
ScipParaInstance (SCIP *scip, int method) | |
virtual | ~ScipParaInstance () |
double | convertToExternalValue (double internalValue) |
double | convertToInternalValue (double externalValue) |
void | getSolValuesForOriginalProblem (ScipParaSolution *sol, SCIP_Real *vals) |
void | createProblem (SCIP *scip, int method, bool noPreprocessingInLC, bool usetRootNodeCuts, ScipDiffParamSet *scipDiffParamSetRoot, ScipDiffParamSet *scipDiffParamSet, char *settingsNameLC, char *isolname) |
const std::string | toString () |
bool | isOriginalIndeciesMap () |
bool | isSolverLocalIndeciesMap () |
int | getOrigProbIndex (int index) |
const char * | getProbName () |
void | freeMemory () |
int | getNVars () |
int | getVarIndexRange () |
SCIP_Real | getVarLb (int i) |
SCIP_Real | getVarUb (int i) |
SCIP_Real | getObjCoef (int i) |
int | getVarType (int i) |
const char * | getVarName (int i) |
int | getNConss () |
SCIP_Real | getLhsLinear (int i) |
SCIP_Real | getRhsLinear (int i) |
int | getNVarsLinear (int i) |
int | getIdxLinearCoefVar (int i, int j) |
SCIP_Real * | getLinearCoefs (int i) |
const char * | getConsName (int i) |
SCIP * | getScip () |
void | setUserPlugins (ScipUserPlugins *inUi) |
void | includeUserPlugins (SCIP *inScip) |
virtual void | setFileName (const char *fileName)=0 |
int * | extractOrigProbIndexMap () |
int * | extractSolverLocalIndexMap () |
SCIP * | getParaInstanceScip () |
int | getOrigObjSense () |
virtual bool | isCopyIncreasedVariables ()=0 |
virtual void | copyIncrasedVariables ()=0 |
ScipParaInstance () | |
ScipParaInstance (SCIP *inScip) | |
virtual | ~ScipParaInstance () |
double | convertToExternalValue (double internalValue) |
double | convertToInternalValue (double externalValue) |
void | getSolValuesForOriginalProblem (ScipParaSolution *sol, SCIP_Real *vals) |
void | copyScipEnvironment (SCIP **scip) |
SCIP * | getScip () |
void | createProblem (SCIP *scip, int method, bool noPreprocessingInLC, bool usetRootNodeCuts, ScipDiffParamSet *scipDiffParamSetRoot, ScipDiffParamSet *scipDiffParamSet, char *settingsNameLC, char *isolname) |
const std::string | toString () |
const char * | getProbName () |
int | getNVars () |
int | getVarIndexRange () |
SCIP_Real | getVarLb (int i) |
SCIP_Real | getVarUb (int i) |
int | getVarType (int i) |
SCIP_Real | getObjCoef (int i) |
const char * | getVarName (int i) |
int | getNConss () |
SCIP_Real | getLhsLinear (int i) |
SCIP_Real | getRhsLinear (int i) |
int | getNVarsLinear (int i) |
int | getIdxLinearCoefVar (int i, int j) |
SCIP_Real * | getLinearCoefs (int i) |
const char * | getConsName (int i) |
void | setUserPlugins (ScipUserPlugins *inUi) |
void | includeUserPlugins (SCIP *inScip) |
virtual void | setFileName (const char *file)=0 |
bool | isOriginalIndeciesMap () |
bool | isSolverLocalIndeciesMap () |
int | getOrigProbIndex (int index) |
int * | extractOrigProbIndexMap () |
int * | extractSolverLocalIndexMap () |
SCIP * | getParaInstanceScip () |
int | getOrigObjSense () |
bool | isCopyIncreasedVariables () |
void | copyIncrasedVariables () |
Public Member Functions inherited from BbParaInstance | |
BbParaInstance () | |
DO NOT HAVE DATA MEMBER!! More... | |
virtual | ~BbParaInstance () |
destructor More... | |
virtual int | getVarIndexRange ()=0 |
get variable index range TODO: this function should be in inherited class More... | |
Public Member Functions inherited from ParaInstance | |
ParaInstance () | |
DO NOT HAVE DATA MEMBER!! More... | |
virtual | ~ParaInstance () |
destructor More... | |
virtual const char * | getProbName ()=0 |
get problem name More... | |
virtual int | bcast (ParaComm *comm, int rank, int method)=0 |
broadcast function to all solvers More... | |
virtual const std::string | toString ()=0 |
Stringfy this object. More... | |
Private Member Functions | |
MPI_Datatype | createDatatype1 () |
MPI_Datatype | createDatatype2 (bool memAllocNecessary) |
MPI_Datatype | createDatatype3 (bool memAllocNecessary) |
void | allocateMemoryForDatatype2 () |
void | allocateMemoryForDatatype3 () |
const char * | getFileName () |
Private Attributes | |
int | dummyToKeepStartPos |
const char * | fileName |
ScipInstanceMpi
Definition at line 50 of file scipParaInstanceMpi.h.
constructor
Definition at line 70 of file scipParaInstanceMpi.h.
ScipParaInstanceMpi | ( | SCIP * | scip, |
int | method | ||
) |
constructor : only called from ScipInitiator
assert(n > nVars); mapToOriginalIndecies = new int[SCIPgetNTotalVars(tempScip)]; // need to allocate enough for SCIPvarGetIndex(copyvar) mapToSolverLocalIndecies = new int[SCIPgetNTotalVars(tempScip)]; for( int i = 0; i < SCIPgetNTotalVars(tempScip); i++ ) { mapToOriginalIndecies[i] = -1; mapToSolverLocalIndecies[i] = -1; } SCIP_VAR **tempVars = SCIPgetVars(tempScip); for( int i = 0; i < n; i++ ) { mapToOriginalIndecies[SCIPvarGetIndex(tempVars[i])] = i; mapToSolverLocalIndecies[i] = SCIPvarGetIndex(tempVars[i]); }
orgScip = scip; nVars = n; varIndexRange = SCIPgetNTotalVars(tempScip); paraInstanceScip = tempScip;
if( SCIPgetNConss(scip) > 0 ) { SCIPhashmapFree(&conssmap); } if( SCIPgetNVars(scip) > 0 ) { SCIPhashmapFree(&varmap); } SCIP_CALL_ABORT( SCIPtransformProb(paraInstanceScip)); nCopies = 2; std::cout << "** ParaScipInstance is copied twice. **" << std::endl;
Definition at line 77 of file scipParaInstanceMpi.h.
References ScipParaInstance::copyIncreasedVariables, ScipParaInstance::lVarNames, ScipParaInstance::nCopies, ScipParaInstance::nVars, ScipParaInstance::objCoefs, ScipParaInstance::paraInstanceScip, ScipParaInstance::posVarNames, ScipParaInstance::scip, ScipParaInstance::varIndexRange, ScipParaInstance::varLbs, ScipParaInstance::varNames, ScipParaInstance::varTypes, and ScipParaInstance::varUbs.
~ScipParaInstanceMpi | ( | ) |
destractor
Definition at line 261 of file scipParaInstanceMpi.h.
References ScipParaInstance::orgScip, and ScipParaInstance::paraInstanceScip.
|
private |
Definition at line 178 of file scipParaInstanceMpi.cpp.
References ScipParaInstance::aggregatedConsNames, ScipParaInstance::aggregatedLhsAndLhss, ScipParaInstance::aggregatedVarNames, ScipParaInstance::capacities, ScipParaInstance::consNames, ScipParaInstance::idxBoundDisjunctionConsNames, ScipParaInstance::idxKnapsackConsNames, ScipParaInstance::idxLinearConsNames, ScipParaInstance::idxLogicorConsNames, ScipParaInstance::idxSetppcConsNames, ScipParaInstance::idxSos1ConsNames, ScipParaInstance::idxSos2ConsNames, ScipParaInstance::idxVarboundCoefVar1s, ScipParaInstance::idxVarboundCoefVar2s, ScipParaInstance::idxVarboundConsNames, ScipParaInstance::lAggregatedConsNames, ScipParaInstance::lAggregatedVarNames, ScipParaInstance::lConsNames, ScipParaInstance::linearLhss, ScipParaInstance::linearRhss, ScipParaInstance::lProbName, ScipParaInstance::lVarNames, ScipParaInstance::nAggregatedCoefs, ScipParaInstance::nAggregatedConss, ScipParaInstance::nConss, ScipParaInstance::nIdxLogicorVars, ScipParaInstance::nIdxSetppcVars, ScipParaInstance::nKnapsackConss, ScipParaInstance::nLinearCoefs, ScipParaInstance::nLinearConss, ScipParaInstance::nLKnapsackCoefs, ScipParaInstance::nLogicorConss, ScipParaInstance::nSetppcConss, ScipParaInstance::nSos1Coefs, ScipParaInstance::nSos1Conss, ScipParaInstance::nSos2Coefs, ScipParaInstance::nSos2Conss, ScipParaInstance::nVarboundConss, ScipParaInstance::nVarBoundDisjunctionConss, ScipParaInstance::nVars, ScipParaInstance::nVarsBoundDisjunction, ScipParaInstance::objCoefs, ScipParaInstance::posAggregatedConsNames, ScipParaInstance::posAggregatedVarNames, ScipParaInstance::posConsNames, ScipParaInstance::posVarNames, ScipParaInstance::probName, ScipParaInstance::setppcTypes, THROW_LOGICAL_ERROR1, ScipParaInstance::varboundCoef2s, ScipParaInstance::varboundLhss, ScipParaInstance::varboundRhss, ScipParaInstance::varLbs, ScipParaInstance::varNames, ScipParaInstance::varTypes, and ScipParaInstance::varUbs.
Referenced by ScipParaInstanceMpi::createDatatype2().
|
private |
Definition at line 607 of file scipParaInstanceMpi.cpp.
References ScipParaInstance::aggregatedCoefs, ScipParaInstance::boundsBoundDisjunction, ScipParaInstance::boundTypesBoundDisjunction, ScipParaInstance::idxAggregatedCoefsVars, ScipParaInstance::idxKnapsackCoefsVars, ScipParaInstance::idxLinearCoefsVars, ScipParaInstance::idxLogicorVars, ScipParaInstance::idxSetppcVars, ScipParaInstance::idxSos1CoefsVars, ScipParaInstance::idxSos2CoefsVars, ScipParaInstance::idxVarBoundDisjunction, ScipParaInstance::knapsackCoefs, ScipParaInstance::linearCoefs, ScipParaInstance::nAggregatedCoefs, ScipParaInstance::nAggregatedConss, ScipParaInstance::nIdxLogicorVars, ScipParaInstance::nIdxSetppcVars, ScipParaInstance::nKnapsackConss, ScipParaInstance::nLinearCoefs, ScipParaInstance::nLinearConss, ScipParaInstance::nLKnapsackCoefs, ScipParaInstance::nLogicorConss, ScipParaInstance::nSetppcConss, ScipParaInstance::nSos1Coefs, ScipParaInstance::nSos1Conss, ScipParaInstance::nSos2Coefs, ScipParaInstance::nSos2Conss, ScipParaInstance::nVarBoundDisjunctionConss, ScipParaInstance::nVarsBoundDisjunction, ScipParaInstance::sos1Coefs, and ScipParaInstance::sos2Coefs.
Referenced by ScipParaInstanceMpi::createDatatype3().
|
virtual |
broadcasts instance to all solvers
Implements ParaInstance.
Definition at line 879 of file scipParaInstanceMpi.cpp.
References comm, ScipParaInstanceMpi::createDatatype1(), ScipParaInstanceMpi::createDatatype2(), ScipParaInstanceMpi::createDatatype3(), DEF_PARA_COMM, ScipParaInstanceMpi::dummyToKeepStartPos, ScipParaInstanceMpi::fileName, ScipParaInstance::lProbName, MPI_CALL, PARA_COMM_CALL, ScipParaInstance::probName, and THROW_LOGICAL_ERROR1.
|
virtual |
Implements ScipParaInstance.
Definition at line 301 of file scipParaInstanceMpi.h.
References ScipParaInstance::copyIncreasedVariables.
void copyScipEnvironment | ( | SCIP ** | scip | ) |
create presolved problem instance that is solved by ParaSCIP form scip environment in this object
this routine for Pthread version. So, this should not be used
Definition at line 271 of file scipParaInstanceMpi.h.
|
private |
create scipDiffParamSetPreType
create ScipInstancePrePreDatatype
Definition at line 45 of file scipParaInstanceMpi.cpp.
References ScipParaInstance::lAggregatedConsNames, ScipParaInstance::lAggregatedVarNames, ScipParaInstance::lConsNames, ScipParaInstance::lProbName, ScipParaInstance::lVarNames, MPI_CALL, ScipParaInstance::nAggregatedConss, ScipParaInstance::nConss, ScipParaInstance::nCopies, ScipParaInstance::nKnapsackConss, ScipParaInstance::nLinearConss, ScipParaInstance::nLogicorConss, ScipParaInstance::nSetppcConss, ScipParaInstance::nSos1Conss, ScipParaInstance::nSos2Conss, ScipParaInstance::nVarboundConss, ScipParaInstance::nVarBoundDisjunctionConss, ScipParaInstance::nVars, ScipParaInstance::objOffset, ScipParaInstance::objScale, ScipParaInstance::origObjSense, and ScipParaInstance::varIndexRange.
Referenced by ScipParaInstanceMpi::bcast().
|
private |
create scipDiffParamSetPreType
create ScipInstancePreDatatype
Definition at line 258 of file scipParaInstanceMpi.cpp.
References ScipParaInstance::aggregatedConsNames, ScipParaInstance::aggregatedLhsAndLhss, ScipParaInstance::aggregatedVarNames, ScipParaInstanceMpi::allocateMemoryForDatatype2(), ScipParaInstance::capacities, ScipParaInstance::consNames, ScipParaInstance::idxBoundDisjunctionConsNames, ScipParaInstance::idxKnapsackConsNames, ScipParaInstance::idxLinearConsNames, ScipParaInstance::idxLogicorConsNames, ScipParaInstance::idxSetppcConsNames, ScipParaInstance::idxSos1ConsNames, ScipParaInstance::idxSos2ConsNames, ScipParaInstance::idxVarboundCoefVar1s, ScipParaInstance::idxVarboundCoefVar2s, ScipParaInstance::idxVarboundConsNames, ScipParaInstance::lAggregatedConsNames, ScipParaInstance::lAggregatedVarNames, ScipParaInstance::lConsNames, ScipParaInstance::linearLhss, ScipParaInstance::linearRhss, ScipParaInstance::lProbName, ScipParaInstance::lVarNames, MPI_CALL, ScipParaInstance::nAggregatedCoefs, ScipParaInstance::nAggregatedConss, ScipParaInstance::nConss, ScipParaInstance::nIdxLogicorVars, ScipParaInstance::nIdxSetppcVars, ScipParaInstance::nKnapsackConss, ScipParaInstance::nLinearCoefs, ScipParaInstance::nLinearConss, ScipParaInstance::nLKnapsackCoefs, ScipParaInstance::nLogicorConss, ScipParaInstance::nSetppcConss, ScipParaInstance::nSos1Coefs, ScipParaInstance::nSos1Conss, ScipParaInstance::nSos2Coefs, ScipParaInstance::nSos2Conss, ScipParaInstance::nVarboundConss, ScipParaInstance::nVarBoundDisjunctionConss, ScipParaInstance::nVars, ScipParaInstance::nVarsBoundDisjunction, ScipParaInstance::objCoefs, ScipParaInstance::posAggregatedConsNames, ScipParaInstance::posAggregatedVarNames, ScipParaInstance::posConsNames, ScipParaInstance::posVarNames, ScipParaInstance::probName, ScipParaInstance::setppcTypes, ScipParaInstance::varboundCoef2s, ScipParaInstance::varboundLhss, ScipParaInstance::varboundRhss, ScipParaInstance::varLbs, ScipParaInstance::varNames, ScipParaInstance::varTypes, and ScipParaInstance::varUbs.
Referenced by ScipParaInstanceMpi::bcast().
|
private |
create scipDiffParamSetType
create ScipInstanceDatatype
Definition at line 692 of file scipParaInstanceMpi.cpp.
References ScipParaInstance::aggregatedCoefs, ScipParaInstanceMpi::allocateMemoryForDatatype3(), ScipParaInstance::boundsBoundDisjunction, ScipParaInstance::boundTypesBoundDisjunction, ScipParaInstanceMpi::dummyToKeepStartPos, ScipParaInstance::idxAggregatedCoefsVars, ScipParaInstance::idxKnapsackCoefsVars, ScipParaInstance::idxLinearCoefsVars, ScipParaInstance::idxLogicorVars, ScipParaInstance::idxSetppcVars, ScipParaInstance::idxSos1CoefsVars, ScipParaInstance::idxSos2CoefsVars, ScipParaInstance::idxVarBoundDisjunction, ScipParaInstance::knapsackCoefs, ScipParaInstance::linearCoefs, MPI_CALL, ScipParaInstance::nAggregatedCoefs, ScipParaInstance::nAggregatedConss, ScipParaInstance::nIdxLogicorVars, ScipParaInstance::nIdxSetppcVars, ScipParaInstance::nKnapsackConss, ScipParaInstance::nLinearCoefs, ScipParaInstance::nLinearConss, ScipParaInstance::nLKnapsackCoefs, ScipParaInstance::nLogicorConss, ScipParaInstance::nSetppcConss, ScipParaInstance::nSos1Coefs, ScipParaInstance::nSos1Conss, ScipParaInstance::nSos2Coefs, ScipParaInstance::nSos2Conss, ScipParaInstance::nVarBoundDisjunctionConss, ScipParaInstance::nVarsBoundDisjunction, ScipParaInstance::sos1Coefs, and ScipParaInstance::sos2Coefs.
Referenced by ScipParaInstanceMpi::bcast().
|
privatevirtual |
Implements ScipParaInstance.
Definition at line 66 of file scipParaInstanceMpi.h.
References ScipParaInstanceMpi::fileName.
SCIP * getScip | ( | ) |
this routine for Pthread version. So, this should not be used
Definition at line 279 of file scipParaInstanceMpi.h.
|
virtual |
Reimplemented from ScipParaInstance.
Definition at line 294 of file scipParaInstanceMpi.h.
References ScipParaInstance::varIndexRange.
|
virtual |
Implements ScipParaInstance.
Definition at line 296 of file scipParaInstanceMpi.h.
References ScipParaInstance::copyIncreasedVariables.
|
virtual |
Implements ScipParaInstance.
Definition at line 286 of file scipParaInstanceMpi.h.
References ScipParaInstanceMpi::fileName.
Referenced by main().
|
private |
Definition at line 53 of file scipParaInstanceMpi.h.
Referenced by ScipParaInstanceMpi::bcast(), and ScipParaInstanceMpi::createDatatype3().
|
private |
Definition at line 54 of file scipParaInstanceMpi.h.
Referenced by ScipParaInstanceMpi::bcast(), ScipParaInstanceMpi::getFileName(), and ScipParaInstanceMpi::setFileName().