Scippy

UG

Ubiquity Generator framework

ScipParaInstanceMpi Class Reference

#include <scipParaInstanceMpi.h>

+ Inheritance diagram for ScipParaInstanceMpi:

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 *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)
 
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...
 
- Public Member Functions inherited from ParaInstance
 ParaInstance ()
 DO NOT HAVE DATA MEMBER!! More...
 
virtual ~ParaInstance ()
 destructor 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
 

Additional Inherited Members

- Protected Attributes inherited from ScipParaInstance
SCIP * scip
 
int nVars
 
int varIndexRange
 
int * mapToOriginalIndecies
 
int * mapToSolverLocalIndecies
 
SCIP * orgScip
 
bool copyIncreasedVariables
 

Detailed Description

ScipInstanceMpi

Definition at line 50 of file scipParaInstanceMpi.h.

Constructor & Destructor Documentation

◆ ScipParaInstanceMpi() [1/2]

constructor

Definition at line 70 of file scipParaInstanceMpi.h.

◆ ScipParaInstanceMpi() [2/2]

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::nVars, ScipParaInstance::scip, and ScipParaInstance::varIndexRange.

◆ ~ScipParaInstanceMpi()

destractor

Definition at line 261 of file scipParaInstanceMpi.h.

References ScipParaInstance::orgScip.

Member Function Documentation

◆ allocateMemoryForDatatype2()

void allocateMemoryForDatatype2 ( )
private

Definition at line 178 of file scipParaInstanceMpi.cpp.

References THROW_LOGICAL_ERROR1.

◆ allocateMemoryForDatatype3()

void allocateMemoryForDatatype3 ( )
private

Definition at line 607 of file scipParaInstanceMpi.cpp.

◆ bcast()

int bcast ( UG::ParaComm comm,
int  rank,
int  method 
)
virtual

broadcasts instance to all solvers

Implements ParaInstance.

Definition at line 879 of file scipParaInstanceMpi.cpp.

References DEF_PARA_COMM, MPI_CALL, PARA_COMM_CALL, and THROW_LOGICAL_ERROR1.

Referenced by ScipParaInstanceMpi::setFileName().

◆ copyIncrasedVariables()

void copyIncrasedVariables ( )

Definition at line 301 of file scipParaInstanceMpi.h.

References ScipParaInstance::copyIncreasedVariables.

◆ copyScipEnvironment()

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.

◆ createDatatype1()

MPI_Datatype createDatatype1 ( )
private

create scipDiffParamSetPreType

create ScipInstancePrePreDatatype

Definition at line 45 of file scipParaInstanceMpi.cpp.

References MPI_CALL.

◆ createDatatype2()

MPI_Datatype createDatatype2 ( bool  memAllocNecessary)
private

create scipDiffParamSetPreType

create ScipInstancePreDatatype

Definition at line 258 of file scipParaInstanceMpi.cpp.

References MPI_CALL.

◆ createDatatype3()

MPI_Datatype createDatatype3 ( bool  memAllocNecessary)
private

create scipDiffParamSetType

create ScipInstanceDatatype

Definition at line 692 of file scipParaInstanceMpi.cpp.

References MPI_CALL.

◆ getFileName()

const char* getFileName ( )
privatevirtual

Implements ScipParaInstance.

Definition at line 66 of file scipParaInstanceMpi.h.

References ScipParaInstanceMpi::fileName.

◆ getScip()

SCIP* getScip ( )

this routine for Pthread version. So, this should not be used

Definition at line 279 of file scipParaInstanceMpi.h.

◆ getVarIndexRange()

int getVarIndexRange ( )
virtual

Implements BbParaInstance.

Definition at line 294 of file scipParaInstanceMpi.h.

References ScipParaInstance::varIndexRange.

◆ isCopyIncreasedVariables()

bool isCopyIncreasedVariables ( )

Definition at line 296 of file scipParaInstanceMpi.h.

References ScipParaInstance::copyIncreasedVariables.

◆ setFileName()

void setFileName ( const char *  inFileName)
virtual

Implements ScipParaInstance.

Definition at line 286 of file scipParaInstanceMpi.h.

References ScipParaInstanceMpi::bcast(), and comm.

Referenced by main().

Member Data Documentation

◆ dummyToKeepStartPos

int dummyToKeepStartPos
private

Definition at line 53 of file scipParaInstanceMpi.h.

◆ fileName

const char* fileName
private

Definition at line 54 of file scipParaInstanceMpi.h.

Referenced by ScipParaInstanceMpi::getFileName().