# AlpsParams Class Reference

`#include <AlpsParams.h>`

Inheritance diagram for AlpsParams:
[legend]
Collaboration diagram for AlpsParams:
[legend]

List of all members.

## Public Types
enum | boolParams { checkMemory, deleteDeadNode, interClusterBalance, intraClusterBalance, printSolution, endOfBoolParams }
| Character parameters. More...
enum | intParams { bufSpare, clockType, eliteSize, hubInitNodeNum, hubMsgLevel, hubNum, largeSize, logFileLevel, masterInitNodeNum, masterReportInterval, hubWorkClusterSizeLimit, mediumSize, msgLevel, nodeLimit, nodeLogInterval, printSystemStatus, processNum, staticBalanceScheme, searchStrategy, searchStrategyRampUp, smallSize, solLimit, unitWorkNodes, workerMsgLevel, endOfIntParams }
| Integer paramters. More...
enum | dblParams { changeWorkThreshold, donorThreshold, hubReportPeriod, masterBalancePeriod, needWorkThreshold, receiverThreshold, timeLimit, tolerance, unitWorkTime, zeroLoad, endOfDblParams }
| Double parameters. More...
enum | strParams { instance, logFile, endOfStrParams }
| String parameters. More...
enum | strArrayParams { strArrayDummy, endOfStrArrayParams }
| There are no string array parameters. More...
## Public Member Functions
virtual | ~AlpsParams ()
AlpsParams & | operator= (const AlpsParams &x)
virtual void | createKeywordList ()
| Method for creating the list of keyword looked for in the parameter file.
virtual void | setDefaultEntries ()
| Method for setting the default values for the parameters.
void | setEntry (const boolParams key, const char *val)
| char* is true(1) or false(0), not used
void | setEntry (const boolParams key, const char val)
| char is true(1) or false(0), not used
void | setEntry (const boolParams key, const bool val)
| This method is the one that ever been used.
void | setEntry (const intParams key, const char *val)
void | setEntry (const intParams key, const int val)
void | setEntry (const dblParams key, const char *val)
void | setEntry (const dblParams key, const double val)
void | setEntry (const strParams key, const char *val)
void | setEntry (const strArrayParams key, const char *val)
Constructors.
| AlpsParams ()
| The default constructor creates a parameter set with from the template argument structure.
Query methods
For user's application: Copy following code exactly (till the end of this class) and do NOT change anything. The reason can not put following functions in base class `AlpsParameterSet` is: `boolParams` and `endOfBoolParams` etc. can NOT be declared in base class. They are different types for each derived classes. The members of the parameter set can be queried for using the overloaded entry() method. Using the example in the class documentation the user can get a parameter with the "<code>param.entry(USER_par::parameter_name)</code>" expression.
bool | entry (const boolParams key) const
int | entry (const intParams key) const
double | entry (const dblParams key) const
const std::string & | entry (const strParams key) const
const std::vector< std::string > & | entry (const strArrayParams key) const
Packing/unpacking methods
void | pack (AlpsEncoded &buf)
| Pack the parameter set into buf.
void | unpack (AlpsEncoded &buf)
| Unpack the parameter set from buf.

## Detailed Description

Definition at line 36 of file AlpsParams.h.

## Member Enumeration Documentation

enum AlpsParams::boolParams

Character parameters.

All of these variable are used as booleans (ture = 1, false = 0).

Enumerator:

  checkMemory | Check memory. Default: false
  deleteDeadNode | Remove dead nodes or not. Default: true.
  interClusterBalance | Master balances the workload of hubs: centralized. Default: true.
  intraClusterBalance | Hub balances the workload of workers: receiver initialized. Default: true
  printSolution | Print solution to screen and log if have a solution and msgLevel and logFileLevel permits. Default: false.
  endOfBoolParams |

Definition at line 40 of file AlpsParams.h.

enum AlpsParams::intParams

Integer paramters.

Enumerator:

  bufSpare | The size of extra memory allocated to a message buffer. Default: 256 byte
  clockType | Type of clock when timing rampup, rampdown, etc. CPU or Wallclock. default: wallclock
  eliteSize | Number of the "elite" nodes that are used in determining workload. Default: 1
  hubInitNodeNum | The number of nodes initially generated by each hub. Default: 2
  hubMsgLevel | Message level of the hub specific messages. (0: no print to screen; 1: summary; 2: moderate; 3: verbose) Default: 0
  hubNum | The number of hubs. Default: 1
  largeSize | The size of memory allocated for large size message. Default: 10485760
  logFileLevel | The level of log file. (0: no log file; 1: summary; 2: moderate; 3: verbose) Default: 0
  masterInitNodeNum | The number of nodes initially generated by the master. Default: 2
  masterReportInterval | The interval between master report system status. Default: 10
  hubWorkClusterSizeLimit | If the number of processes in a cluster is less than it, the hub also work as a worker. Default: 0 (Hub does NOT work)
  mediumSize | The size of memory allocated for medium size message. Default: 4096
  msgLevel | The level of printing messages on screen. Used to control master and general messages. (0: no print to screen; 1: summary; 2: moderate; 3: verbose) Default: 2
  nodeLimit | The max number of nodes can be processed. Default: ALPS_INT_MAX
  nodeLogInterval | Node log interval. Default: 100
  printSystemStatus | Print system status: 0: do not print, 1: print. Default: 1;
  processNum | The total number of processes that are launched for parallel code. Default: 2 Not used since can get actual number of processes from MPI.
  staticBalanceScheme | Static load balancing scheme -- root initialization (0) -- spiral (1).
  searchStrategy | Search strategy -- best-first (0) -- best-first-estimate (1) -- breadth-first (2) -- depth-first (3) -- hybrid (4) Default: hybrid.
  searchStrategyRampUp |
  smallSize | The size of memory allocated for small size message. Default: 1024
  solLimit | The max num of solution can be stored in a solution pool. Default: ALPS_INT_MAX
  unitWorkNodes | The size/number of nodes of a unit work. Default: 50
  workerMsgLevel | Message level of the worker specific messages. (0: no print to screen; 1: summary; 2: moderate; 3: verbose) Default: 0
  endOfIntParams |

Definition at line 63 of file AlpsParams.h.

enum AlpsParams::dblParams

Double parameters.

Enumerator:

  changeWorkThreshold | The threshold of workload below which a worker will change the subtree that is working on. Default: 0.05
  donorThreshold | It is between 1.0 - infty. When the workload in process is more than the average workload timing donorThreshold, it is a donor in load balancing. Defaut: 0.1
  hubReportPeriod | The time period (sec) for hubs to process messages. Default: 0.1
  masterBalancePeriod | The time period for master to do loading balance/termination check. Default: 0.05
  needWorkThreshold | The threshold of workload below which a process will ask for workload Default: 2.
  receiverThreshold | It is between 0.0 - 1.0. When the workload in process is less than the average workload timing receiverThreshold, it is a receiver. Default: 0.1
  timeLimit | The time limit (in seconds) of search. Default: ALPS_DBL_MAX
  tolerance | The numeric tolerance. Default: 1e-6
  unitWorkTime | The time length of a unit work. Default: 0.5
  zeroLoad | If less than this number, it is considered zero workload. Default: 1e-6
  endOfDblParams |

Definition at line 158 of file AlpsParams.h.

enum AlpsParams::strParams

String parameters.

Enumerator:

  instance | The instance to be solved. Default: "NONE"
  logFile | The name of log file. Default: "Alps.log "
  endOfStrParams |

Definition at line 199 of file AlpsParams.h.

enum AlpsParams::strArrayParams

There are no string array parameters.

Enumerator:

  strArrayDummy |
  endOfStrArrayParams |

Definition at line 212 of file AlpsParams.h.

