Accelerated Computation Engine
Public Member Functions | Protected Member Functions | List of all members
Ace::Analytic::MPISlave Class Reference

#include <ace_analytic_mpislave.h>

Inheritance diagram for Ace::Analytic::MPISlave:
Ace::Analytic::AbstractMPI Ace::Analytic::AbstractInput Ace::Analytic::AbstractManager

Public Member Functions

virtual bool isFinished () const override final
 
 MPISlave (quint16 type)
 
virtual ~MPISlave () override final
 
- Public Member Functions inherited from Ace::Analytic::AbstractManager
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)
 
- Public Member Functions inherited from Ace::Analytic::AbstractInput
 AbstractInput ()=default
 
 ~AbstractInput ()
 

Protected Member Functions

virtual void mpiStart (Type type, int platform, int device) override final
 
virtual QFile * addOutputFile (const QString &path) override final
 
virtual Ace::DataObjectaddOutputData (const QString &path, quint16 type, const EMetadata &system) override final
 
virtual void saveResult (std::unique_ptr< EAbstractAnalytic::Block > &&result) override final
 
- Protected Member Functions inherited from Ace::Analytic::AbstractMPI
 AbstractMPI (quint16 type)
 
- Protected Member Functions inherited from Ace::Analytic::AbstractManager
 AbstractManager (quint16 type)
 
std::unique_ptr< EAbstractAnalytic::BlockmakeWork (int index)
 
void writeResult (std::unique_ptr< EAbstractAnalytic::Block > &&result, int expectedIndex)
 
EAbstractAnalyticanalytic ()
 
const EAbstractAnalyticanalytic () const
 
- Protected Member Functions inherited from Ace::Analytic::AbstractInput
virtual int index () const
 
virtual void writeResult (std::unique_ptr< EAbstractAnalytic::Block > &&result)
 

Additional Inherited Members

- Public Types inherited from Ace::Analytic::AbstractMPI
enum  Type { Serial, OpenCL }
 
- Public Slots inherited from Ace::Analytic::AbstractManager
void initialize ()
 
void terminationRequested ()
 
void finish ()
 
- Signals inherited from Ace::Analytic::AbstractManager
void progressed (int percentComplete)
 
void done ()
 
void finished ()
 
- Static Public Member Functions inherited from Ace::Analytic::AbstractManager
static std::unique_ptr< Ace::Analytic::AbstractManagermakeManager (quint16 type, int index, int size)
 
- Protected Types inherited from Ace::Analytic::AbstractMPI
enum  Code { Terminate = -1, ReadyAsSerial = -2, ReadyAsOpenCL = -3 }
 
- Protected Slots inherited from Ace::Analytic::AbstractMPI
virtual void start () override final
 
- Protected Slots inherited from Ace::Analytic::AbstractManager
virtual void start ()
 

Detailed Description

This is the MPI slave manager. This manager is used for an MPI run with any node that is not rank 0 and by definition a slave node. The sole function of this class is to process work blocks given to it by the master node and return the corresponding result blocks until a termination code is received. This class also sends a special code to the master node to signal when it is ready to start processing work blocks and if it is serial or accelerated. This special signal to the master node is not sent until it is given the resource type it will use by having the interface mpi start called from its inherited abstract class.

Constructor & Destructor Documentation

◆ MPISlave()

MPISlave::MPISlave ( quint16  type)
explicit

Constructs a new MPI slave manager with the given analytic type.

Parameters
typeThe analytic type this manager will use.

◆ ~MPISlave()

MPISlave::~MPISlave ( )
finaloverridevirtual

Properly shuts down the MPI system.

Member Function Documentation

◆ addOutputData()

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

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. This implementation does nothing and returns a null pointer because it is a slave node and does not handle output.

Parameters
pathUnused path to data object file.
typeUnused data object type.
systemUnused system metadata for new data objects.
Returns
A null pointer.

Reimplemented from Ace::Analytic::AbstractManager.

◆ addOutputFile()

QFile * MPISlave::addOutputFile ( const QString &  path)
finaloverrideprotectedvirtual

Implements the interface that opens a new file set to write only and truncate with the given path. This implementation does nothing and returns a null pointer because it is a slave node and does not handle output.

Parameters
pathUnused path to file.
Returns
A null pointer.

Reimplemented from Ace::Analytic::AbstractManager.

◆ isFinished()

bool MPISlave::isFinished ( ) const
finaloverridevirtual

Implements the interface that tests if this abstract input is finished and received all result blocks for its analytic. This implementation is special because this is a slave node and is finished once it has received the termination signal and no longer has any blocks it is working on.

Returns
True if this abstract input is finished or false otherwise.

Implements Ace::Analytic::AbstractInput.

◆ mpiStart()

void MPISlave::mpiStart ( Type  type,
int  platform,
int  device 
)
finaloverrideprotectedvirtual

Implements the interface that is called to start this MPI manager as a slave node with the given resource type and optional platform and device index.

Parameters
typeThe resource type this slave node will use for block processing.
platformThe optional platform index this slave node will use if its resource type is OpenCL.
deviceThe optional device index this slave node will use if its resource type is OpenCL.

Reimplemented from Ace::Analytic::AbstractMPI.

◆ saveResult()

void MPISlave::saveResult ( std::unique_ptr< EAbstractAnalytic::Block > &&  result)
finaloverrideprotectedvirtual

Implements the interface that saves the given result block to its underlying analytic and assumes the order of indexes given is not sorted and random. This implementation simply sends the given result block back to the master node.

Parameters
resultThe result block that is sent to the master node for saving.

Reimplemented from Ace::Analytic::AbstractInput.


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