Advanced Multi-Physics (AMP)
On-Line Documentation
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator > Class Template Referencefinal

A class used to hold vector data. More...

#include <VectorDataDevice.h>

Inheritance diagram for AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >:
Inheritance graph
[legend]

Public Types

using idxAllocator_t = typename std::allocator_traits< Allocator >::template rebind_alloc< size_t >
 
using intAllocator_t = typename std::allocator_traits< Allocator >::template rebind_alloc< int >
 
using scalarAllocator_t = typename std::allocator_traits< Allocator >::template rebind_alloc< TYPE >
 
using ScalarAllocator_t = typename std::allocator_traits< Allocator >::template rebind_alloc< TYPE >
 
using sizetAllocator_t = typename std::allocator_traits< Allocator >::template rebind_alloc< size_t >
 
using value_type = TYPE
 

Public Member Functions

template<class TYPE >
void addGhostValuesByGlobalID (size_t num, const size_t *indices, const TYPE *vals)
 Add shared values using global identifier.
 
virtual void addGhostValuesByGlobalID (size_t num, const size_t *indices, const void *vals, const typeID &id)=0
 Add shared values using global identifier.
 
void addGhostValuesByGlobalID (size_t, const size_t *, const void *, const typeID &) override
 Add shared values using global identifier.
 
template<class TYPE >
void addValuesByGlobalID (size_t num, const size_t *indices, const TYPE *vals)
 Add owned or shared values using global identifier.
 
template<class TYPE >
void addValuesByLocalID (size_t num, const size_t *indices, const TYPE *vals)
 Add values to vector entities by their local offset.
 
void addValuesByLocalID (size_t num, const size_t *indices, const void *vals, const typeID &id) override
 Add values to vector entities by their local offset.
 
bool allGhostIndices (size_t N, const size_t *ndx) const override
 
virtual void assemble ()
 This method is used to implement the assemble interface of PETSc.
 
template<class TYPE = double>
VectorDataIterator< TYPE > begin ()
 Return an iterator to the beginning of the data.
 
template<class TYPE = double>
VectorDataIterator< const TYPE > begin () const
 Return an iterator to the beginning of the data.
 
std::shared_ptr< VectorDatacloneData (const std::string &name="") const override
 Clone the data.
 
template<class TYPE = double>
VectorDataIterator< const TYPE > constBegin () const
 Return an iterator to the beginning of the data.
 
template<class TYPE = double>
VectorDataIterator< const TYPE > constEnd () const
 Return an iterator to the end of the data.
 
bool containsGlobalElement (size_t) const override
 
void copyGhostValues (const VectorData &rhs) override
 Copy ghosted vlues to a vector.
 
void dataChanged () override
 Notify listeners that data has changed in this vector.
 
virtual void deregisterListener (DataChangeListener *listener)
 Deregister a listener with this DataChangeFirer.
 
void dumpGhostedData (std::ostream &out, size_t offset) const override
 Write data owned by other processors to an std::ostream.
 
virtual void dumpOwnedData (std::ostream &out, size_t GIDoffset=0, size_t LIDoffset=0) const
 Write owned data to an std::ostream.
 
template<class TYPE = double>
VectorDataIterator< TYPE > end ()
 Return an iterator to the end of the data.
 
template<class TYPE = double>
VectorDataIterator< const TYPE > end () const
 Return an iterator to the end of the data.
 
void fillGhosts (const Scalar &) override
 Zero all ghost data (does not modify consistent status)
 
virtual void fireDataChange ()
 Notify all listeners of a data change event.
 
template<class TYPE >
size_t getAllGhostValues (TYPE *vals) const
 Get all ghost values.
 
size_t getAllGhostValues (void *vals, const typeID &id) const override
 Get all ghost values in the vector.
 
const AMP_MPIgetComm () const override
 Get the communicator.
 
std::shared_ptr< CommunicationListgetCommunicationList () const override
 Get the CommunicationList for this Vector.
 
virtual std::shared_ptr< VectorDatagetComponent (size_t i=0)
 Number of elements in the ith component.
 
virtual std::shared_ptr< const VectorDatagetComponent (size_t i=0) const
 Number of elements in the ith component.
 
uint64_t getDataID () const override
 A unique id for the underlying data allocation.
 
template<class TYPE >
void getGhostAddValuesByGlobalID (size_t num, const size_t *indices, TYPE *vals) const
 get ghosted values to add to off-proc elements
 
virtual void getGhostAddValuesByGlobalID (size_t num, const size_t *indices, void *vals, const typeID &id) const=0
 get ghosted values to add to off-proc elements
 
void getGhostAddValuesByGlobalID (size_t, const size_t *, void *, const typeID &) const override
 get ghosted values to add to off-proc elements
 
size_t getGhostSize () const override
 Number of entries "owned" by other cores stored on this core.
 
template<class TYPE >
void getGhostValuesByGlobalID (size_t num, const size_t *indices, TYPE *vals) const
 Get ghost values in the vector by their global offset.
 
virtual void getGhostValuesByGlobalID (size_t num, const size_t *indices, void *vals, const typeID &id) const=0
 Get ghost values in the vector by their global offset.
 
void getGhostValuesByGlobalID (size_t, const size_t *, void *, const typeID &) const override
 Get ghost values in the vector by their global offset.
 
void getGhostValuesByGlobalIDUnsorted (size_t num, const size_t *indices, void *vals, const typeID &id) const
 
size_t getGlobalSize () const
 Number of total entries in this vector across all cores.
 
UpdateState getGlobalUpdateStatus () const
 Return the current update state of the Vector.
 
uint64_t getID () const
 Get a unique id hash for the vector.
 
size_t getLocalSize () const
 Number of elements "owned" by this core.
 
virtual std::vector< size_t > getLocalSizes () const
 The local sizes on each rank.
 
size_t getLocalStartID () const
 get local start id core.
 
UpdateState getLocalUpdateStatus () const override
 Return the current update state of the Vector.
 
AMP::Utilities::MemoryType getMemoryLocation () const override
 returns the memory location for data
 
virtual size_t getNumberOfComponents () const
 Return integer number of data components.
 
template<class TYPE >
void getRawData (TYPE *buf) const
 Copy data out of this vector.
 
void getRawData (void *buf, const typeID &id) const override
 Copy data out of this vector.
 
template<typename RETURN_TYPE >
RETURN_TYPE * getRawDataBlock (size_t i=0)
 Obtain a particular contiguous block of data cast to RETURN_TYPE.
 
template<typename RETURN_TYPE >
const RETURN_TYPE * getRawDataBlock (size_t i=0) const
 Obtain a particular contiguous block of data cast to RETURN_TYPE.
 