## Constructor & Destructor Documentation

AlpsParams::AlpsParams | ( |  | ) | `[inline]`

The default constructor creates a parameter set with from the template argument structure.

The keyword list is created and the defaults are set.

Definition at line 227 of file AlpsParams.h.

virtual AlpsParams::~AlpsParams | ( |  | ) | `[inline, virtual]`

Definition at line 241 of file AlpsParams.h.

## Member Function Documentation

AlpsParams& AlpsParams::operator= | ( | const AlpsParams & | x | ) | `[inline]`

Definition at line 244 of file AlpsParams.h.

virtual void AlpsParams::createKeywordList | ( |  | ) | `[virtual]`

Method for creating the list of keyword looked for in the parameter file.

Implements AlpsParameterSet.

virtual void AlpsParams::setDefaultEntries | ( |  | ) | `[virtual]`

Method for setting the default values for the parameters.

Implements AlpsParameterSet.

bool AlpsParams::entry | ( | const boolParams | key | ) | const`[inline]`

Definition at line 293 of file AlpsParams.h.

int AlpsParams::entry | ( | const intParams | key | ) | const`[inline]`

Definition at line 295 of file AlpsParams.h.

double AlpsParams::entry | ( | const dblParams | key | ) | const`[inline]`

Definition at line 297 of file AlpsParams.h.

const std::string& AlpsParams::entry | ( | const strParams | key | ) | const`[inline]`

Definition at line 300 of file AlpsParams.h.

const std::vector<std::string>& AlpsParams::entry | ( | const strArrayParams | key | ) | const`[inline]`

Definition at line 303 of file AlpsParams.h.

void AlpsParams::setEntry | ( | const boolParams | key,
|  | const char * | val |
| ) |  |  | `[inline]`

char* is true(1) or false(0), not used

Definition at line 309 of file AlpsParams.h.

void AlpsParams::setEntry | ( | const boolParams | key,
|  | const char | val |
| ) |  |  | `[inline]`

char is true(1) or false(0), not used

Definition at line 312 of file AlpsParams.h.

void AlpsParams::setEntry | ( | const boolParams | key,
|  | const bool | val |
| ) |  |  | `[inline]`

This method is the one that ever been used.

Definition at line 315 of file AlpsParams.h.

void AlpsParams::setEntry | ( | const intParams | key,
|  | const char * | val |
| ) |  |  | `[inline]`

Definition at line 318 of file AlpsParams.h.

void AlpsParams::setEntry | ( | const intParams | key,
|  | const int | val |
| ) |  |  | `[inline]`

Definition at line 321 of file AlpsParams.h.

void AlpsParams::setEntry | ( | const dblParams | key,
|  | const char * | val |
| ) |  |  | `[inline]`

Definition at line 324 of file AlpsParams.h.

void AlpsParams::setEntry | ( | const dblParams | key,
|  | const double | val |
| ) |  |  | `[inline]`

Definition at line 327 of file AlpsParams.h.

void AlpsParams::setEntry | ( | const strParams | key,
|  | const char * | val |
| ) |  |  | `[inline]`

Definition at line 330 of file AlpsParams.h.

void AlpsParams::setEntry | ( | const strArrayParams | key,
|  | const char * | val |
| ) |  |  | `[inline]`

Definition at line 333 of file AlpsParams.h.

void AlpsParams::pack | ( | AlpsEncoded & | buf | ) | `[inline, virtual]`

Pack the parameter set into buf.

Reimplemented from AlpsParameterSet.

Definition at line 341 of file AlpsParams.h.

void AlpsParams::unpack | ( | AlpsEncoded & | buf | ) | `[inline, virtual]`

Unpack the parameter set from buf.

Reimplemented from AlpsParameterSet.

Definition at line 355 of file AlpsParams.h.

The documentation for this class was generated from the following file:

- /home/coin/svn-release/Alps-1.5.2/Alps/src/AlpsParams.h