Scippy

UG

Ubiquity Generator framework

paraDef.h File Reference

Defines for UG Framework. More...

#include <stdexcept>
#include <iostream>
#include <sstream>
#include <string>
#include <cfloat>

Go to the source code of this file.

Namespaces

 UG
 

Macros

#define UG_VERSION   100
 
#define DEFAULT_NUM_EPSILON   1e-9
 
#define MINEPSILON   1e-20
 
#define THROW_LOGICAL_ERROR1(msg1)
 
#define ABORT_LOGICAL_ERROR1(msg1)
 
#define THROW_LOGICAL_ERROR2(msg1, msg2)
 
#define ABORT_LOGICAL_ERROR2(msg1, msg2)
 
#define THROW_LOGICAL_ERROR3(msg1, msg2, msg3)
 
#define ABORT_LOGICAL_ERROR3(msg1, msg2, msg3)
 
#define THROW_LOGICAL_ERROR4(msg1, msg2, msg3, msg4)
 
#define THROW_LOGICAL_ERROR5(msg1, msg2, msg3, msg4, msg5)
 
#define THROW_LOGICAL_ERROR6(msg1, msg2, msg3, msg4, msg5, msg6)
 
#define THROW_LOGICAL_ERROR7(msg1, msg2, msg3, msg4, msg5, msg6, msg7)
 
#define THROW_LOGICAL_ERROR8(msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg8)
 
#define THROW_LOGICAL_ERROR9(msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg8, msg9)
 
#define DELETE_TRANSFER_OBJECT_IN_THREADED_SOLVER(object)   if( object ) delete object
 
#define REALABS(x)   (fabs(x))
 
#define EPSEQ(x, y, eps)   (REALABS((x)-(y)) <= (eps))
 
#define EPSLT(x, y, eps)   ((x)-(y) < -(eps))
 
#define EPSLE(x, y, eps)   ((x)-(y) <= (eps))
 
#define EPSGT(x, y, eps)   ((x)-(y) > (eps))
 
#define EPSGE(x, y, eps)   ((x)-(y) >= -(eps))
 
#define EPSZ(x, eps)   (REALABS(x) <= (eps))
 
#define EPSP(x, eps)   ((x) > (eps))
 
#define EPSN(x, eps)   ((x) < -(eps))
 
#define EPSFLOOR(x, eps)   (floor((x)+(eps)))
 
#define EPSCEIL(x, eps)   (ceil((x)-(eps)))
 
#define EPSFRAC(x, eps)   ((x)-EPSFLOOR(x,eps))
 
#define EPSISINT(x, eps)   (EPSFRAC(x,eps) <= (eps))
 

Variables

static const int MaxStrLen = 1024
 
static const int LpMaxNamelen = 1024
 
static const int CompTerminatedNormally = 0
 
static const int CompTerminatedByAnotherTask = 1
 
static const int CompTerminatedByInterruptRequest = 2
 
static const int CompTerminatedInRacingStage = 3
 
static const int CompInterruptedInRacingStage = 4
 
static const int CompInterruptedInMerging = 5
 
static const int CompTerminatedByTimeLimit = 6
 
static const int CompTerminatedByMemoryLimit = 7
 

Detailed Description

Defines for UG Framework.

Author
Yuji Shinano

Definition in file paraDef.h.

Macro Definition Documentation

◆ ABORT_LOGICAL_ERROR1

#define ABORT_LOGICAL_ERROR1 (   msg1)
Value:
{ \
std::cerr << "[LOGICAL ERROR:" << __FILE__ << "] func = " \
<< __func__ << ", line = " << __LINE__ << " - " \
<< ( msg1 ); \
abort(); \
}

Definition at line 61 of file paraDef.h.

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

◆ ABORT_LOGICAL_ERROR2

#define ABORT_LOGICAL_ERROR2 (   msg1,
  msg2 
)
Value:
{ \
std::cerr << "[LOGICAL ERROR:" << __FILE__ << "] func = " \
<< __func__ << ", line = " << __LINE__ << " - " \
<< ( msg1 ) << ( msg2 ); \
abort(); \
}