const void * getRawDataBlockAsVoid (size_t i) const override
 Return a pointer to a particular block of memory in the vector.
 
void * getRawDataBlockAsVoid (size_t i) override
 Return a pointer to a particular block of memory in the vector.
 
typeID getType (size_t block) const override
 Return the typeid of the given block.
 
std::shared_ptr< UpdateStategetUpdateStatusPtr () const override
 Return the current update state of this Vector.
 
template<class TYPE >
void getValuesByGlobalID (size_t num, const size_t *indices, TYPE *vals) const
 get values in the vector by their local offset
 
template<class TYPE >
void getValuesByLocalID (size_t num, const size_t *indices, TYPE *vals) const
 Get local values in the vector by their global offset.
 
void getValuesByLocalID (size_t num, const size_t *indices, void *vals, const typeID &id) const override
 Get values to vector entities by their local offset.
 
virtual bool hasContiguousData () const
 returns whether all data for the vector on a single process is contiguous
 
bool hasGhosts () const override
 Check if any entries "owned" by other cores are stored on this core.
 
virtual bool isAnAliasOf (const VectorData &rhs) const
 Check if the two VectorData objects are alias of each other.
 
template<typename TYPE >
bool isBlockType (size_t i=0) const
 Check if the data is of the given type.
 
template<typename TYPE >
bool isType () const
 Check if the data is of the given type.
 
bool isType (const typeID &id, size_t block) const
 Is the data of the given type.
 
virtual void makeConsistent ()
 Update shared values on entire communicator.
 
void makeConsistent (ScatterType t) override
 Update shared values on entire communicator.
 
virtual void makeConsistent (ScatterType t)=0
 Update shared values on entire communicator.
 
size_t numberOfDataBlocks () const override
 Number of blocks of contiguous data in the Vector.
 
TYPE & operator[] (size_t i)
 Access the raw element.
 
const TYPE & operator[] (size_t i) const
 Access the raw element.
 
virtual void print (std::ostream &os, const std::string &name="A", const std::string &prefix="") const
 
template<class TYPE >
void putRawData (const TYPE *buf)
 Copy data into this vector.
 
void putRawData (const void *buf, const typeID &id) override
 Copy data into this vector.
 
void registerChildObjects (AMP::IO::RestartManager *manager) const override
 Register any child objects.
 
virtual void registerListener (DataChangeListener *listener)
 Register a listener with this DataChangeFirer.
 
virtual void registerListener (std::shared_ptr< DataChangeListener > listener)
 Register a listener with this DataChangeFirer.
 
virtual void reset ()
 reset the vector data object
 
void setCommunicationList (std::shared_ptr< CommunicationList > comm) override
 Set the CommunicationList for this Vector.
 
template<class TYPE >
void setGhostValuesByGlobalID (size_t num, const size_t *indices, const TYPE *vals)
 Set ghost values using global identifier.
 
virtual void setGhostValuesByGlobalID (size_t num, const size_t *indices, const void *vals, const typeID &id)=0
 Set ghost values using global identifier.
 
void setGhostValuesByGlobalID (size_t, const size_t *, const void *, const typeID &) override
 Set ghost values using global identifier.
 
void setNoGhosts () override
 Ensure this vector has no ghosts.
 
void setUpdateStatus (UpdateState state) override
 Sets the current update state of the Vector.
 
void setUpdateStatusPtr (std::shared_ptr< UpdateState > rhs) override
 Tie the current update state to another.
 
template<class TYPE >
void setValuesByGlobalID (size_t num, const size_t *indices, const TYPE *vals)
 Set owned or shared values using global identifier.
 
template<class TYPE >
void setValuesByLocalID (size_t num, const size_t *indices, const TYPE *vals)
 Set values in the vector by their local offset.
 
void setValuesByLocalID (size_t num, const size_t *indices, const void *vals, const typeID &id) override
 Set values in the vector by their local offset.
 
std::shared_ptr< VectorDatashared_from_this ()
 
std::shared_ptr< const VectorDatashared_from_this () const
 
size_t sizeOfDataBlock (size_t i=0) const override
 Number of elements in a data block.
 
size_t sizeofDataBlockType (size_t i) const override
 Return the result of sizeof(TYPE) for the given data block.
 
void swapData (VectorData &rhs) override
 Swap the data with another VectorData object.
 
 VectorDataDevice (const VectorDataDevice &)=delete
 
 VectorDataDevice (int64_t, AMP::IO::RestartManager *)
 
 VectorDataDevice (size_t start, size_t localSize, size_t globalSize)
 
std::string VectorDataName () const override
 Get the type name.
 
void writeRestart (int64_t) const override
 Write restart data to file.
 
virtual ~VectorDataDevice ()
 Virtual destructor.
 

Protected Member Functions

void allocateBuffers (size_t len)
 
void deallocateBuffers ()
 
void scatter_add ()
 
void scatter_set ()
 

Protected Attributes

TYPE * d_AddBuffer = nullptr
 
std::vector< TYPE > d_AddBuffer_h
 
ScalarAllocator_t d_alloc
 
std::shared_ptr< CommunicationListd_CommList = nullptr
 
TYPE * d_data = nullptr
 
TYPE * d_Ghosts = nullptr
 
std::vector< TYPE > d_Ghosts_h
 
size_t d_ghostSize = 0
 size/length of ghost and add buffers
 
size_t d_globalSize = 0
 Number of local values.
 
intAllocator_t d_int_alloc
 
size_t * d_localRemote = nullptr
 list of local ids that are remote
 
size_t d_localSize = 0
 
size_t d_localStart = 0
 Number of global values.
 
size_t d_numRemote = 0
 number of local ids that are remote
 
size_t * d_ReceiveDOFList = nullptr
 
int * d_recvDisplacements = nullptr
 
int * d_recvSizes = nullptr
 
int d_scatter_tag
 
int * d_sendDisplacements = nullptr
 
TYPE * d_SendRecv = nullptr
 Buffers for sending/receiving data.
 
std::vector< TYPE > d_SendRecv_h
 
int * d_sendSizes = nullptr
 
sizetAllocator_t d_size_t_alloc
 
std::shared_ptr< UpdateStated_UpdateState = nullptr
 
std::weak_ptr< VectorDataweak_ptr_
 

Private Member Functions

std::tuple< bool, size_t *, void * > copyToScratchSpace (size_t num, const size_t *indices_, const void *vals_, const typeID &id) const
 
void setMapScratchSpace (size_t N) const
 
void setScratchSpace (size_t N) const
 

Private Attributes

idxAllocator_t d_idx_alloc
 
size_t * d_idx_map_scratch = nullptr
 
size_t * d_idx_req_scratch = nullptr
 
