Accelerated Computation Engine
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | List of all members
Ace::Analytic::AbstractManager Class Reference

#include <ace_analytic_abstractmanager.h>

Inheritance diagram for Ace::Analytic::AbstractManager:
Ace::Analytic::AbstractMPI Ace::Analytic::Chunk Ace::Analytic::Merge Ace::Analytic::Single Ace::Analytic::MPIMaster Ace::Analytic::MPISlave

Public Slots

void initialize ()
 
void terminationRequested ()
 
void finish ()
 

Signals

void progressed (int percentComplete)
 
void done ()
 
void finished ()
 

Public Member Functions

quint16 analyticType () const
 
int size () const
 
EAbstractAnalytic::Input::Type type (int index) const
 
QVariant data (int index, EAbstractAnalytic::Input::Role role) const
 
QList< QString > commandLineArguments () const
 
void set (int index, const QVariant &value)
 

Static Public Member Functions

static std::unique_ptr< Ace::Analytic::AbstractManagermakeManager (quint16 type, int index, int size)
 

Protected Slots

virtual void start ()
 

Protected Member Functions

virtual QFile * addOutputFile (const QString &path)
 
virtual Ace::DataObjectaddOutputData (const QString &path, quint16 type, const EMetadata &system)
 
 AbstractManager (quint16 type)
 
std::unique_ptr< EAbstractAnalytic::BlockmakeWork (int index)
 
void writeResult (std::unique_ptr< EAbstractAnalytic::Block > &&result, int expectedIndex)
 
EAbstractAnalyticanalytic ()
 
const EAbstractAnalyticanalytic () const
 

Detailed Description

This represents a session manager for a single analytic run for a specific analytic type. This class provides methods for all input for a new analytic run and starts the process of running it, along with cleaning up all open files and data objects once the analytic has finished running. An implementation of this class is responsible for running the analytic once this class starts it and signaling when it is finished. This class creates the correct type of implementation class depending on the input given and status of things like MPI. This is the root analytic class that should be used to interface with the analytic run system outside of the core library.

Constructor & Destructor Documentation

◆ AbstractManager()

AbstractManager::AbstractManager ( quint16  type)
explicitprotected

Constructs a new manager object with the given analytic type. If the given type is out of range then an exception is thrown. This is protected because this class should never created without an implementation.

Parameters
typeAnalytic type that is used for this manager's analytic run.

Member Function Documentation

◆ addOutputData()

Ace::DataObject * AbstractManager::addOutputData ( const QString &  path,
quint16  type,
const EMetadata system 
)
protectedvirtual

This interface opens a new data object with the given path, erasing any data the file may have contained and returning a pointer to the new data object. The default implementation opens the data object unless the given path string is empty.

Parameters
pathPath to the output data object that is opened.
typeData type the new data object file is initialized to.
systemThe system metadata for the new data object.
Returns
Pointer to new data object with the given path or null if no path given.

Reimplemented in Ace::Analytic::MPISlave, and Ace::Analytic::Chunk.

◆ addOutputFile()

QFile * AbstractManager::addOutputFile ( const QString &  path)
protectedvirtual

This interface opens a new file set to write only and truncate with the given path. If the file fails to open then an exception is thrown. The default implementation opens the file unless the path is an empty string.

Parameters
pathPath to the output file that is opened.
Returns
Pointer to qt file device of opened file or null if no path given.

Reimplemented in Ace::Analytic::MPISlave, and Ace::Analytic::Chunk.

◆ analytic() [1/2]

EAbstractAnalytic * AbstractManager::analytic ( )
protected

Returns a pointer to the abstract analytic for this manager.

Returns
Pointer to this manager's abstract analytic.

◆ analytic() [2/2]

const EAbstractAnalytic * AbstractManager::analytic ( ) const
protected

Returns a read only pointer to the abstract analytic for this manager.

Returns
Read only pointer to this manager's abstract analytic.

◆ analyticType()

quint16 AbstractManager::analyticType ( ) const