Definition at line 78 of file paraDef.h.

Referenced by ParaCommCPP11::~ParaCommCPP11(), ParaCommPth::~ParaCommPth(), and ParaSCIP::~ScipParaCommTh().

◆ ABORT_LOGICAL_ERROR3

#define ABORT_LOGICAL_ERROR3 (   msg1,
  msg2,
  msg3 
)
Value:
{ \
std::cerr << "[LOGICAL ERROR:" << __FILE__ << "] func = " \
<< __func__ << ", line = " << __LINE__ << " - " \
<< ( msg1 ) << ( msg2 ) << ( msg3 ); \
abort(); \
}

Definition at line 95 of file paraDef.h.

Referenced by BbParaLoadCoordinator::~BbParaLoadCoordinator().

◆ DEFAULT_NUM_EPSILON

◆ DELETE_TRANSFER_OBJECT_IN_THREADED_SOLVER

#define DELETE_TRANSFER_OBJECT_IN_THREADED_SOLVER (   object)    if( object ) delete object

Definition at line 161 of file paraDef.h.

◆ EPSCEIL

#define EPSCEIL (   x,
  eps 
)    (ceil((x)-(eps)))

Definition at line 175 of file paraDef.h.

◆ EPSEQ

◆ EPSFLOOR

#define EPSFLOOR (   x,
  eps 
)    (floor((x)+(eps)))

Definition at line 174 of file paraDef.h.

◆ EPSFRAC

#define EPSFRAC (   x,
  eps 
)    ((x)-EPSFLOOR(x,eps))

Definition at line 176 of file paraDef.h.

◆ EPSGE

#define EPSGE (   x,
  y,
  eps 
)    ((x)-(y) >= -(eps))

Definition at line 170 of file paraDef.h.

◆ EPSGT

◆ EPSISINT

#define EPSISINT (   x,
  eps 
)    (EPSFRAC(x,eps) <= (eps))

Definition at line 177 of file paraDef.h.

◆ EPSLE

◆ EPSLT

◆ EPSN

#define EPSN (   x,
  eps 
)    ((x) < -(eps))

Definition at line 173 of file paraDef.h.

◆ EPSP

#define EPSP (   x,
  eps 
)    ((x) > (eps))

Definition at line 172 of file paraDef.h.

◆ EPSZ

#define EPSZ (   x,
  eps 
)    (REALABS(x) <= (eps))

Definition at line 171 of file paraDef.h.

◆ MINEPSILON

◆ REALABS

◆ THROW_LOGICAL_ERROR1

#define THROW_LOGICAL_ERROR1 (   msg1)
Value:
{ \
std::ostringstream s; \
s << "[LOGICAL ERROR:" << __FILE__ << "] func = " \
<< __func__ << ", line = " << __LINE__ << " - " \
<< ( msg1 ); \
throw std::logic_error( s.str() ); \
}

Definition at line 52 of file paraDef.h.

Referenced by BbParaSolverPool::activateSolver(), ScipParaDiffSubproblem::addBranchLinearConss(), ScipParaDiffSubproblem::addBranchSetppcConss(), ScipParaDiffSubproblem::addLocalNodeInfo(), ScipParaInstanceMpi::allocateMemoryForDatatype2(), BbParaSolver::BbParaSolver(), ParaParamSetTh::bcast(), ScipParaDiffSubproblemTh::bcast(), ScipParaInstanceMpi::bcast(), ParaParamSetMpi::createDiffParams(), ParaComm::createParaDiffSubproblem(), BbParaCommPth::createParaRacingRampUpParamSet(), BbParaCommCPP11::createParaRacingRampUpParamSet(), BbParaCommMpi::createParaRacingRampUpParamSet(), ScipParaInstance::createProblem(), BbParaNodePoolForCleanUp::extractNode(), BbParaNodePoolForCleanUp::extractNodeRandomly(), BbParaSolverPoolElement::extractSubtreeRoot(), ScipParaInitiator::init(), BbParaRacingSolverPool::isWinnerDecided(), BbParaSolverPoolElement::makeSubtreeRootCurrent(), ScipParaInitiator::outputFinalSolverStatistics(), ParaSolver::ParaSolver(), ParaTimeLimitMonitorTh::ParaTimeLimitMonitorTh(), ScipParaDiffSubproblemTh::receive(), BbParaNodePoolForCleanUp::removeBoundedNodes(), BbParaNode::removeDescendant(), ParaTask::removeDescendant(), BbParaNodePoolForCleanUp::removeMergedNodes(), BbParaSolverPoolElement::removeSubtreeRoot(), ScipParaInterruptMsgMonitor::ScipParaInterruptMsgMonitor(), ScipParaSolver::ScipParaSolver(), ScipParaDiffSubproblemTh::send(), ScipParaSolver::setRacingParams(), ScipParaSolver::solve(), ParaCommPth::solverReInit(), BbParaSolverTerminationState::toString(), and ScipParaSolver::tryNewSolution().