std::vector< DataChangeListener * > d_listeners
 
scalarAllocator_t d_scalar_alloc
 
TYPE * d_scalar_scratch = nullptr
 
size_t d_scratchSize = 0
 

Detailed Description

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
class AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >

A class used to hold vector data.

VectorDataDefault is a default implementation of VectorData that stores the local values as a single block of data on the CPU.

Definition at line 16 of file VectorDataDevice.h.

Member Typedef Documentation

◆ idxAllocator_t

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
using AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::idxAllocator_t = typename std::allocator_traits<Allocator>::template rebind_alloc<size_t>

Definition at line 22 of file VectorDataDevice.h.

◆ intAllocator_t

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
using AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::intAllocator_t = typename std::allocator_traits<Allocator>::template rebind_alloc<int>
inherited

Definition at line 19 of file GhostDataHelper.h.

◆ scalarAllocator_t

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
using AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::scalarAllocator_t = typename std::allocator_traits<Allocator>::template rebind_alloc<TYPE>

Definition at line 20 of file VectorDataDevice.h.

◆ ScalarAllocator_t

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
using AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::ScalarAllocator_t = typename std::allocator_traits<Allocator>::template rebind_alloc<TYPE>
inherited

Definition at line 15 of file GhostDataHelper.h.

◆ sizetAllocator_t

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
using AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::sizetAllocator_t = typename std::allocator_traits<Allocator>::template rebind_alloc<size_t>
inherited

Definition at line 17 of file GhostDataHelper.h.

◆ value_type

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
using AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::value_type = TYPE

Definition at line 19 of file VectorDataDevice.h.

Constructor & Destructor Documentation

◆ VectorDataDevice() [1/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::VectorDataDevice ( size_t  start,
size_t  localSize,
size_t  globalSize 
)

◆ VectorDataDevice() [2/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::VectorDataDevice ( const VectorDataDevice< TYPE, Allocator > &  )
delete

◆ ~VectorDataDevice()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
virtual AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::~VectorDataDevice ( )
virtual

Virtual destructor.

◆ VectorDataDevice() [3/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::VectorDataDevice ( int64_t  ,
AMP::IO::RestartManager  
)

Member Function Documentation

◆ addGhostValuesByGlobalID() [1/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
template<class TYPE >
void AMP::LinearAlgebra::VectorData::addGhostValuesByGlobalID ( size_t  num,
const size_t *  indices,
const TYPE *  vals 
)

Add shared values using global identifier.

Parameters
[in]numnumber of values to add
[in]indicesthe indices of the values to add
[in]valsthe values to place in the vector

◆ addGhostValuesByGlobalID() [2/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
virtual void AMP::LinearAlgebra::VectorData::addGhostValuesByGlobalID ( size_t  num,
const size_t *  indices,
const void *  vals,
const typeID id 
)
virtual

Add shared values using global identifier.

Parameters
[in]numnumber of values to add
[in]indicesthe indices of the values to add
[in]valsthe values to place in the vector
[in]idtypeID of raw data

Reimplemented from AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >.

◆ addGhostValuesByGlobalID() [3/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::addGhostValuesByGlobalID ( size_t  num,
const size_t *  indices,
const void *  vals,
const typeID id 
)
overridevirtual

Add shared values using global identifier.

Parameters
[in]numnumber of values to add
[in]indicesthe indices of the values to add
[in]valsthe values to place in the vector
[in]idtypeID of raw data

Reimplemented from AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >.

◆ addValuesByGlobalID()

template<class TYPE >
void AMP::LinearAlgebra::VectorData::addValuesByGlobalID ( size_t  num,
const size_t *  indices,
const TYPE *  vals 
)
inherited

Add owned or shared values using global identifier.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector

Since the shared buffer and owned buffer are separate, this function must sort the data by buffer before setting values.

◆ addValuesByLocalID() [1/2]

template<class TYPE >
void AMP::LinearAlgebra::VectorData::addValuesByLocalID ( size_t  num,
const size_t *  indices,
const TYPE *  vals 
)
inherited

Add values to vector entities by their local offset.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector

This will set the owned values for this core. All indices are from 0. \( \mathit{this}_{\mathit{indices}_i} = \mathit{this}_{\mathit{indices}_i} + \mathit{vals}_i \)

◆ addValuesByLocalID() [2/2]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::addValuesByLocalID ( size_t  num,
const size_t *  indices,
const void *  vals,
const typeID id 
)
overridevirtual

Add values to vector entities by their local offset.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector
[in]idtypeID of raw data

This will set the owned values for this core. All indices are from 0. \( \mathit{this}_{\mathit{indices}_i} = \mathit{this}_{\mathit{indices}_i} + \mathit{vals}_i \)

Reimplemented from AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >.

◆ allGhostIndices()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
bool AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::allGhostIndices ( size_t  N,
const size_t *  ndx 
) const
overridevirtual

◆ allocateBuffers()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::allocateBuffers ( size_t  len)
protectedinherited

◆ assemble()

virtual void AMP::LinearAlgebra::VectorData::assemble ( )
inlinevirtualinherited

This method is used to implement the assemble interface of PETSc.

This method is empty except for instantiations of NativePetscVectorData

Reimplemented in AMP::LinearAlgebra::ManagedVectorData, AMP::LinearAlgebra::MultiVectorData, and AMP::LinearAlgebra::NativePetscVectorData.

Definition at line 631 of file VectorData.h.

◆ begin() [1/2]

template<class TYPE = double>
VectorDataIterator< TYPE > AMP::LinearAlgebra::VectorData::begin ( )
inlineinherited

Return an iterator to the beginning of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

◆ begin() [2/2]

template<class TYPE = double>
VectorDataIterator< const TYPE > AMP::LinearAlgebra::VectorData::begin ( ) const
inlineinherited

Return an iterator to the beginning of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

◆ cloneData()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
std::shared_ptr< VectorData > AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::cloneData ( const std::string &  name = "") const
overridevirtual

Clone the data.

Reimplemented from AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >.

◆ constBegin()

template<class TYPE = double>
VectorDataIterator< const TYPE > AMP::LinearAlgebra::VectorData::constBegin ( ) const
inlineinherited

Return an iterator to the beginning of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

◆ constEnd()

template<class TYPE = double>
VectorDataIterator< const TYPE > AMP::LinearAlgebra::VectorData::constEnd ( ) const
inlineinherited

Return an iterator to the end of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

◆ containsGlobalElement()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
bool AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::containsGlobalElement ( size_t  ) const
overridevirtual

◆ copyGhostValues()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::copyGhostValues ( const VectorData rhs)
overridevirtualinherited

Copy ghosted vlues to a vector.

Parameters
[in]rhsVector to copy ghost values from

This ensures that ghosted values on this and rhs are the same without a call to makeConsistent.

See also
makeConsistent

Implements AMP::LinearAlgebra::VectorData.

◆ copyToScratchSpace()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
std::tuple< bool, size_t *, void * > AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::copyToScratchSpace ( size_t  num,
const size_t *  indices_,
const void *  vals_,
const typeID id 
) const
private

◆ dataChanged()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::dataChanged ( )
overridevirtualinherited

Notify listeners that data has changed in this vector.

Implements AMP::LinearAlgebra::VectorData.

Reimplemented in AMP::LinearAlgebra::ManagedVectorData.

◆ deallocateBuffers()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::deallocateBuffers ( )
protectedinherited

◆ deregisterListener()

virtual void AMP::LinearAlgebra::DataChangeFirer::deregisterListener ( DataChangeListener listener)
virtualinherited

Deregister a listener with this DataChangeFirer.

Parameters
[in]listenerThe listener to remove from the list

Removes a listener from itself.

◆ dumpGhostedData()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::dumpGhostedData ( std::ostream &  out,
size_t  offset 
) const
overridevirtualinherited

Write data owned by other processors to an std::ostream.

Parameters
[in]outThe output stream to write to.
[in]offsetA number to add to the global ID when writing information

Implements AMP::LinearAlgebra::VectorData.

◆ dumpOwnedData()

virtual void AMP::LinearAlgebra::VectorData::dumpOwnedData ( std::ostream &  out,
size_t  GIDoffset = 0,
size_t  LIDoffset = 0 
) const
virtualinherited

Write owned data to an std::ostream.

Parameters
[in]outThe output stream to write to.
[in]GIDoffsetA number to add to the global ID when writing information
[in]LIDoffsetA number to add to the local ID when writing information

Reimplemented in AMP::LinearAlgebra::MultiVectorData.

◆ end() [1/2]

template<class TYPE = double>
VectorDataIterator< TYPE > AMP::LinearAlgebra::VectorData::end ( )
inlineinherited

Return an iterator to the end of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

◆ end() [2/2]

template<class TYPE = double>
VectorDataIterator< const TYPE > AMP::LinearAlgebra::VectorData::end ( ) const
inlineinherited

Return an iterator to the end of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

◆ fillGhosts()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::fillGhosts ( const Scalar x)
overridevirtual

Zero all ghost data (does not modify consistent status)

Reimplemented from AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >.

◆ fireDataChange()

virtual void AMP::LinearAlgebra::DataChangeFirer::fireDataChange ( )
virtualinherited

Notify all listeners of a data change event.

Iterates through the list of DataChangeListeners and invokes the receiveDataChanged() method.

Referenced by AMP::LinearAlgebra::ManagedVectorData::receiveDataChanged(), and AMP::LinearAlgebra::MultiVectorData::receiveDataChanged().

◆ getAllGhostValues() [1/2]

template<class TYPE >
size_t AMP::LinearAlgebra::VectorData::getAllGhostValues ( TYPE *  vals) const
inherited

Get all ghost values.

Parameters
[out]valsthe values to place in the vector

This will get any value owned by this core.

◆ getAllGhostValues() [2/2]

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::getAllGhostValues ( void *  vals,
const typeID id 
) const
overridevirtualinherited

Get all ghost values in the vector.

Parameters
[out]valsthe values to place in the vector
[in]idtypeID of raw data

This will get any value owned by this core.

Returns
Returns the number of ghost values

Implements AMP::LinearAlgebra::VectorData.

Reimplemented in AMP::LinearAlgebra::ManagedVectorData.

◆ getComm()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
const AMP_MPI & AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::getComm ( ) const
overridevirtualinherited

Get the communicator.

Implements AMP::LinearAlgebra::VectorData.

Reimplemented in AMP::LinearAlgebra::SubsetVectorData.

◆ getCommunicationList()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
std::shared_ptr< CommunicationList > AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::getCommunicationList ( ) const
overridevirtualinherited

◆ getComponent() [1/2]

virtual std::shared_ptr< VectorData > AMP::LinearAlgebra::VectorData::getComponent ( size_t  i = 0)
virtualinherited

Number of elements in the ith component.

Parameters
[in]iparticular data block
Returns
The number of elements in the ith component

Reimplemented in AMP::LinearAlgebra::MultiVectorData.

◆ getComponent() [2/2]

virtual std::shared_ptr< const VectorData > AMP::LinearAlgebra::VectorData::getComponent ( size_t  i = 0) const
virtualinherited

Number of elements in the ith component.

Parameters
[in]iparticular data block
Returns
The number of elements in the ith component

Reimplemented in AMP::LinearAlgebra::MultiVectorData.

◆ getDataID()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
uint64_t AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::getDataID ( ) const
overridevirtualinherited

A unique id for the underlying data allocation.

This is a unique id that is associated with the data data allocation. Views of a vector should preserve the id of the original vector. Vectors that are not allocated, or contain multiple vectors (such as Multivector) should return 0. Note: this id is not consistent across multiple processors.

Implements AMP::LinearAlgebra::VectorData.

◆ getGhostAddValuesByGlobalID() [1/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
template<class TYPE >
void AMP::LinearAlgebra::VectorData::getGhostAddValuesByGlobalID ( size_t  num,
const size_t *  indices,
TYPE *  vals 
) const

get ghosted values to add to off-proc elements

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector

This will get the ghosted updates this processor has made. All indices are from global 0.

◆ getGhostAddValuesByGlobalID() [2/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
virtual void AMP::LinearAlgebra::VectorData::getGhostAddValuesByGlobalID ( size_t  num,
const size_t *  indices,
void *  vals,
const typeID id 
) const
virtual

get ghosted values to add to off-proc elements

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector
[in]idtypeID of raw data

This will get the ghosted updates this processor has made. All indices are from global 0.

Reimplemented from AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >.

◆ getGhostAddValuesByGlobalID() [3/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::getGhostAddValuesByGlobalID ( size_t  num,
const size_t *  indices,
void *  vals,
const typeID id 
) const
overridevirtual

get ghosted values to add to off-proc elements

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector
[in]idtypeID of raw data

This will get the ghosted updates this processor has made. All indices are from global 0.

Reimplemented from AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >.

◆ getGhostSize()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::getGhostSize ( ) const
overridevirtualinherited

Number of entries "owned" by other cores stored on this core.

Returns
Number of entries "owned" by other cores stored on this core

Implements AMP::LinearAlgebra::VectorData.

◆ getGhostValuesByGlobalID() [1/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
template<class TYPE >
void AMP::LinearAlgebra::VectorData::getGhostValuesByGlobalID ( size_t  num,
const size_t *  indices,
TYPE *  vals 
) const

Get ghost values in the vector by their global offset.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[out]valsthe values to place in the vector

This will get any value owned by this core.

◆ getGhostValuesByGlobalID() [2/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
virtual void AMP::LinearAlgebra::VectorData::getGhostValuesByGlobalID ( size_t  num,
const size_t *  indices,
void *  vals,
const typeID id 
) const
virtual

Get ghost values in the vector by their global offset.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[out]valsthe values to place in the vector
[in]idtypeID of raw data

This will get any value owned by this core.

Reimplemented from AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >.

◆ getGhostValuesByGlobalID() [3/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::getGhostValuesByGlobalID ( size_t  num,
const size_t *  indices,
void *  vals,
const typeID id 
) const
overridevirtual

Get ghost values in the vector by their global offset.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[out]valsthe values to place in the vector
[in]idtypeID of raw data

This will get any value owned by this core.

Reimplemented from AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >.

◆ getGhostValuesByGlobalIDUnsorted()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::getGhostValuesByGlobalIDUnsorted ( size_t  num,
const size_t *  indices,
void *  vals,
const typeID id 
) const
inherited

◆ getGlobalSize()

size_t AMP::LinearAlgebra::VectorData::getGlobalSize ( ) const
inlineinherited

Number of total entries in this vector across all cores.

Returns
Number of entries stored across all cores in this

Definition at line 71 of file VectorData.h.

References AMP::LinearAlgebra::VectorData::d_globalSize.

◆ getGlobalUpdateStatus()

UpdateState AMP::LinearAlgebra::VectorData::getGlobalUpdateStatus ( ) const
inherited

Return the current update state of the Vector.

This returns the effective update state of the vector, including any vectors it contains. The effective state is defined as: UNCHANGED - All data and sub vectors are unchanged LOCAL_CHANGED - Local data may be modified, sub vectors must either be UNCHANGED or LOCAL_CHANGED. ADDING - Local and ghost data may be modified through add operations, sub vectors must be UNCHANGED, LOCAL_CHANGED, or ADDING SETTING - Local and ghost data may be modified through set operations, sub vectors must be UNCHANGED, LOCAL_CHANGED, or SETTING If different subvectors have incompatible states ADDING and SETTING, this function will return MIXED This version returns the global state and requires a collective communication

◆ getID()

uint64_t AMP::LinearAlgebra::VectorData::getID ( ) const
inherited

Get a unique id hash for the vector.

◆ getLocalSize()

size_t AMP::LinearAlgebra::VectorData::getLocalSize ( ) const
inlineinherited

Number of elements "owned" by this core.

Returns
Number of entries stored on this processor

This function returns the number of locally stored values under contiguous indexing.

Definition at line 66 of file VectorData.h.

◆ getLocalSizes()

virtual std::vector< size_t > AMP::LinearAlgebra::VectorData::getLocalSizes ( ) const
virtualinherited

The local sizes on each rank.

Returns
The local sizes on each rank

Reimplemented in AMP::LinearAlgebra::MultiVectorData.

◆ getLocalStartID()

size_t AMP::LinearAlgebra::VectorData::getLocalStartID ( ) const
inlineinherited

get local start id core.

Returns
The first entry "owned" by this core

Definition at line 76 of file VectorData.h.

References AMP::LinearAlgebra::VectorData::d_localStart.

◆ getLocalUpdateStatus()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
UpdateState AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::getLocalUpdateStatus ( ) const
overridevirtualinherited

Return the current update state of the Vector.

This returns the effective update state of the vector, including any vectors it contains. The effective state is defined as: UNCHANGED - All data and sub vectors are unchanged LOCAL_CHANGED - Local data may be modified, sub vectors must either be UNCHANGED or LOCAL_CHANGED. ADDING - Local and ghost data may be modified through add operations, sub vectors must be UNCHANGED, LOCAL_CHANGED, or ADDING SETTING - Local and ghost data may be modified through set operations, sub vectors must be UNCHANGED, LOCAL_CHANGED, or SETTING If different subvectors have incompatible states ADDING and SETTING, this function will return MIXED This version returns the local state only and does not involve communication

Implements AMP::LinearAlgebra::VectorData.

Reimplemented in AMP::LinearAlgebra::ManagedVectorData.

◆ getMemoryLocation()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
AMP::Utilities::MemoryType AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::getMemoryLocation ( ) const
overridevirtualinherited

returns the memory location for data

Reimplemented from AMP::LinearAlgebra::VectorData.

◆ getNumberOfComponents()

virtual size_t AMP::LinearAlgebra::VectorData::getNumberOfComponents ( ) const
virtualinherited

Return integer number of data components.

Reimplemented in AMP::LinearAlgebra::MultiVectorData.

◆ getRawData() [1/2]

template<class TYPE >
void AMP::LinearAlgebra::VectorData::getRawData ( TYPE *  buf) const
inherited

Copy data out of this vector.

Parameters
[out]bufBuffer to copy to

The Vector should be pre-allocated to the correct size (getLocalSize())

◆ getRawData() [2/2]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::getRawData ( void *  buf,
const typeID id 
) const
overridevirtual

Copy data out of this vector.

Parameters
[out]bufBuffer to copy to
[in]idtypeID of raw data

The Vector should be pre-allocated to the correct size (getLocalSize())

Reimplemented from AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >.

◆ getRawDataBlock() [1/2]

template<typename RETURN_TYPE >
RETURN_TYPE * AMP::LinearAlgebra::VectorData::getRawDataBlock ( size_t  i = 0)
inherited

Obtain a particular contiguous block of data cast to RETURN_TYPE.

Template Parameters
RETURN_TYPEThe pointer type of the return
Parameters
[in]iWhich block
Returns
A contiguous array of type RETURN_TYPE

◆ getRawDataBlock() [2/2]

template<typename RETURN_TYPE >
const RETURN_TYPE * AMP::LinearAlgebra::VectorData::getRawDataBlock ( size_t  i = 0) const
inherited

Obtain a particular contiguous block of data cast to RETURN_TYPE.

Template Parameters
RETURN_TYPEThe pointer type of the return
Parameters
[in]iWhich block
Returns
A const contiguous array of type RETURN_TYPE

◆ getRawDataBlockAsVoid() [1/2]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
const void * AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::getRawDataBlockAsVoid ( size_t  i) const
overridevirtualinherited

Return a pointer to a particular block of memory in the vector.

Parameters
iThe block to return

Implements AMP::LinearAlgebra::VectorData.

◆ getRawDataBlockAsVoid() [2/2]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void * AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::getRawDataBlockAsVoid ( size_t  i)
overridevirtualinherited

Return a pointer to a particular block of memory in the vector.

Parameters
iThe block to return

Implements AMP::LinearAlgebra::VectorData.

◆ getType()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
typeID AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::getType ( size_t  block) const
overridevirtualinherited

Return the typeid of the given block.

Parameters
blockThe block id to check

Implements AMP::LinearAlgebra::VectorData.

◆ getUpdateStatusPtr()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
std::shared_ptr< UpdateState > AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::getUpdateStatusPtr ( ) const
overridevirtualinherited

Return the current update state of this Vector.

This returns the pointer to the update state of the current vector only (not vectors it contains). It should NOT be used by users.

Implements AMP::LinearAlgebra::VectorData.

◆ getValuesByGlobalID()

template<class TYPE >
void AMP::LinearAlgebra::VectorData::getValuesByGlobalID ( size_t  num,
const size_t *  indices,
TYPE *  vals 
) const
inherited

get values in the vector by their local offset

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[out]valsthe values to place in the vector

This will get the owned values for this core. All indices are from 0.

◆ getValuesByLocalID() [1/2]

template<class TYPE >
void AMP::LinearAlgebra::VectorData::getValuesByLocalID ( size_t  num,
const size_t *  indices,
TYPE *  vals 
) const
inherited

Get local values in the vector by their global offset.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[out]valsthe values to place in the vector

This will get any value used by this core.

◆ getValuesByLocalID() [2/2]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::getValuesByLocalID ( size_t  num,
const size_t *  indices,
void *  vals,
const typeID id 
) const
overridevirtual

Get values to vector entities by their local offset.

Parameters
[in]numnumber of values to get
[in]indicesthe indices of the values to get
[in]valsthe values to place in the vector
[in]idtypeID of raw data

This will get the owned values for this core. All indices are from 0. \( \mathit{this}_{\mathit{indices}_i} = \mathit{this}_{\mathit{indices}_i} + \mathit{vals}_i \)

Reimplemented from AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >.

◆ hasContiguousData()

virtual bool AMP::LinearAlgebra::VectorData::hasContiguousData ( ) const
inlinevirtualinherited

returns whether all data for the vector on a single process is contiguous

Reimplemented in AMP::LinearAlgebra::ManagedVectorData, AMP::LinearAlgebra::MultiVectorData, AMP::LinearAlgebra::SubsetCommSelfVectorData, and AMP::LinearAlgebra::SubsetVectorData.

Definition at line 113 of file VectorData.h.

◆ hasGhosts()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
bool AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::hasGhosts ( ) const
inlineoverridevirtualinherited

Check if any entries "owned" by other cores are stored on this core.

Returns
True if any entries "owned" by other cores are stored on this core

Implements AMP::LinearAlgebra::VectorData.

Definition at line 26 of file GhostDataHelper.h.

References AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_ghostSize.

◆ isAnAliasOf()

virtual bool AMP::LinearAlgebra::VectorData::isAnAliasOf ( const VectorData rhs) const
virtualinherited

Check if the two VectorData objects are alias of each other.

This function checks if two VectorData objects are alias of each other. Two VectorData objects are alias if their data blocks are the same size and point to the same memory blocks.

Parameters
[in]rhsVectorData to compare
See also
makeConsistent

Reimplemented in AMP::LinearAlgebra::ManagedVectorData.

◆ isBlockType()

template<typename TYPE >
bool AMP::LinearAlgebra::VectorData::isBlockType ( size_t  i = 0) const
inherited

Check if the data is of the given type.

Returns
true if the ith block of data is of the given type

◆ isType() [1/2]

template<typename TYPE >
bool AMP::LinearAlgebra::VectorData::isType ( ) const
inherited

Check if the data is of the given type.

Returns
true if all data is of the given type

◆ isType() [2/2]

bool AMP::LinearAlgebra::VectorData::isType ( const typeID id,
size_t  block 
) const
inlineinherited

Is the data of the given type.

Parameters
idThe typeid
blockThe block id to check

◆ makeConsistent() [1/3]

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
virtual void AMP::LinearAlgebra::VectorData::makeConsistent ( )
virtualinherited

Update shared values on entire communicator.

This version will check the state of the vector and then call the appropriate version of makeConsistent

Reimplemented from AMP::LinearAlgebra::VectorData.

Reimplemented in AMP::LinearAlgebra::ManagedVectorData, and AMP::LinearAlgebra::NativePetscVectorData.

◆ makeConsistent() [2/3]

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::makeConsistent ( ScatterType  t)
overridevirtualinherited

Update shared values on entire communicator.

Parameters
tThe type of scatter used to compute values

There are two algorithms used by makeConsistent

  • If t = CONSISTENT_SET, then owned values are sent to processors that share the value. Shared values are overwritten
  • If t = CONSISTENT_ADD, then shared values are accumulated on the core that owns it and applied as determined, either add or set. Then, the values are broadcast out.

Generally, when adding to a vector, the GATHER_SCATTER should be used to make consistent. When setting entries in a vector the BROADCAST should be used.

Implements AMP::LinearAlgebra::VectorData.

Reimplemented in AMP::LinearAlgebra::ManagedVectorData, AMP::LinearAlgebra::NativePetscVectorData, and AMP::LinearAlgebra::ManagedVectorData.

◆ makeConsistent() [3/3]

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
virtual void AMP::LinearAlgebra::VectorData::makeConsistent ( ScatterType  t)
virtualinherited

Update shared values on entire communicator.

Parameters
tThe type of scatter used to compute values

There are two algorithms used by makeConsistent

  • If t = CONSISTENT_SET, then owned values are sent to processors that share the value. Shared values are overwritten
  • If t = CONSISTENT_ADD, then shared values are accumulated on the core that owns it and applied as determined, either add or set. Then, the values are broadcast out.

Generally, when adding to a vector, the GATHER_SCATTER should be used to make consistent. When setting entries in a vector the BROADCAST should be used.

Implements AMP::LinearAlgebra::VectorData.

Reimplemented in AMP::LinearAlgebra::ManagedVectorData, AMP::LinearAlgebra::NativePetscVectorData, and AMP::LinearAlgebra::ManagedVectorData.

◆ numberOfDataBlocks()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::numberOfDataBlocks ( ) const
overridevirtualinherited

Number of blocks of contiguous data in the Vector.

Returns
Number of blocks in the Vector

A vector is not necessarily contiguous in memory. This method returns the number of contiguous blocks in memory used by this vector

Implements AMP::LinearAlgebra::VectorData.

◆ operator[]() [1/2]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
TYPE & AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::operator[] ( size_t  i)
inherited

Access the raw element.

Parameters
iThe element to return (local index)

◆ operator[]() [2/2]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
const TYPE & AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::operator[] ( size_t  i) const
inherited

Access the raw element.

Parameters
iThe element to return (local index)

◆ print()

virtual void AMP::LinearAlgebra::VectorData::print ( std::ostream &  os,
const std::string &  name = "A",
const std::string &  prefix = "" 
) const
virtualinherited

◆ putRawData() [1/2]

template<class TYPE >
void AMP::LinearAlgebra::VectorData::putRawData ( const TYPE *  buf)
inherited

Copy data into this vector.

Parameters
[in]bufBuffer to copy from

◆ putRawData() [2/2]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::putRawData ( const void *  buf,
const typeID id 
)
overridevirtual

Copy data into this vector.

Parameters
[in]bufBuffer to copy from
[in]idtypeID of raw data

Reimplemented from AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >.

◆ registerChildObjects()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::registerChildObjects ( AMP::IO::RestartManager manager) const
overridevirtual

Register any child objects.

This function will register child objects with the manager

Parameters
managerRestart manager

Reimplemented from AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >.

◆ registerListener() [1/2]

virtual void AMP::LinearAlgebra::DataChangeFirer::registerListener ( DataChangeListener listener)
virtualinherited

Register a listener with this DataChangeFirer.

Parameters
[in]listenerThe listener to be alerted to data change events

Adds a listener to itself.

◆ registerListener() [2/2]

virtual void AMP::LinearAlgebra::DataChangeFirer::registerListener ( std::shared_ptr< DataChangeListener listener)
virtualinherited

Register a listener with this DataChangeFirer.

Parameters
[in]listenerThe listener to be alerted to data change events

Adds a listener to itself.

◆ reset()

virtual void AMP::LinearAlgebra::VectorData::reset ( )
virtualinherited

reset the vector data object

At present this interface is primarily meant for vector data over AMR hierarchies, where the number of AMR levels and vector data has to be reallocated

◆ scatter_add()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::scatter_add ( )
protectedinherited

◆ scatter_set()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::scatter_set ( )
protectedinherited

◆ setCommunicationList()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::setCommunicationList ( std::shared_ptr< CommunicationList comm)
overridevirtualinherited

Set the CommunicationList for this Vector.

Setting the CommunicationList for a Vector may involve reallocating ghost storage.

Implements AMP::LinearAlgebra::VectorData.

◆ setGhostValuesByGlobalID() [1/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
template<class TYPE >
void AMP::LinearAlgebra::VectorData::setGhostValuesByGlobalID ( size_t  num,
const size_t *  indices,
const TYPE *  vals 
)

Set ghost values using global identifier.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector

\( \mathit{this}_{\mathit{indices}_i} = \mathit{vals}_i \)

◆ setGhostValuesByGlobalID() [2/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
virtual void AMP::LinearAlgebra::VectorData::setGhostValuesByGlobalID ( size_t  num,
const size_t *  indices,
const void *  vals,
const typeID id 
)
virtual

Set ghost values using global identifier.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector
[in]idtypeID of raw data

\( \mathit{this}_{\mathit{indices}_i} = \mathit{vals}_i \)

Reimplemented from AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >.

◆ setGhostValuesByGlobalID() [3/3]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::setGhostValuesByGlobalID ( size_t  num,
const size_t *  indices,
const void *  vals,
const typeID id 
)
overridevirtual

Set ghost values using global identifier.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector
[in]idtypeID of raw data

\( \mathit{this}_{\mathit{indices}_i} = \mathit{vals}_i \)

Reimplemented from AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >.

◆ setMapScratchSpace()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::setMapScratchSpace ( size_t  N) const
private

◆ setNoGhosts()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::setNoGhosts ( )
overridevirtualinherited

Ensure this vector has no ghosts.

Calls clearBuffer for the communication list and removes any storage for ghosts

Reimplemented from AMP::LinearAlgebra::VectorData.

◆ setScratchSpace()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::setScratchSpace ( size_t  N) const
private

◆ setUpdateStatus()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::setUpdateStatus ( UpdateState  state)
overridevirtualinherited

Sets the current update state of the Vector.

This sets the update status of the vector. This function should only be called by advanced users

Parameters
[in]stateState of the vector to set

Implements AMP::LinearAlgebra::VectorData.

Reimplemented in AMP::LinearAlgebra::ManagedVectorData.

◆ setUpdateStatusPtr()

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::setUpdateStatusPtr ( std::shared_ptr< UpdateState rhs)
overridevirtualinherited

Tie the current update state to another.

This sets the pointer to the update state of the current vector only (not vectors it contains). It should NOT be used by users.

Parameters
rhsPointer to share update state with

Implements AMP::LinearAlgebra::VectorData.

◆ setValuesByGlobalID()

template<class TYPE >
void AMP::LinearAlgebra::VectorData::setValuesByGlobalID ( size_t  num,
const size_t *  indices,
const TYPE *  vals 
)
inherited

Set owned or shared values using global identifier.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector

Since the shared buffer and owned buffer are separate, this function must sort the data by buffer before setting values.

◆ setValuesByLocalID() [1/2]

template<class TYPE >
void AMP::LinearAlgebra::VectorData::setValuesByLocalID ( size_t  num,
const size_t *  indices,
const TYPE *  vals 
)
inherited

Set values in the vector by their local offset.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector

This will set the owned values for this core. All indices are from 0. \( \mathit{this}_{\mathit{indices}_i} = \mathit{vals}_i \)

◆ setValuesByLocalID() [2/2]

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::setValuesByLocalID ( size_t  num,
const size_t *  indices,
const void *  vals,
const typeID id 
)
overridevirtual

Set values in the vector by their local offset.

Parameters
[in]numnumber of values to set
[in]indicesthe indices of the values to set
[in]valsthe values to place in the vector
[in]idtypeID of raw data

This will set the owned values for this core. All indices are from 0. \( \mathit{this}_{\mathit{indices}_i} = \mathit{vals}_i \)

Reimplemented from AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >.

◆ shared_from_this() [1/2]

std::shared_ptr< VectorData > AMP::enable_shared_from_this< VectorData >::shared_from_this ( )
inlineinherited

Definition at line 28 of file enable_shared_from_this.h.

◆ shared_from_this() [2/2]

std::shared_ptr< const VectorData > AMP::enable_shared_from_this< VectorData >::shared_from_this ( ) const
inlineinherited

Definition at line 46 of file enable_shared_from_this.h.

◆ sizeOfDataBlock()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::sizeOfDataBlock ( size_t  i = 0) const
overridevirtualinherited

Number of elements in a data block.

Parameters
[in]iparticular data block
Returns
The size of a particular block

Implements AMP::LinearAlgebra::VectorData.

◆ sizeofDataBlockType()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::sizeofDataBlockType ( size_t  i) const
overridevirtualinherited

Return the result of sizeof(TYPE) for the given data block.

Parameters
iThe block to return

Implements AMP::LinearAlgebra::VectorData.

◆ swapData()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::swapData ( VectorData rhs)
overridevirtualinherited

Swap the data with another VectorData object.

Parameters
rhsThe VectorData to swap with

Implements AMP::LinearAlgebra::VectorData.

◆ VectorDataName()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
std::string AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::VectorDataName ( ) const
overridevirtual

Get the type name.

Reimplemented from AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >.

◆ writeRestart()

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
void AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::writeRestart ( int64_t  fid) const
overridevirtual

Write restart data to file.

This function will write the mesh to an HDF5 file

Parameters
fidFile identifier to write

Reimplemented from AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >.

Member Data Documentation

◆ d_AddBuffer

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
TYPE* AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_AddBuffer = nullptr
protectedinherited

Definition at line 96 of file GhostDataHelper.h.

◆ d_AddBuffer_h

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
std::vector<TYPE> AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_AddBuffer_h
protectedinherited

Definition at line 93 of file GhostDataHelper.h.

◆ d_alloc

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
ScalarAllocator_t AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_alloc
protectedinherited

Definition at line 89 of file GhostDataHelper.h.

◆ d_CommList

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
std::shared_ptr<CommunicationList> AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_CommList = nullptr
protectedinherited

Definition at line 83 of file GhostDataHelper.h.

◆ d_data

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
TYPE* AMP::LinearAlgebra::VectorDataDefault< TYPE, Allocator >::d_data = nullptr
protectedinherited

Definition at line 179 of file VectorDataDefault.h.

◆ d_Ghosts

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
TYPE* AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_Ghosts = nullptr
protectedinherited

Definition at line 95 of file GhostDataHelper.h.

◆ d_Ghosts_h

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
std::vector<TYPE> AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_Ghosts_h
protectedinherited

Definition at line 91 of file GhostDataHelper.h.

◆ d_ghostSize

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_ghostSize = 0
protectedinherited

size/length of ghost and add buffers

Definition at line 87 of file GhostDataHelper.h.

Referenced by AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::hasGhosts().

◆ d_globalSize

size_t AMP::LinearAlgebra::VectorData::d_globalSize = 0
protectedinherited

Number of local values.

Definition at line 675 of file VectorData.h.

Referenced by AMP::LinearAlgebra::VectorData::getGlobalSize().

◆ d_idx_alloc

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
idxAllocator_t AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::d_idx_alloc
mutableprivate

Definition at line 128 of file VectorDataDevice.h.

◆ d_idx_map_scratch

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t* AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::d_idx_map_scratch = nullptr
mutableprivate

Definition at line 133 of file VectorDataDevice.h.

◆ d_idx_req_scratch

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t* AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::d_idx_req_scratch = nullptr
mutableprivate

Definition at line 132 of file VectorDataDevice.h.

◆ d_int_alloc

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
intAllocator_t AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_int_alloc
protectedinherited

Definition at line 107 of file GhostDataHelper.h.

◆ d_listeners

std::vector<DataChangeListener *> AMP::LinearAlgebra::DataChangeFirer::d_listeners
privateinherited

Definition at line 89 of file DataChangeFirer.h.

◆ d_localRemote

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t* AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_localRemote = nullptr
protectedinherited

list of local ids that are remote

Definition at line 110 of file GhostDataHelper.h.

◆ d_localSize

size_t AMP::LinearAlgebra::VectorData::d_localSize = 0
protectedinherited

◆ d_localStart

size_t AMP::LinearAlgebra::VectorData::d_localStart = 0
protectedinherited

Number of global values.

Definition at line 676 of file VectorData.h.

Referenced by AMP::LinearAlgebra::VectorData::getLocalStartID().

◆ d_numRemote

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_numRemote = 0
protectedinherited

number of local ids that are remote

Definition at line 104 of file GhostDataHelper.h.

◆ d_ReceiveDOFList

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t* AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_ReceiveDOFList = nullptr
protectedinherited

Definition at line 101 of file GhostDataHelper.h.

◆ d_recvDisplacements

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
int* AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_recvDisplacements = nullptr
protectedinherited

Definition at line 116 of file GhostDataHelper.h.

◆ d_recvSizes

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
int* AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_recvSizes = nullptr
protectedinherited

Definition at line 114 of file GhostDataHelper.h.

◆ d_scalar_alloc

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
scalarAllocator_t AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::d_scalar_alloc
mutableprivate

Definition at line 129 of file VectorDataDevice.h.

◆ d_scalar_scratch

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
TYPE* AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::d_scalar_scratch = nullptr
mutableprivate

Definition at line 134 of file VectorDataDevice.h.

◆ d_scatter_tag

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
int AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_scatter_tag
protectedinherited

Definition at line 119 of file GhostDataHelper.h.

◆ d_scratchSize

template<typename TYPE = double, class Allocator = AMP::HostAllocator<void>>
size_t AMP::LinearAlgebra::VectorDataDevice< TYPE, Allocator >::d_scratchSize = 0
mutableprivate

Definition at line 131 of file VectorDataDevice.h.

◆ d_sendDisplacements

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
int* AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_sendDisplacements = nullptr
protectedinherited

Definition at line 115 of file GhostDataHelper.h.

◆ d_SendRecv

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
TYPE* AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_SendRecv = nullptr
protectedinherited

Buffers for sending/receiving data.

Definition at line 98 of file GhostDataHelper.h.

◆ d_SendRecv_h

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
std::vector<TYPE> AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_SendRecv_h
protectedinherited

Definition at line 92 of file GhostDataHelper.h.

◆ d_sendSizes

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
int* AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_sendSizes = nullptr
protectedinherited

Definition at line 113 of file GhostDataHelper.h.

◆ d_size_t_alloc

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
sizetAllocator_t AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_size_t_alloc
protectedinherited

Definition at line 106 of file GhostDataHelper.h.

◆ d_UpdateState

template<class TYPE = double, class Allocator = AMP::HostAllocator<void>>
std::shared_ptr<UpdateState> AMP::LinearAlgebra::GhostDataHelper< TYPE, Allocator >::d_UpdateState = nullptr
protectedinherited

Definition at line 84 of file GhostDataHelper.h.

◆ weak_ptr_

std::weak_ptr<VectorData > AMP::enable_shared_from_this< VectorData >::weak_ptr_
mutableprotectedinherited

Definition at line 69 of file enable_shared_from_this.h.


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



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:43.
Comments on this page