WARPXM v1.10.0
|
Class for handling unstructured arrays. More...
#include <wmunstructuredarray.h>
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_t & | patch_array (const int component_index, const int patch_index)=0 |
Aquire a patch array for a specified component. | |
virtual const wxm::array::patch_array_t & | patch_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 WmSolverBase & | getParent () 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. | |
WxIoBase & | getIo () |
Return reference to I/O object. | |
const WxIoBase & | getIo () const |
Return constant reference to I/O object. | |
WxMsgBase & | getMsg () |
Return reference to msg object. | |
const WxMsgBase & | getMsg () 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_t > | rsyncMap_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 |
SwapImpl * | p_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. | |
|
protected |
|
protected |
|
protected |
|
protected |
WmUnstructuredArray::WmUnstructuredArray | ( | const WmConstOpaquePtr & | parentPointer | ) |
Create a new parallel array object but does not do any allocations or set dimensions.
WmUnstructuredArray::~WmUnstructuredArray | ( | ) |
Destroy the WmDistributedArrays, including the member global arrays.
|
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.
Reimplemented from WmVariable.
|
virtual |
Get the array storage starting address without type specifics.
component | array to return |
|
virtual |
Get the read-only array storage starting address without type specifics.
component | array to return |
|
virtual |
Get the array storage at patch starting address without type specifics.
component | array to return |
|
virtual |
Get the read-only array at patch storage starting address without type specifics.
component | array to return |
void WmUnstructuredArray::downloadInternalElementsFromBuffers | ( | ) |
Downloads internal element data from OpenCL buffer to global array.
|
virtual |
Write out the array to file.
io | I/O object to use for writing |
grpNode | group node to write to |
Reimplemented from WmVariable.
|
virtual |
|
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.
fillMap | of variable component names and fill values to apply. |
Reimplemented from WmVariable.
|
virtual |
Returns the element type stored by the component matching the name supplied.
componentIndex | component index to be checked |
Reimplemented from WmVariable.
|
inline |
Returns number of ghost cells.
dim | dimension for which to return number of ghost cells |
|
inline |
Returns a patch array for a given component index and patch index.
|
inline |
Returns a list of subdomain names on which the variable exists.
bool WmUnstructuredArray::is_alloc | ( | ) | const |
Has array allocated any data?
|
virtual |
Load object from file.
This method is passed a group node from which its data should be read and then constructed.
io | I/O object to use for writing |
grpNode | group node to read from |
Reimplemented from WmVariable.
|
virtual |
Returns the minimum value in global array.
Reimplemented from WmVariable.
bool WmUnstructuredArray::onSubdomain | ( | const std::string & | subdomainName | ) | const |
Query if variable exists on subdomain.
|
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.
|
protected |
Synchornizes the arrays for ghost sharing.
|
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.
|
virtual |
This is a registered sync call - non blocking.
Must call 'sync_wait' to wait for sync to finish
key | Key of registered sync |
Reimplemented from WmDistributedVariable.
|
virtual |
This is a registered sync call register.
This function will register a sync operator to a particular key
key | Key to register sync to |
Reimplemented from WmDistributedVariable.
|
virtual |
This is a registered sync wait call.
Function will return when sync for 'key' is complete
This is where the actually update happens
key | Key of registered sync |
Reimplemented from WmDistributedVariable.
|
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
|
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
void WmUnstructuredArray::uploadInternalElementsToBuffers | ( | ) |
Uploads internal element data in global array to OpenCL buffer.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |