Applicator.h

Classes

Applicator -- Class which provides an interface to the parallelization infrastructure (full description)

class Applicator

Types

enum Status

FREE
ASSIGNED

enum Signals

STOP = 0

Interface

Public Members
Applicator()
~Applicator()
void init(Int argc, Char *argv[])
void initThreads(Int argc, Char *argv[])
void initThreads()
void defineAlgorithm(Algorithm *)
Bool isController()
Bool isWorker()
Bool isSerial()
Int numProcs()
Bool nextAvailProcess(Algorithm &a, Int &rank)
Int nextProcessDone(Algorithm &a, Bool &allDone)
void done()
void apply(Algorithm &a)
Int put(const Array<Float> &an)
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 Members
void loop()
void defineAlgorithms()
void setupProcStatus()
Int findFreeProc(Bool &lastOne)

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Applies or controls the execution of parallelized algorithms.

Synopsis

The Applicator class provides the interface to parallel communication. It holds the parallel transport layer, and controls the execution of parallelized algorithms.

Example

Motivation

To provide a simple programming interface to parallelization, and to encapsulate the transport layer and parallel process control.

Member Description

enum Status

Enum to define the process status table

enum Signals

Recognized signals

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)

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)