Sandia Home Sandia Home
Main Page | Publications | Downloads | Configuration | Running the Code | Solver Parameters | FAQ | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

APPSPACK::Counter Class Reference

#include <APPSPACK_Counter.hpp>

List of all members.


Detailed Description

Counts the different types of function evaluations, using arbitary codes returned by the user.

This object is used by the Conveyor to for counting the number of cached points and the number of evaluated points, including on a per worker basis.

On errors, users can provide a message string. This counter can also track how many times each error string is returned, including on a per processor basis.

In summary, the counter tracks the following.

Definition at line 64 of file APPSPACK_Counter.hpp.

Public Member Functions

 Counter ()
 ~Counter ()
int getNumEvaluations () const
 Returns the total number of evaluations.
string getCountString () const
 Returns a string with the current global counts.
void incrementCached ()
 Increment the number of cached function values.
void incrementEvaluated (int workerId, const string &msg)
 Increment the number of evaluations.
void print () const
 Print the current counts

Private Types

typedef map< string, int > MsgCnt
 Used the count the number of each type of evaluation.
typedef map< int, MsgCntWkrMsgCnt
 Used to keep per processor counts.
typedef MsgCnt::iterator MsgCntIterator
 Iterator for MsgCnt.
typedef WkrMsgCnt::iterator WkrMsgCntIterator
 Iterator for WkrMsgCnt.
typedef MsgCnt::const_iterator MsgCntConstIterator
 Const iterator for MsgCnt.
typedef WkrMsgCnt::const_iterator WkrMsgCntConstIterator
 Const iterator for WkrMsgCnt.

Private Member Functions

void incrementMsgCnt (MsgCnt &mc, const string &msg)
 Increments the number of times that the given msg has appeared in mc.

Private Attributes

MsgCnt msgCnt
 The number of each user-defined type of evaluation.
WkrMsgCnt wkrMsgCnt
 The number of each user-defined type of evaluation per worker.
int nCached
 The total number of cached function values.
int nEvaluated
 The total number of evaluations.


Member Typedef Documentation

typedef map<string, int> APPSPACK::Counter::MsgCnt [private]
 

Used the count the number of each type of evaluation.

Definition at line 98 of file APPSPACK_Counter.hpp.

typedef map<int, MsgCnt> APPSPACK::Counter::WkrMsgCnt [private]
 

Used to keep per processor counts.

Definition at line 101 of file APPSPACK_Counter.hpp.

typedef MsgCnt::iterator APPSPACK::Counter::MsgCntIterator [private]
 

Iterator for MsgCnt.

Definition at line 104 of file APPSPACK_Counter.hpp.

Referenced by incrementMsgCnt().

typedef WkrMsgCnt::iterator APPSPACK::Counter::WkrMsgCntIterator [private]
 

Iterator for WkrMsgCnt.

Definition at line 106 of file APPSPACK_Counter.hpp.

typedef MsgCnt::const_iterator APPSPACK::Counter::MsgCntConstIterator [private]
 

Const iterator for MsgCnt.

Definition at line 108 of file APPSPACK_Counter.hpp.

Referenced by getCountString(), and print().

typedef WkrMsgCnt::const_iterator APPSPACK::Counter::WkrMsgCntConstIterator [private]
 

Const iterator for WkrMsgCnt.

Definition at line 110 of file APPSPACK_Counter.hpp.

Referenced by print().


Constructor & Destructor Documentation

APPSPACK::Counter::Counter  ) 
 

Constructor

Definition at line 40 of file APPSPACK_Counter.cpp.

APPSPACK::Counter::~Counter  ) 
 

Destructor

Definition at line 46 of file APPSPACK_Counter.cpp.


Member Function Documentation

int APPSPACK::Counter::getNumEvaluations  )  const
 

Returns the total number of evaluations.

Definition at line 50 of file APPSPACK_Counter.cpp.

Referenced by APPSPACK::Solver::processEvaluatedTrialPoints().

string APPSPACK::Counter::getCountString  )  const
 

Returns a string with the current global counts.

Definition at line 55 of file APPSPACK_Counter.cpp.

References msgCnt, and MsgCntConstIterator.

Referenced by APPSPACK::Conveyor::exchange().

void APPSPACK::Counter::incrementCached  ) 
 

Increment the number of cached function values.

Definition at line 63 of file APPSPACK_Counter.cpp.

References nCached.

Referenced by APPSPACK::Conveyor::exchange().

void APPSPACK::Counter::incrementEvaluated int  workerId,
const string &  msg
 

Increment the number of evaluations.

Parameters:
workerId - The id of the worker that performed the evaluation.
msg - The user-defined message about the function evaluation.

Definition at line 68 of file APPSPACK_Counter.cpp.

References incrementMsgCnt(), msgCnt, nEvaluated, and wkrMsgCnt.

Referenced by APPSPACK::Conveyor::exchange().

void APPSPACK::Counter::print  )  const
 

Print the current counts

Definition at line 85 of file APPSPACK_Counter.cpp.

References msgCnt, MsgCntConstIterator, nCached, nEvaluated, wkrMsgCnt, and WkrMsgCntConstIterator.

Referenced by APPSPACK::Solver::solve().

void APPSPACK::Counter::incrementMsgCnt MsgCnt mc,
const string &  msg
[private]
 

Increments the number of times that the given msg has appeared in mc.

Definition at line 76 of file APPSPACK_Counter.cpp.

References MsgCntIterator.

Referenced by incrementEvaluated().


Member Data Documentation

MsgCnt APPSPACK::Counter::msgCnt [private]
 

The number of each user-defined type of evaluation.

Definition at line 117 of file APPSPACK_Counter.hpp.

Referenced by getCountString(), incrementEvaluated(), and print().

WkrMsgCnt APPSPACK::Counter::wkrMsgCnt [private]
 

The number of each user-defined type of evaluation per worker.

Definition at line 120 of file APPSPACK_Counter.hpp.

Referenced by incrementEvaluated(), and print().

int APPSPACK::Counter::nCached [private]
 

The total number of cached function values.

Definition at line 123 of file APPSPACK_Counter.hpp.

Referenced by incrementCached(), and print().

int APPSPACK::Counter::nEvaluated [private]
 

The total number of evaluations.

Definition at line 126 of file APPSPACK_Counter.hpp.

Referenced by incrementEvaluated(), and print().


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

 

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Fri Feb 16 10:33:36 2007 for APPSPACK 5.0.1 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2002