Main Page | Namespace List | Class Hierarchy | Alphabetical List | 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:

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

[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, bool &isF_out, double &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 APPSPACK::GCI::getNumProcs(), and 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, APPSPACK::GCI::initSend(), APPSPACK::GCI::pack(), APPSPACK::GCI::send(), APPSPACK::Vector, and workertag.

int APPSPACK::Executor::MPI::recv | ( | int & | tag_out,
|  | bool & | isF_out,
|  | double & | 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
  | isF_out | - True if there was a valid, finite function value
  | f_out | - The function value (only has meaning if isF is true)
  | 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 APPSPACK::GCI::bufinfo(), Feval, APPSPACK::GCI::probe(), APPSPACK::GCI::recv(), APPSPACK::GCI::unpack(), 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 101 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:

- APPSPACK_Executor_MPI.hpp
- APPSPACK_Executor_MPI.cpp

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Wed Dec 14 18:41:05 2005 for APPSPACK 4.0.2 by 1.3.8 written by Dimitri van Heesch, © 1997-2002