Accelerated Computation Engine
Classes | Public Member Functions | Static Protected Member Functions | List of all members
EAbstractAnalytic Class Referenceabstract

#include <eabstractanalytic.h>

Inheritance diagram for EAbstractAnalytic:

Classes

class  Block
 
class  Input
 
class  OpenCL
 
class  Serial
 

Public Member Functions

virtual int size () const =0
 
virtual void process (const EAbstractAnalytic::Block *result)=0
 
virtual EAbstractAnalytic::InputmakeInput ()=0
 
virtual std::unique_ptr< EAbstractAnalytic::BlockmakeWork (int index) const
 
virtual std::unique_ptr< EAbstractAnalytic::BlockmakeWork () const
 
virtual std::unique_ptr< EAbstractAnalytic::BlockmakeResult () const
 
virtual EAbstractAnalytic::SerialmakeSerial ()
 
virtual EAbstractAnalytic::OpenCLmakeOpenCL ()
 
virtual void initialize ()
 
virtual void initializeOutputs ()
 
virtual void finish ()
 

Static Protected Member Functions

static bool isMaster ()
 

Detailed Description

This represents an analytic process for the ACE system. Because of the complexity of an analytic its tasks are divided into multiple sub classes. This class is responsible for making all other sub classes, making blocks of work, reading blocks of results, initialization, and finishing the analytic. An implementation of this class must do all of these things. The work of an analytic is designed to be split up into individual blocks of work. This class creates these blocks of work and then reads in the corresponding blocks containing the results of the work. To accommodate very simple analytic types an implementation of this class can choose to not produce work blocks which causes the process interface to be called with empty generic result blocks. A simple analytic only supports single process serial mode for operation and does not override the serial or OpenCL methods. Simple analytic types also do not need to implement any interfaces for making blocks since they are not used.

Member Function Documentation

◆ finish()

void EAbstractAnalytic::finish ( )
virtual

This interface is called to finish this analytic. This is called at the very end after every other interface call. The default implementation does nothing.

◆ initialize()

void EAbstractAnalytic::initialize ( )
virtual

This interface initializes this analytic. This is called only once before any other interface is called for this analytic. The default implementation does nothing.

◆ initializeOutputs()

void EAbstractAnalytic::initializeOutputs ( )
virtual

This interface initializes any outputs for this analytic. This is called only once before any other interface is called for this analytic. This is only called for analytic objects that will process output result blocks. The default implementation does nothing.

◆ isMaster()

bool EAbstractAnalytic::isMaster ( )
staticprotected

Tests if this is the master node in an MPI run. If this is not an MPI run then this will also return true.

Returns
True if this is the master node of an MPI run or this is not running in MPI mode, otherwise false is returned.

◆ makeInput()

virtual EAbstractAnalytic::Input* EAbstractAnalytic::makeInput ( )
pure virtual

This interface makes a new input object and returns its pointer. The returned input object must have this abstract analytic set as its parent.

Returns
Pointer to new input object.

◆ makeOpenCL()

EAbstractAnalytic::OpenCL * EAbstractAnalytic::makeOpenCL ( )
virtual

This interface makes a new OpenCL object and returns its pointer. If this analytic type does not support OpenCL then a null pointer is returned. The default implementation returns a null pointer.

Returns
Pointer to new OpenCL object or null if this analytic does not support OpenCL.

◆ makeResult()

std::unique_ptr< EAbstractAnalytic::Block > EAbstractAnalytic::makeResult ( ) const
virtual

This interface creates an empty and uninitialized result block. This is used by MPI and chunk runs for reading in work blocks from byte arrays. The default implementation throws an exception because this should never be called if it is not implemented by an analytic.

Returns
Pointer uninitialized result block.

◆ makeSerial()

EAbstractAnalytic::Serial * EAbstractAnalytic::makeSerial ( )
virtual

This interface makes a new serial object and returns its pointer. If this analytic type does not support serial then a null pointer is returned. The default implementation returns a null pointer.

Returns
Pointer to new serial object or null if no serial support.

◆ makeWork() [1/2]

std::unique_ptr< EAbstractAnalytic::Block > EAbstractAnalytic::makeWork ( int  index) const
virtual

This interface creates and returns a work block for this analytic with the given index. The default implementation throws an exception because this should never be called if it is not implemented by an analytic.

Parameters
indexIndex used to make the block of work.
Returns
Pointer new work block with the given index.

◆ makeWork() [2/2]

std::unique_ptr< EAbstractAnalytic::Block > EAbstractAnalytic::makeWork ( ) const
virtual

This interface creates an empty and uninitialized work block. This is used by MPI and chunk runs for reading in work blocks from byte arrays. The default implementation throws an exception because this should never be called if it is not implemented by an analytic.

Returns
Pointer uninitialized work block.

◆ process()

virtual void EAbstractAnalytic::process ( const EAbstractAnalytic::Block result)
pure virtual

This interface processes the given result block. The order of indexes called will always be in order starting at 0. If this analytic does not produce work blocks then the given block is a generic and empty block which only contains the index.

Parameters
resultPointer to result block that is processed.

◆ size()

virtual int EAbstractAnalytic::size ( ) const
pure virtual

This interface returns the total number of blocks this analytic must process as steps or blocks of work. If this analytic produces no work blocks then this means the number of times the process interface is called.

Returns
Total number of blocks or steps that this analytic must work on.

The documentation for this class was generated from the following files: