WARPXM v1.10.0
Loading...
Searching...
No Matches
WmUnstructuredArray Class Reference

Class for handling unstructured arrays. More...

#include <wmunstructuredarray.h>

Inheritance diagram for WmUnstructuredArray:
WmDistributedVariable WmVariable WxObject

Detailed Description

Class for handling unstructured arrays.

Classes

struct  SwapImpl
 
struct  syncRegistry_t
 

Public Member Functions

 WmUnstructuredArray (const WmConstOpaquePtr &parentPointer)
 Create a new parallel array object but does not do any allocations or set dimensions.
 
 ~WmUnstructuredArray ()
 Destroy the WmDistributedArrays, including the member global arrays.
 
virtual void setup (const WxCryptSet &wxc)
 Setup an array from input file block.
 
virtual WmTypeOpaqueArray< _WX_ROW_MAJOR_ORDER > & accessLocalArray (const unsigned int component, const std::string &subdomainName)
 Get the array storage starting address without type specifics.
 
virtual const WmTypeOpaqueArray< _WX_ROW_MAJOR_ORDER > & accessLocalArrayReadOnly (const unsigned int component, const std::string &subdomainName) const
 Get the read-only array storage starting address without type specifics.
 
virtual WmTypeOpaqueArray< _WX_ROW_MAJOR_ORDER > & accessPatchArray (const unsigned int component, int patchIndex)
 Get the array storage at patch starting address without type specifics.
 
virtual const WmTypeOpaqueArray< _WX_ROW_MAJOR_ORDER > & accessPatchArrayReadOnly (const unsigned int component, int patchIndex) const
 Get the read-only array at patch storage starting address without type specifics.
 
unsigned getNumGhostCells ()
 Returns number of ghost cells.
 
virtual void updateGhosts_register (const int key)
 This is a registered sync call register.
 
virtual void updateGhosts_nb (const int key)
 This is a registered sync call - non blocking.
 
virtual void updateGhosts_wait (const int key)
 This is a registered sync wait call.
 
virtual void updatePatchGhosts (const int patchIndex)
 Update values in the extended regions from neighbor processes.
 
virtual void updateGhosts ()
 Update values in the extended regions from neighbor processes.
 
virtual void updateGhostsComponents ()
 Update values in the extended regions from neighbor processes.
 
virtual void fill (const std::vector< WxAny > &fillVector)
 For each component, apply a fill value to all elements of the global array.
 
virtual void fill (const std::map< std::string, WxAny > &fillMap)
 
bool is_alloc () const
 Has array allocated any data?
 
virtual const std::type_info & getElementTypeForComponent (unsigned int componentIndex) const
 Returns the element type stored by the component matching the name supplied.
 
virtual void dump (WxIoBase &io, WxIoNodeType &grpNode) const
 Write out the array to file.
 
virtual void load (WxIoBase &io, const WxIoNodeType &grpNode)
 Load object from file.
 
const WxAny min (const int componentIndex) const
 Returns the minimum value in global array.
 
const WxAny absoluteMin (const int componentIndex) const
 Returns the absolute minimum value in global array Absolute min is the closest value to zero Value will be negative if any negative values were found.
 
void uploadInternalElementsToBuffers ()
 Uploads internal element data in global array to OpenCL buffer.
 
void downloadInternalElementsFromBuffers ()
 Downloads internal element data from OpenCL buffer to global array.
 
const std::vector< std::string > & getSubdomainNames () const
 Returns a list of subdomain names on which the variable exists.
 
bool onSubdomain (const std::string &subdomainName) const
 Query if variable exists on subdomain.
 
template<typename T >
const WmUnstructuredPatchArray< T > & getPatchArray (const int componentIndex, const int patchIndex) const
 Returns a patch array for a given component index and patch index.
 
- Public Member Functions inherited from WmDistributedVariable
virtual void setup (const WxCryptSet &wxc)
 Setup the distributed variable.
 
virtual void updateGhosts ()
 Update values in the extended regions from neighbor processes.
 
virtual void updateGhosts_register (const int key)
 This is a registered sync call register.
 
virtual void updateGhosts_nb (const int key)
 This is a registered sync call - non blocking.
 
virtual void updateGhosts_wait (const int key)
 This is a registered sync wait call.
 
const std::vector< std::string > & subdomain_names () const
 Get a list of subdomains on which this distributed variable exists.
 
bool on_subdomain (const std::string &subdomain_name) const
 Check if this distributed variable exists on a given subdomain.
 
virtual wxm::array::patch_array_tpatch_array (const int component_index, const int patch_index)=0
 Aquire a patch array for a specified component.
 
virtual const wxm::array::patch_array_tpatch_array (const int component_index, const int patch_index) const =0
 Aquire a patch array for a specified component.
 
- Public Member Functions inherited from WmVariable
virtual ~WmVariable ()
 Destroy object.
 
virtual void setup (const WxCryptSet &wxc)
 Setup object using supplied crypset.
 
virtual void copy (const WmVariable &var)
 Set the variable from supplied one.
 
virtual void fill (const std::vector< WxAny > &fillValues)
 For each component, apply a fill value throughout the domain.
 
virtual void swap (WmVariable &otherVar)
 Swap the internal data storage of this variable with otherVar leaving the outer shell the same, given both have same size and properties.
 
virtual bool checkCompatible (const WmVariable &var) const
 Compares this variable to another supplied WmVariable and report if they are swap compatible.
 
virtual void dump (WxIoBase &io, WxIoNodeType &grpNode) const
 Dump object to file.
 
virtual void load (WxIoBase &io, const WxIoNodeType &grpNode)
 Load object from file.
 
bool hasComponent (const std::string &componentName) const
 Check if this variable has a component matching the name supplied.
 
virtual const std::type_info & getElementTypeForComponent (unsigned int index) const
 Returns a type_info reference for the most primative element type stored by the variable.
 
virtual const std::type_info & getElementType () const
 Returns a type_info reference for the most primative element type stored by the variable.
 
unsigned int getNumComponents () const
 Returns number of components represented in the variable.
 
std::vector< std::string > getComponentNames () const
 Get names of all components (alphabetical order)
 
variableComponent_t getIndexForComponent (const std::string &componentName) const
 Returns the component number associated with the componentName.
 
const std::string & getComponentName (const variableComponent_t index) const
 Returns the component name for a given index.
 
virtual const WxAny min (const int componentIndex) const
 Returns the minimum value for the component identified.
 
virtual const WxAny absoluteMin (const int componentIndex) const
 Returns the absolute minimum value for the component identified Absolute min is the closest value to zero Value will be negative if any negative values were found.
 
const WmSolverBasegetParent () const
 Get the parent solver.
 
- Public Member Functions inherited from WxObject
virtual ~WxObject ()
 Dtor: destroy object.
 
void setIo (WxIoBase &io)
 Set the I/O pointer for use in object.
 
void setMsg (WxMsgBase &msg)
 Set the msg pointer for use in object.
 
WxIoBasegetIo ()
 Return reference to I/O object.
 
const WxIoBasegetIo () const
 Return constant reference to I/O object.
 
WxMsgBasegetMsg ()
 Return reference to msg object.
 
const WxMsgBasegetMsg () const
 Return const reference to msg object.
 
virtual void setup (const WxCryptSet &wxc)
 Setup object using supplied crypset.
 
virtual void init ()
 Initialize the object.
 
virtual void finishBuild ()
 Finish building the object.
 
virtual void load (WxIoBase &io, const WxIoNodeType &grpNode)
 Load object from file.
 
virtual void dump (WxIoBase &io, WxIoNodeType &grpNode) const
 Dump object to file.
 
virtual std::string name () const
 Get name of object.
 
void setName (const std::string &nm)
 Set object's name.
 

Protected Types

typedef std::vector< localTransfer_t * > localTransferList_t
 
typedef std::map< int, sendRemoteTransfer_t * > sendMap_t
 
typedef std::map< int, recvRemoteTransfer_t * > recvMap_t
 
typedef std::map< int, syncRegistry_trsyncMap_t
 
- Protected Types inherited from WmVariable
typedef WmNameTree< variableComponent_t >::const_iterator component_const_iterator_t
 

Protected Member Functions

void synchronizeArrays ()
 Synchornizes the arrays for ghost sharing.
 
- Protected Member Functions inherited from WmDistributedVariable
 WmDistributedVariable (const WmConstOpaquePtr &parent_solver)
 Forces the distributed variable to be a base class.
 
- Protected Member Functions inherited from WmVariable
 WmVariable (const WmConstOpaquePtr &parent_solver)
 Constructor sets up basic variable container, but no properties or specifics.
 
 WmVariable (const std::string &name, const std::vector< std::string > &orderedComponentNames)
 Constructor sets up basic variable container, and all properties otherwise set through setup() method in the no-argument form.
 
const std::type_info & getRealTypeID () const
 Get the type that real type aliases.
 
std::string getRealTypeStr () const
 Get the name for the type that real type aliases.
 
- Protected Member Functions inherited from WxObject
 WxObject ()
 Create object, that will be initialized subsequently.
 
 WxObject (const std::string &name)
 Create object with given name bypassing object setup phase Protected because there is no reason to have a WxObject directly, as it is meant to be a parent class.
 

Protected Attributes

std::vector< std::string > _onSubdomains
 
localTransferList_t _localTransfers
 
sendMap_t _sendTransfers
 
recvMap_t _recvTransfers
 
int _numPatchesSignedIn
 
std::vector< int > _localPatchIndexes
 
rsyncMap_t _rsync
 
- Protected Attributes inherited from WmDistributedVariable
std::vector< std::string > _subdomain_names
 List of subdomains on which this distributed variable exists.
 
std::vector< std::string > _virtual_names
 List of subdomains on which this distributed variable virtually exists.
 
- Protected Attributes inherited from WmVariable
WmNameTree< variableComponent_t_componentTree
 
unsigned _numComponents
 
std::vector< std::string > _orderedComponentNames
 
SwapImplp_impl
 

Additional Inherited Members

- Public Types inherited from WmVariable
typedef unsigned variableComponent_t
 variableComponent serves as a sort of pointer to individual components of the variable and is the value payload for nodes in the WmNameTree.
 

Member Typedef Documentation

◆ localTransferList_t

typedef std::vector<localTransfer_t*> WmUnstructuredArray::localTransferList_t
protected

◆ recvMap_t

typedef std::map<int, recvRemoteTransfer_t*> WmUnstructuredArray::recvMap_t
protected

◆ rsyncMap_t

typedef std::map<int, syncRegistry_t> WmUnstructuredArray::rsyncMap_t
protected

◆ sendMap_t

typedef std::map<int, sendRemoteTransfer_t*> WmUnstructuredArray::sendMap_t
protected

Constructor & Destructor Documentation

◆ WmUnstructuredArray()

WmUnstructuredArray::WmUnstructuredArray ( const WmConstOpaquePtr parentPointer)

Create a new parallel array object but does not do any allocations or set dimensions.

◆ ~WmUnstructuredArray()

WmUnstructuredArray::~WmUnstructuredArray ( )

Destroy the WmDistributedArrays, including the member global arrays.

Member Function Documentation

◆ absoluteMin()

const WxAny WmUnstructuredArray::absoluteMin ( const int  componentIndex) const
virtual

Returns the absolute minimum value in global array Absolute min is the closest value to zero Value will be negative if any negative values were found.

Returns
Absolute minimum value of component with array

Reimplemented from WmVariable.

◆ accessLocalArray()

virtual WmTypeOpaqueArray< _WX_ROW_MAJOR_ORDER > & WmUnstructuredArray::accessLocalArray ( const unsigned int  component,
const std::string &  subdomainName 
)
virtual

Get the array storage starting address without type specifics.

Parameters
componentarray to return
Returns
address of component array start

◆ accessLocalArrayReadOnly()

virtual const WmTypeOpaqueArray< _WX_ROW_MAJOR_ORDER > & WmUnstructuredArray::accessLocalArrayReadOnly ( const unsigned int  component,
const std::string &  subdomainName 
) const
virtual

Get the read-only array storage starting address without type specifics.

Parameters
componentarray to return
Returns
address of component array start

◆ accessPatchArray()

virtual WmTypeOpaqueArray< _WX_ROW_MAJOR_ORDER > & WmUnstructuredArray::accessPatchArray ( const unsigned int  component,
int  patchIndex 
)
virtual

Get the array storage at patch starting address without type specifics.

Parameters
componentarray to return
Returns
address of component array start

◆ accessPatchArrayReadOnly()

virtual const WmTypeOpaqueArray< _WX_ROW_MAJOR_ORDER > & WmUnstructuredArray::accessPatchArrayReadOnly ( const unsigned int  component,
int  patchIndex 
) const
virtual

Get the read-only array at patch storage starting address without type specifics.

Parameters
componentarray to return
Returns
address of component array start

◆ downloadInternalElementsFromBuffers()

void WmUnstructuredArray::downloadInternalElementsFromBuffers ( )

Downloads internal element data from OpenCL buffer to global array.

◆ dump()

virtual void WmUnstructuredArray::dump ( WxIoBase io,
WxIoNodeType grpNode 
) const
virtual

Write out the array to file.

Parameters
ioI/O object to use for writing
grpNodegroup node to write to

Reimplemented from WmVariable.

◆ fill() [1/2]

virtual void WmUnstructuredArray::fill ( const std::map< std::string, WxAny > &  fillMap)
virtual

◆ fill() [2/2]

virtual void WmUnstructuredArray::fill ( const std::vector< WxAny > &  fillVector)
virtual

For each component, apply a fill value to all elements of the global array.

This is a collective call. All processes that own parts of this array must make this call.

Parameters
fillMapof variable component names and fill values to apply.

Reimplemented from WmVariable.

◆ getElementTypeForComponent()

virtual const std::type_info & WmUnstructuredArray::getElementTypeForComponent ( unsigned int  componentIndex) const
virtual

Returns the element type stored by the component matching the name supplied.

Parameters
componentIndexcomponent index to be checked
Returns
Element type for this component. Throws exception if component not found

Reimplemented from WmVariable.

◆ getNumGhostCells()

unsigned WmUnstructuredArray::getNumGhostCells ( )
inline

Returns number of ghost cells.

Parameters
dimdimension for which to return number of ghost cells

◆ getPatchArray()

template<typename T >
const WmUnstructuredPatchArray< T > & WmUnstructuredArray::getPatchArray ( const int  componentIndex,
const int  patchIndex 
) const
inline

Returns a patch array for a given component index and patch index.

Returns
Patch array

◆ getSubdomainNames()

const std::vector< std::string > & WmUnstructuredArray::getSubdomainNames ( ) const
inline

Returns a list of subdomain names on which the variable exists.

Returns
vector of subdomain names

◆ is_alloc()

bool WmUnstructuredArray::is_alloc ( ) const

Has array allocated any data?

Returns
true if array owns allocated data

◆ load()

virtual void WmUnstructuredArray::load ( WxIoBase io,
const WxIoNodeType grpNode 
)
virtual

Load object from file.

This method is passed a group node from which its data should be read and then constructed.

Parameters
ioI/O object to use for writing
grpNodegroup node to read from

Reimplemented from WmVariable.

◆ min()

const WxAny WmUnstructuredArray::min ( const int  componentIndex) const
virtual

Returns the minimum value in global array.

Returns
Minimum value of component with array

Reimplemented from WmVariable.

◆ onSubdomain()

bool WmUnstructuredArray::onSubdomain ( const std::string &  subdomainName) const

Query if variable exists on subdomain.

Returns
True if variable exists on subdomain

◆ setup()

virtual void WmUnstructuredArray::setup ( const WxCryptSet wxc)
virtual

Setup an array from input file block.

This leads to establishing associated domain, array dimensions, and memory allocation.

This is a collective call. All processes that own parts of this array must make this call.

Reimplemented from WmDistributedVariable.

◆ synchronizeArrays()

void WmUnstructuredArray::synchronizeArrays ( )
protected

Synchornizes the arrays for ghost sharing.

◆ updateGhosts()

virtual void WmUnstructuredArray::updateGhosts ( )
virtual

Update values in the extended regions from neighbor processes.

This involves communication of data across process boundaries.

This is a collective call. All processes that own parts of this array must make this call.

Reimplemented from WmDistributedVariable.

◆ updateGhosts_nb()

virtual void WmUnstructuredArray::updateGhosts_nb ( const int  key)
virtual

This is a registered sync call - non blocking.

Must call 'sync_wait' to wait for sync to finish

Parameters
keyKey of registered sync

Reimplemented from WmDistributedVariable.

◆ updateGhosts_register()

virtual void WmUnstructuredArray::updateGhosts_register ( const int  key)
virtual

This is a registered sync call register.

This function will register a sync operator to a particular key

Parameters
keyKey to register sync to

Reimplemented from WmDistributedVariable.

◆ updateGhosts_wait()

virtual void WmUnstructuredArray::updateGhosts_wait ( const int  key)
virtual

This is a registered sync wait call.

Function will return when sync for 'key' is complete

This is where the actually update happens

Parameters
keyKey of registered sync

Reimplemented from WmDistributedVariable.

◆ updateGhostsComponents()

virtual void WmUnstructuredArray::updateGhostsComponents ( )
inlinevirtual

Update values in the extended regions from neighbor processes.

This involves communication of data across process boundaries.

This is a collective call. All processes that own parts of this array must make this call.

Not implemented for unstructured arrays

◆ updatePatchGhosts()

virtual void WmUnstructuredArray::updatePatchGhosts ( const int  patchIndex)
virtual

Update values in the extended regions from neighbor processes.

This involves communication of data across process boundaries. This form is designed to be called collectively between WmPatchedProcessingObject's.

This is a collective call. All processes that own a part of the unstructured array must make this call.

FOR THE LOVE OF GOD BE CAREFULL WITH THIS CALL - IT IS PATCH BASED, ONCE ALL PATCHES ARE CALLED, THEN IT WILL SYNC Using this call will almost certainly result in a race condition

◆ uploadInternalElementsToBuffers()

void WmUnstructuredArray::uploadInternalElementsToBuffers ( )

Uploads internal element data in global array to OpenCL buffer.

Member Data Documentation

◆ _localPatchIndexes

std::vector<int> WmUnstructuredArray::_localPatchIndexes
protected

◆ _localTransfers

localTransferList_t WmUnstructuredArray::_localTransfers
protected

◆ _numPatchesSignedIn

int WmUnstructuredArray::_numPatchesSignedIn
protected

◆ _onSubdomains

std::vector<std::string> WmUnstructuredArray::_onSubdomains
protected

◆ _recvTransfers

recvMap_t WmUnstructuredArray::_recvTransfers
protected

◆ _rsync

rsyncMap_t WmUnstructuredArray::_rsync
protected

◆ _sendTransfers

sendMap_t WmUnstructuredArray::_sendTransfers
protected

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