Returns the analytic type this analytic manager contains.

Returns
Analytic type this analytic manager contains.

◆ commandLineArguments()

QList< QString > AbstractManager::commandLineArguments ( ) const

Returns a list of all command line arguments this manager's analytic provides as input arguments.

Returns
List of all command line arguments for this manager's analytic.

◆ data()

QVariant AbstractManager::data ( int  index,
EAbstractAnalytic::Input::Role  role 
) const

Returns data about an analytic argument with the given role and index.

Parameters
indexArgument index whose data is returned with the given role.
roleRole of the data that is returned with the given index.
Returns
Data with the given role and index.

◆ done

void Ace::Analytic::AbstractManager::done ( )
signal

Signals the analytic is done.

◆ finish

void AbstractManager::finish ( )
slot

Called to Complete this manager's analytic run, signaling completion and requesting deletion.

◆ finished

void Ace::Analytic::AbstractManager::finished ( )
signal

Signals the analytic and this manager has completely finished execution and is ready to be destroyed.

◆ initialize

void AbstractManager::initialize ( )
slot

Called to Finalize all input to this manager's analytic and calls the analytic object's initialize interface. This also emits a signal to call the start slot once the event loop is started.

◆ makeManager()

std::unique_ptr< Ace::Analytic::AbstractManager > AbstractManager::makeManager ( quint16  type,
int  index,
int  size 
)
static

Makes a new manager with the correct implementation class and given analytic type, returning a pointer to the new manager. The index and size parameters are for chunk/merge runs. If this is not a chunk/merge run the index is 0 and size is 1. If this is a merge run the index is -1.

Parameters
typeThe analytic type that is instantiated for this manager's run.
indexThe chunk index for this process. Unless this is a chunk or merge run this is always 0. If this is a chunk run the index is the ID for this chunk process so it knows what work to do. An index of -1 means this is a merge run that takes all the chunk files to produce the finished output.
sizeThe chunk size of this process. Unless this is a chunk run this is always 1. If this is a chunk run this is the total number of chunk processes running the analytic process.
Returns
Pointer to the new manager object.

◆ makeWork()

std::unique_ptr< EAbstractAnalytic::Block > AbstractManager::makeWork ( int  index)
protected

Returns a new work block from this manager's analytic with the given index. This also does error checking on the new work block.

Parameters
index
Returns
Pointer to a new work block with the given index.

◆ progressed

void Ace::Analytic::AbstractManager::progressed ( int  percentComplete)
signal

Signals the running analytic has made progress to the given percentage.

Parameters
percentCompleteThe percent complete out of 100 for this analytic.

◆ set()

void AbstractManager::set ( int  index,
const QVariant &  value 
)

Sets the analytic argument to the given value with the given index. The value is not given to the underlying analytic until initialize is called. For file and data arguments the file path should be given as a string.

Parameters
indexArgument index whose value is set to the given value.
valueValue that the argument with the given index is set to.

◆ size()

int AbstractManager::size ( ) const

Returns the number of arguments this manager's analytic has for user input.

Returns
Number of analytic arguments for this manager.

◆ start

void AbstractManager::start ( )
protectedvirtualslot

This interface is called once to begin the analytic run for this manager after all argument input has been set. The default implementation does nothing.

◆ terminationRequested

void AbstractManager::terminationRequested ( )
slot

Called to request this manager terminate its analytic run before completion.

◆ type()

EAbstractAnalytic::Input::Type AbstractManager::type ( int  index) const

Returns the argument type for the given argument index of this manager's analytic.

Parameters
indexArgument index whose type is returned.
Returns
Argument type for the given index.

◆ writeResult()

void AbstractManager::writeResult ( std::unique_ptr< EAbstractAnalytic::Block > &&  result,
int  expectedIndex 
)
protected

Processes the given result block with this manager's analytic. This also does error checking and determines the progress of this analytic run.

Parameters
resultThe result block that is processed by this manager's analytic.
expectedIndexThe expected index that should be equal to the given result block's index.

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