#include <Applicator.h>
Collaboration diagram for casa::Applicator:

Internal
Applies or controls the execution of parallelized algorithms.
The Applicator class provides the interface to parallel communication. It holds the parallel transport layer, and controls the execution of parallelized algorithms.
To provide a simple programming interface to parallelization, and to encapsulate the transport layer and parallel process control.
Definition at line 88 of file Applicator.h.
Public Types | |
| enum | Status |
| Enum to define the process status table. More... | |
| enum | Signals |
| Recognized signals. More... | |
Public Member Functions | |
| Applicator () | |
| Default constructor, and destructor. | |
| ~Applicator () | |
| void | init (Int argc, Char *argv[]) |
| Initialization (includes parallel transport initialization). | |
| void | initThreads (Int argc, Char *argv[]) |
| void | initThreads () |
| void | defineAlgorithm (Algorithm *) |
| define an Algorithm if we need too; | |
| Bool | isController () |
| Status functions to indicate whether this Applicator is executing as a controller or worker process. | |
| Bool | isWorker () |
| Bool | isSerial () |
| True if executing serially. | |
| Int | numProcs () |
| Return the number of processes. | |
| Bool | nextAvailProcess (Algorithm &a, Int &rank) |
| Assign the next free worker process to a specified Algorithm. | |
| Int | nextProcessDone (Algorithm &a, Bool &allDone) |
| Return the rank of the next process to complete the specified Algorithm. | |
| void | done () |
| Signal that a worker process is done. | |
| void | apply (Algorithm &a) |
| Execute an algorithm directly. | |
| Int | put (const Array< Float > &an) |
| Put and get methods to be executed on the parallel transport layer. | |
| Int | put (const Array< Double > &an) |
| Int | put (const Array< Int > &an) |
| Int | put (const Array< Complex > &an) |
| Int | put (const Array< DComplex > &an) |
| Int | put (const Float &n) |
| Int | put (const Complex &n) |
| Int | put (const DComplex &n) |
| Int | put (const Double &n) |
| Int | put (const Int &n) |
| Int | put (const Bool &b) |
| Int | put (const String &s) |
| Int | put (const Record &r) |
| Int | get (Array< Float > &an) |
| Int | get (Array< Double > &an) |
| Int | get (Array< Complex > &an) |
| Int | get (Array< DComplex > &an) |
| Int | get (Array< Int > &an) |
| Int | get (Float &n) |
| Int | get (Double &n) |
| Int | get (Complex &n) |
| Int | get (DComplex &n) |
| Int | get (Int &n) |
| Int | get (Bool &b) |
| Int | get (String &s) |
| Int | get (Record &r) |
Private Member Functions | |
| void | loop () |
| Executed by worker process waiting for an assigned task. | |
| void | defineAlgorithms () |
| Fill algorithm map. | |
| void | setupProcStatus () |
| Utility functions for the current list of processes, and their status. | |
| Int | findFreeProc (Bool &lastOne) |
Private Attributes | |
| PTransport * | comm |
| Pointer to the parallel transport. | |
| OrderedMap< String, Int > | algorithmIds |
| Map of known algorithm names and id. | |
| OrderedMap< Int, Algorithm * > | knownAlgorithms |
| Int | LastID |
| ID for the last Algorithm defined. | |
| Bool | usedAllThreads |
| True if no more processes are free. | |
| Bool | serial |
| True if executing in serial. | |
| Int | nProcs |
| Number of processes. | |
| Vector< Int > | procStatus |
| Process status list. | |
| casa::Applicator::Applicator | ( | ) |
Default constructor, and destructor.
| casa::Applicator::~Applicator | ( | ) |
Initialization (includes parallel transport initialization).
| void casa::Applicator::initThreads | ( | ) |
| Bool casa::Applicator::isController | ( | ) |
Status functions to indicate whether this Applicator is executing as a controller or worker process.
| Bool casa::Applicator::isWorker | ( | ) |
| Bool casa::Applicator::isSerial | ( | ) | [inline] |
| Int casa::Applicator::numProcs | ( | ) | [inline] |
Assign the next free worker process to a specified Algorithm.
Return the rank of the next process to complete the specified Algorithm.
| void casa::Applicator::done | ( | ) |
| void casa::Applicator::apply | ( | Algorithm & | a | ) |
Execute an algorithm directly.
Put and get methods to be executed on the parallel transport layer.
Definition at line 132 of file Applicator.h.
References comm, and casa::PTransport::put().
| Int casa::Applicator::put | ( | const Complex & | n | ) | [inline] |
| Int casa::Applicator::put | ( | const DComplex & | n | ) | [inline] |
| Int casa::Applicator::get | ( | Complex & | n | ) | [inline] |
| Int casa::Applicator::get | ( | DComplex & | n | ) | [inline] |
| void casa::Applicator::loop | ( | ) | [private] |
Executed by worker process waiting for an assigned task.
| void casa::Applicator::defineAlgorithms | ( | ) | [private] |
Fill algorithm map.
| void casa::Applicator::setupProcStatus | ( | ) | [private] |
Utility functions for the current list of processes, and their status.
PTransport* casa::Applicator::comm [private] |
OrderedMap<String, Int> casa::Applicator::algorithmIds [private] |
OrderedMap<Int, Algorithm*> casa::Applicator::knownAlgorithms [private] |
Definition at line 166 of file Applicator.h.
Int casa::Applicator::LastID [private] |
Bool casa::Applicator::usedAllThreads [private] |
Bool casa::Applicator::serial [private] |
Int casa::Applicator::nProcs [private] |
Vector<Int> casa::Applicator::procStatus [private] |
1.5.1