◆ THROW_LOGICAL_ERROR2

#define THROW_LOGICAL_ERROR2 (   msg1,
  msg2 
)
Value:
{ \
std::ostringstream s_; \
s_ << "[LOGICAL ERROR:" << __FILE__ << "] func = " \
<< __func__ << ", line = " << __LINE__ << " - " \
<< ( msg1 ) << ( msg2 ); \
throw std::logic_error( s_.str() ); \
}

Definition at line 69 of file paraDef.h.

Referenced by BbParaSolverPool::activateSolver(), BbParaSolverPool::addNewSubtreeRootNode(), ParaCommCPP11::allocateMemAndCopy(), ParaCommPth::allocateMemAndCopy(), ScipParaObjCommPointHdlr::checkRootNodeSolvabilityAndSendParaNode(), ParaCommCPP11::copy(), ParaCommPth::copy(), ScipParaSolver::createSubproblem(), BbParaSolverPool::deleteCurrentSubtreeRootNode(), BbParaSolverPool::extractSelfSplitSubtreeRootNode(), BbParaSolverPool::extractSelfSplitSubtreeRootNodes(), ParaCommCPP11::freeMem(), ParaCommPth::freeMem(), ScipParaDiffSubproblem::getFixedVariables(), ScipParaInstance::getLhsLinear(), ScipParaInstance::getNVarsLinear(), ScipParaInstance::getRhsLinear(), BbParaSolverPool::getSelfSplitSubtreeRootNodes(), BbParaSolverPool::inactivateSolver(), BbParaRacingSolverPool::inactivateSolver(), main(), BbParaSolverPool::makeSubtreeRootNodeCurrent(), BbParaLoadCoordinator::processRacingRampUpTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState(), BbParaSolverPool::removeSubtreeRootNode(), BbParaSolverPool::resetCountersInSolver(), BbParaLoadCoordinator::run(), runSolverThread(), SCIP_DECL_HASHKEYVAL(), ScipParaObjCommPointHdlr::scip_exec(), ScipDiffParamSet::ScipDiffParamSet(), ScipParaDiffSubproblem::ScipParaDiffSubproblem(), ParaCommCPP11::solverDel(), ParaCommPth::solverDel(), BbParaSolverPool::solverDied(), BbParaSolverPoolForMinimization::switchInCollectingMode(), and BbParaSolverPoolForMinimization::updateSolverStatus().

◆ THROW_LOGICAL_ERROR3

#define THROW_LOGICAL_ERROR3 (   msg1,
  msg2,
  msg3 
)
Value:
{ \
std::ostringstream s_; \
s_ << "[LOGICAL ERROR:" << __FILE__ << "] func = " \
<< __func__ << ", line = " << __LINE__ << " - " \
<< ( msg1 ) << ( msg2 ) << ( msg3 ); \
throw std::logic_error( s_.str() ); \
}

Definition at line 86 of file paraDef.h.

