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

CustomExecutor Class Reference

#include <cex_executor.hpp>

Inheritance diagram for CustomExecutor:

Inheritance graph
[legend]
Collaboration diagram for CustomExecutor:

Collaboration graph
[legend]
List of all members.

Detailed Description

Custom executor class derived from APPSPACK::Executor::Interface.

See also:
Customizing the APPSPACK::Executor to change the way function evaluations are distributed in parallel

Definition at line 21 of file cex_executor.hpp.

Public Member Functions

 CustomExecutor (int n_in, int nprocs_in)
 Constuctor can accept whatever arguments are appropriate.
 ~CustomExecutor ()
 Destuctor.
bool isWaiting () const
 Returns true if there is a worker free; otherwise, returns false.
bool spawn (const APPSPACK::Vector &x_in, int tag_in)
 Spawns a point on a free worker and returns true if successful; otherwise, returns false.
int recv (int &tag_out, APPSPACK::Vector &f_out, string &msg_out)
void print () const
 Print information about the executor.

Private Attributes

int n
 Number of parameters.
double * x
 The vector to be evaluated, stored as a double* which is needed for passing it thru MPI.
int nprocs
 Total number of processors (note that processor zero is the master and cannot be used as a worker.
vector< int > status
 The status array for the workers. A zero indicates that the worker is NOT busy, and a one indicates that the worker is busy.


Constructor & Destructor Documentation

CustomExecutor::CustomExecutor int  n_in,
int  nprocs_in
 

Constuctor can accept whatever arguments are appropriate.

Definition at line 11 of file cex_executor.cpp.

References n, status, and x.

CustomExecutor::~CustomExecutor  ) 
 

Destuctor.

Definition at line 21 of file cex_executor.cpp.


Member Function Documentation

bool CustomExecutor::isWaiting  )  const [virtual]
 

Returns true if there is a worker free; otherwise, returns false.

Implements APPSPACK::Executor::Interface.

Definition at line 26 of file cex_executor.cpp.

References status.

bool CustomExecutor::spawn const APPSPACK::Vector x_in,
int  tag_in
 

Spawns a point on a free worker and returns true if successful; otherwise, returns false.

Definition at line 35 of file cex_executor.cpp.

References status, x, XTAG, and XVEC.

int CustomExecutor::recv int &  tag_out,
APPSPACK::Vector f_out,
string &  msg_out
 

Checks to see if there is a result from a worker. Returns 0 if no worker has returned a message. Otherwise, it returns the worker id (or any value greater than zero) and fills in the information. It's critical that the tag_out be filled in so that the function value can be matched with the correct point. Moreover, the msg_out should contain some sort of message even for successful evaluations, e.g., "success".

Definition at line 64 of file cex_executor.cpp.

References CODE, FVAL, APPSPACK::Vector::resize(), status, and XTAG.

void CustomExecutor::print  )  const [virtual]
 

Print information about the executor.

Typically called in the intialization of the solver.

Reimplemented from APPSPACK::Executor::Interface.

Definition at line 113 of file cex_executor.cpp.

References nprocs.


Member Data Documentation

int CustomExecutor::n [private]
 

Number of parameters.

Definition at line 55 of file cex_executor.hpp.

Referenced by CustomExecutor().

double* CustomExecutor::x [private]
 

The vector to be evaluated, stored as a double* which is needed for passing it thru MPI.

Definition at line 59 of file cex_executor.hpp.

Referenced by CustomExecutor(), and spawn().

int CustomExecutor::nprocs [private]
 

Total number of processors (note that processor zero is the master and cannot be used as a worker.

Definition at line 63 of file cex_executor.hpp.

Referenced by print().

vector<int> CustomExecutor::status [private]
 

The status array for the workers. A zero indicates that the worker is NOT busy, and a one indicates that the worker is busy.

Definition at line 68 of file cex_executor.hpp.

Referenced by CustomExecutor(), isWaiting(), recv(), and spawn().


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:35 2007 for APPSPACK 5.0.1 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2002