Accelerated Computation Engine
|
#include <ace_analytic_abstractmanager.h>
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::AbstractManager > | makeManager (quint16 type, int index, int size) |
Protected Slots | |
virtual void | start () |
Protected Member Functions | |
virtual QFile * | addOutputFile (const QString &path) |
virtual Ace::DataObject * | addOutputData (const QString &path, quint16 type, const EMetadata &system) |
AbstractManager (quint16 type) | |
std::unique_ptr< EAbstractAnalytic::Block > | makeWork (int index) |
void | writeResult (std::unique_ptr< EAbstractAnalytic::Block > &&result, int expectedIndex) |
EAbstractAnalytic * | analytic () |
const EAbstractAnalytic * | analytic () const |
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.
|
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.
type | Analytic type that is used for this manager's analytic run. |
|
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.
path | Path to the output data object that is opened. |
type | Data type the new data object file is initialized to. |
system | The system metadata for the new data object. |
Reimplemented in Ace::Analytic::MPISlave, and Ace::Analytic::Chunk.
|
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.
path | Path to the output file that is opened. |
Reimplemented in Ace::Analytic::MPISlave, and Ace::Analytic::Chunk.
|
protected |
Returns a pointer to the abstract analytic for this manager.
|
protected |
Returns a read only pointer to the abstract analytic for this manager.
quint16 AbstractManager::analyticType | ( | ) | const |
Returns the analytic type this analytic manager contains.
QList< QString > AbstractManager::commandLineArguments | ( | ) | const |
Returns a list of all command line arguments this manager's analytic provides as input arguments.
QVariant AbstractManager::data | ( | int | index, |
EAbstractAnalytic::Input::Role | role | ||
) | const |
Returns data about an analytic argument with the given role and index.
index | Argument index whose data is returned with the given role. |
role | Role of the data that is returned with the given index. |
|
signal |
Signals the analytic is done.
|
slot |
Called to Complete this manager's analytic run, signaling completion and requesting deletion.
|
signal |
Signals the analytic and this manager has completely finished execution and is ready to be destroyed.
|
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.
|
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.
type | The analytic type that is instantiated for this manager's run. |
index | The 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. |
size | The 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. |
|
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.
index |
|
signal |
Signals the running analytic has made progress to the given percentage.
percentComplete | The percent complete out of 100 for this analytic. |
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.
index | Argument index whose value is set to the given value. |
value | Value that the argument with the given index is set to. |
int AbstractManager::size | ( | ) | const |
Returns the number of arguments this manager's analytic has for user input.
|
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.
|
slot |
Called to request this manager terminate its analytic run before completion.
EAbstractAnalytic::Input::Type AbstractManager::type | ( | int | index | ) | const |
Returns the argument type for the given argument index of this manager's analytic.
index | Argument index whose type is returned. |
|
protected |
Processes the given result block with this manager's analytic. This also does error checking and determines the progress of this analytic run.
result | The result block that is processed by this manager's analytic. |
expectedIndex | The expected index that should be equal to the given result block's index. |