casa
$Rev:20696$
|
Class which provides an interface to the parallelization infrastructure. More...
#include <Applicator.h>
Public Types | |
enum | Status { FREE, ASSIGNED } |
Enum to define the process status table. More... | |
enum | Signals { STOP, DONE } |
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. |
Class which provides an interface to the parallelization infrastructure.
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.
Enum to define the process status table.
Definition at line 91 of file Applicator.h.
Default constructor, and destructor.
void casa::Applicator::apply | ( | Algorithm & | a | ) |
Execute an algorithm directly.
void casa::Applicator::defineAlgorithm | ( | Algorithm * | ) |
define an Algorithm if we need too;
void casa::Applicator::defineAlgorithms | ( | ) | [private] |
Fill algorithm map.
void casa::Applicator::done | ( | ) |
Signal that a worker process is done.
Referenced by casa::Algorithm::apply().
Int casa::Applicator::findFreeProc | ( | Bool & | lastOne | ) | [private] |
Int casa::Applicator::get | ( | Array< Float > & | an | ) | [inline] |
Definition at line 146 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | Array< Double > & | an | ) | [inline] |
Definition at line 147 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | Array< Complex > & | an | ) | [inline] |
Definition at line 148 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | Array< DComplex > & | an | ) | [inline] |
Definition at line 149 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | Array< Int > & | an | ) | [inline] |
Definition at line 150 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | Float & | n | ) | [inline] |
Definition at line 151 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | Double & | n | ) | [inline] |
Definition at line 152 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | Complex & | n | ) | [inline] |
Definition at line 153 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | DComplex & | n | ) | [inline] |
Definition at line 154 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | Int & | n | ) | [inline] |
Definition at line 155 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | Bool & | b | ) | [inline] |
Definition at line 156 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | String & | s | ) | [inline] |
Definition at line 157 of file Applicator.h.
References comm, and casa::PTransport::get().
Int casa::Applicator::get | ( | Record & | r | ) | [inline] |
Definition at line 158 of file Applicator.h.
References comm, and casa::PTransport::get().
void casa::Applicator::init | ( | Int | argc, |
Char * | argv[] | ||
) |
Initialization (includes parallel transport initialization)
void casa::Applicator::initThreads | ( | Int | argc, |
Char * | argv[] | ||
) |
void casa::Applicator::initThreads | ( | ) |
Status functions to indicate whether this Applicator is executing as a controller or worker process.
Bool casa::Applicator::isSerial | ( | ) | [inline] |
void casa::Applicator::loop | ( | ) | [private] |
Executed by worker process waiting for an assigned task.
Bool casa::Applicator::nextAvailProcess | ( | Algorithm & | a, |
Int & | rank | ||
) |
Assign the next free worker process to a specified Algorithm.
Int casa::Applicator::nextProcessDone | ( | Algorithm & | a, |
Bool & | allDone | ||
) |
Return the rank of the next process to complete the specified Algorithm.
Int casa::Applicator::numProcs | ( | ) | [inline] |
Int casa::Applicator::put | ( | const Array< Float > & | an | ) | [inline] |
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 Array< Double > & | an | ) | [inline] |
Definition at line 133 of file Applicator.h.
References comm, and casa::PTransport::put().
Int casa::Applicator::put | ( | const Array< Int > & | an | ) | [inline] |
Definition at line 134 of file Applicator.h.
References comm, and casa::PTransport::put().
Int casa::Applicator::put | ( | const Array< Complex > & | an | ) | [inline] |
Definition at line 135 of file Applicator.h.
References comm, and casa::PTransport::put().
Int casa::Applicator::put | ( | const Array< DComplex > & | an | ) | [inline] |
Definition at line 136 of file Applicator.h.
References comm, and casa::PTransport::put().
Int casa::Applicator::put | ( | const Float & | n | ) | [inline] |
Definition at line 137 of file Applicator.h.
References comm, and casa::PTransport::put().
Int casa::Applicator::put | ( | const Complex & | n | ) | [inline] |
Definition at line 138 of file Applicator.h.
References comm, and casa::PTransport::put().
Int casa::Applicator::put | ( | const DComplex & | n | ) | [inline] |
Definition at line 139 of file Applicator.h.
References comm, and casa::PTransport::put().
Int casa::Applicator::put | ( | const Double & | n | ) | [inline] |
Definition at line 140 of file Applicator.h.
References comm, and casa::PTransport::put().
Int casa::Applicator::put | ( | const Int & | n | ) | [inline] |
Definition at line 141 of file Applicator.h.
References comm, and casa::PTransport::put().
Int casa::Applicator::put | ( | const Bool & | b | ) | [inline] |
Definition at line 142 of file Applicator.h.
References comm, and casa::PTransport::put().
Int casa::Applicator::put | ( | const String & | s | ) | [inline] |
Definition at line 143 of file Applicator.h.
References comm, and casa::PTransport::put().
Int casa::Applicator::put | ( | const Record & | r | ) | [inline] |
Definition at line 144 of file Applicator.h.
References comm, and casa::PTransport::put().
void casa::Applicator::setupProcStatus | ( | ) | [private] |
Utility functions for the current list of processes, and their status.
OrderedMap<String, Int> casa::Applicator::algorithmIds [private] |
PTransport* casa::Applicator::comm [private] |
Pointer to the parallel transport.
Definition at line 158 of file Applicator.h.
OrderedMap<Int, Algorithm*> casa::Applicator::knownAlgorithms [private] |
Definition at line 166 of file Applicator.h.
Int casa::Applicator::LastID [private] |
ID for the last Algorithm defined.
Definition at line 169 of file Applicator.h.
Int casa::Applicator::nProcs [private] |
Vector<Int> casa::Applicator::procStatus [private] |
Process status list.
Definition at line 181 of file Applicator.h.
Bool casa::Applicator::serial [private] |
Bool casa::Applicator::usedAllThreads [private] |
True if no more processes are free.
Definition at line 172 of file Applicator.h.