Referenced by BbParaSolverPool::addNewSubtreeRootNode(), ScipParaInitiator::init(), BbParaSolver::iReceiveMessages(), BbParaSolver::receiveNewTaskAndReactivate(), BbParaLoadCoordinator::run(), SCIP_DECL_HASHKEYVAL(), ScipParaSolver::ScipParaSolver(), BbParaSolver::sendCompletionOfCalculation(), and BbParaSolverPoolForMinimization::updateSolverStatus().

◆ THROW_LOGICAL_ERROR4

#define THROW_LOGICAL_ERROR4 (   msg1,
  msg2,
  msg3,
  msg4 
)

◆ THROW_LOGICAL_ERROR5

#define THROW_LOGICAL_ERROR5 (   msg1,
  msg2,
  msg3,
  msg4,
  msg5 
)
Value:
{ \
std::ostringstream s_; \
s_ << "[LOGICAL ERROR:" << __FILE__ << "] func = " \
<< __func__ << ", line = " << __LINE__ << " - " \
<< ( msg1 ) << ( msg2 ) << ( msg3 ) << ( msg4 ) << ( msg5 ); \
throw std::logic_error( s_.str() ); \
}

Definition at line 112 of file paraDef.h.

Referenced by BbParaLoadCoordinator::changeSearchStrategyOfAllSolversToOriginalSearch().

◆ THROW_LOGICAL_ERROR6

#define THROW_LOGICAL_ERROR6 (   msg1,
  msg2,
  msg3,
  msg4,
  msg5,
  msg6 
)
Value:
{ \
std::ostringstream s_; \
s_ << "[LOGICAL ERROR:" << __FILE__ << "] func = " \
<< __func__ << ", line = " << __LINE__ << " - " \
<< ( msg1 ) << ( msg2 ) << ( msg3 ) << ( msg4 ) << ( msg5 ) << ( msg6 ); \
throw std::logic_error( s_.str() ); \
}

Definition at line 121 of file paraDef.h.

◆ THROW_LOGICAL_ERROR7

#define THROW_LOGICAL_ERROR7 (   msg1,
  msg2,
  msg3,
  msg4,
  msg5,
  msg6,
  msg7 
)
Value:
{ \
std::ostringstream s_; \
s_ << "[LOGICAL ERROR:" << __FILE__ << "] func = " \
<< __func__ << ", line = " << __LINE__ << " - " \
<< ( msg1 ) << ( msg2 ) << ( msg3 ) << ( msg4 ) << ( msg5 ) << ( msg6 ) << ( msg7 ); \
throw std::logic_error( s_.str() ); \
}

Definition at line 130 of file paraDef.h.

◆ THROW_LOGICAL_ERROR8

#define THROW_LOGICAL_ERROR8 (   msg1,
  msg2,
  msg3,
  msg4,
  msg5,
  msg6,
  msg7,
  msg8 
)
Value:
{ \
std::ostringstream s_; \
s_ << "[LOGICAL ERROR:" << __FILE__ << "] func = " \
<< __func__ << ", line = " << __LINE__ << " - " \
<< ( msg1 ) << ( msg2 ) << ( msg3 ) << ( msg4 ) << ( msg5 ) << ( msg6 ) << ( msg7 ) << ( msg8 ); \
throw std::logic_error( s_.str() ); \
}

Definition at line 139 of file paraDef.h.

◆ THROW_LOGICAL_ERROR9

#define THROW_LOGICAL_ERROR9 (   msg1,
  msg2,
  msg3,
  msg4,
  msg5,
  msg6,
  msg7,
  msg8,
  msg9 
)
Value:
{ \
std::ostringstream s_; \
s_ << "[LOGICAL ERROR:" << __FILE__ << "] func = " \
<< __func__ << ", line = " << __LINE__ << " - " \
<< ( msg1 ) << ( msg2 ) << ( msg3 ) << ( msg4 ) << ( msg5 ) << ( msg6 ) << ( msg7 ) << ( msg8 ) << ( msg9 ); \
throw std::logic_error( s_.str() ); \
}

Definition at line 148 of file paraDef.h.

◆ UG_VERSION

#define UG_VERSION   100

UG version number (multiplied by 100 to get integer number)

Definition at line 48 of file paraDef.h.

Referenced by ParaInitiator::ParaInitiator().