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::Executor::MPI Class Reference

#include <APPSPACK_Executor_MPI.hpp>

Inheritance diagram for APPSPACK::Executor::MPI:

Inheritance graph
[legend]
Collaboration diagram for APPSPACK::Executor::MPI:

Collaboration graph
[legend]
List of all members.

Detailed Description

MPI Executor.

MPI implementation of the Executor::Interface. Coordinates the workers. This includes keeping track of each worker's status (free or busy), sending messages to the workers with the points to be evaluated, and receiving messages with completed function evaluations from the workers.

Note:
Only works if MPI is enabled at configure time; see MPI Configure Options.

Definition at line 58 of file APPSPACK_Executor_MPI.hpp.

Public Types

enum  MsgTags { Init, Feval, Terminate }
 Message codes exchanged with worker. More...

Public Member Functions

 MPI ()
 constructor
virtual ~MPI ()
 Destructor.
virtual bool isWaiting () const
 Return true if the executor is waiting for more points to be spawned.
virtual bool spawn (const Vector &x_in, int tag_in)
 Start a function evaluation for the given point with the given integer tag.
virtual int recv (int &tag_out, Vector &f_out, string &msg_out)
 Check to see if any function evaluations have finished and return the relevant information.
virtual void print () const
 Optional print function to print out information about the executor.

Private Attributes

vector< int > workertag
 Tag of current point, if any.


Member Enumeration Documentation

enum APPSPACK::Executor::MPI::MsgTags
 

Message codes exchanged with worker.

Enumeration values:
Init  Initialization.
Feval  Function Evaluation.
Terminate  Terminate.

Definition at line 63 of file APPSPACK_Executor_MPI.hpp.


Constructor & Destructor Documentation

APPSPACK::Executor::MPI::MPI  ) 
 

constructor

Definition at line 41 of file APPSPACK_Executor_MPI.cpp.

References workertag.

APPSPACK::Executor::MPI::~MPI  )  [virtual]
 

Destructor.

Definition at line 49 of file APPSPACK_Executor_MPI.cpp.


Member Function Documentation

bool APPSPACK::Executor::MPI::isWaiting  )  const [virtual]
 

Return true if the executor is waiting for more points to be spawned.

Implements APPSPACK::Executor::Interface.

Definition at line 53 of file APPSPACK_Executor_MPI.cpp.

References workertag.

bool APPSPACK::Executor::MPI::spawn const Vector x_in,
int  tag_in
[virtual]
 

Start a function evaluation for the given point with the given integer tag.

This function should not be called without checking isNotFull() first. However, if it is called but the executor is already full, this method will return false.

Implements APPSPACK::Executor::Interface.

Definition at line 62 of file APPSPACK_Executor_MPI.cpp.

References Feval, and workertag.

int APPSPACK::Executor::MPI::recv int &  tag_out,
Vector f_out,
string &  msg_out
[virtual]
 

Check to see if any function evaluations have finished and return the relevant information.

If a function evaluation has completed, fill in the references that are passed to the function as follows.

Parameters:
tag_out - The tag corresponding to the x-vector that was evaluated
f_out - Vector of function values. An empty vector means that there is no value. Or use dne() as a vector entry to say that a particular value does not exist.
msg_out - Message about function evaluation
Return values:
Returns 0 (zero) if no function value is received. Otherwise, returns the worker id (any positive integer).

Implements APPSPACK::Executor::Interface.

Definition at line 79 of file APPSPACK_Executor_MPI.cpp.

References Feval, and workertag.

void APPSPACK::Executor::MPI::print  )  const [virtual]
 

Optional print function to print out information about the executor.

Reimplemented from APPSPACK::Executor::Interface.

Definition at line 100 of file APPSPACK_Executor_MPI.cpp.

References workertag.


Member Data Documentation

vector<int> APPSPACK::Executor::MPI::workertag [private]
 

Tag of current point, if any.

A tag of -1 indicates that the worker is free.

Definition at line 91 of file APPSPACK_Executor_MPI.hpp.

Referenced by isWaiting(), MPI(), print(), 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:36 2007 for APPSPACK 5.0.1 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2002