1#ifndef included_AMP_GhostDataHelper
2#define included_AMP_GhostDataHelper
4#include "AMP/vectors/CommunicationList.h"
5#include "AMP/vectors/data/VectorData.h"
11template<
class TYPE =
double,
class Allocator = AMP::HostAllocator<
void>>
16 typename std::allocator_traits<Allocator>::template rebind_alloc<TYPE>;
18 typename std::allocator_traits<Allocator>::template rebind_alloc<size_t>;
19 using intAllocator_t =
typename std::allocator_traits<Allocator>::template rebind_alloc<int>;
34 const size_t *indices,
36 const typeID &
id )
override;
38 const size_t *indices,
40 const typeID &
id )
override;
42 const size_t *indices,
44 const typeID &
id )
const override;
46 const size_t *indices,
50 const size_t *indices,
52 const typeID &
id )
const override;
Provides C++ wrapper around MPI routines.
Class to manage reading/writing restart data.
size_t getGhostSize() const override
Number of entries "owned" by other cores stored on this core.
std::shared_ptr< UpdateState > getUpdateStatusPtr() const override
Return the current update state of this Vector.
std::shared_ptr< CommunicationList > getCommunicationList() const override
Get the CommunicationList for this Vector.
size_t d_numRemote
number of local ids that are remote
void allocateBuffers(size_t len)
int * d_sendDisplacements
void getGhostValuesByGlobalID(size_t num, const size_t *indices, void *vals, const typeID &id) const override
Get ghost values in the vector by their global offset.
void setUpdateStatusPtr(std::shared_ptr< UpdateState > rhs) override
Tie the current update state to another.
int * d_recvDisplacements
void getGhostValuesByGlobalIDUnsorted(size_t num, const size_t *indices, void *vals, const typeID &id) const
void dataChanged() override
Notify listeners that data has changed in this vector.
GhostDataHelper(int64_t fid, AMP::IO::RestartManager *manager)
ScalarAllocator_t d_alloc
intAllocator_t d_int_alloc
UpdateState getLocalUpdateStatus() const override
Return the current update state of the Vector.
size_t * d_localRemote
list of local ids that are remote
void dumpGhostedData(std::ostream &out, size_t offset) const override
Write data owned by other processors to an std::ostream.
std::vector< TYPE > d_SendRecv_h
void writeRestart(int64_t fid) const override
Write restart data to file.
typename std::allocator_traits< Allocator >::template rebind_alloc< size_t > sizetAllocator_t
void copyGhostValues(const VectorData &rhs) override
Copy ghosted vlues to a vector.
size_t * d_ReceiveDOFList
typename std::allocator_traits< Allocator >::template rebind_alloc< TYPE > ScalarAllocator_t
const AMP_MPI & getComm() const override
Get the communicator.
bool hasGhosts() const override
Check if any entries "owned" by other cores are stored on this core.
void setCommunicationList(std::shared_ptr< CommunicationList > comm) override
Set the CommunicationList for this Vector.
bool containsGlobalElement(size_t) const override
void registerChildObjects(AMP::IO::RestartManager *manager) const override
Register any child objects.
size_t d_ghostSize
size/length of ghost and add buffers
TYPE * d_SendRecv
Buffers for sending/receiving data.
void fillGhosts(const Scalar &) override
Zero all ghost data (does not modify consistent status)
sizetAllocator_t d_size_t_alloc
std::shared_ptr< CommunicationList > d_CommList
typename std::allocator_traits< Allocator >::template rebind_alloc< int > intAllocator_t
std::vector< TYPE > d_Ghosts_h
std::shared_ptr< UpdateState > d_UpdateState
void setUpdateStatus(UpdateState state) override
Sets the current update state of the Vector.
void setNoGhosts() override
Ensure this vector has no ghosts.
std::vector< TYPE > d_AddBuffer_h
virtual bool allGhostIndices(size_t N, const size_t *ndx) const
void makeConsistent(ScatterType t) override
Update shared values on entire communicator.
size_t getAllGhostValues(void *vals, const typeID &id) const override
Get all ghost values in the vector.
GhostDataHelper(std::shared_ptr< CommunicationList >)
void addGhostValuesByGlobalID(size_t num, const size_t *indices, const void *vals, const typeID &id) override
Add shared values using global identifier.
void getGhostAddValuesByGlobalID(size_t num, const size_t *indices, void *vals, const typeID &id) const override
get ghosted values to add to off-proc elements
void setGhostValuesByGlobalID(size_t num, const size_t *indices, const void *vals, const typeID &id) override
Set ghost values using global identifier.
A class used to hold vector data.
void getGhostAddValuesByGlobalID(size_t num, const size_t *indices, TYPE *vals) const
get ghosted values to add to off-proc elements
void addGhostValuesByGlobalID(size_t num, const size_t *indices, const TYPE *vals)
Add shared values using global identifier.
void setGhostValuesByGlobalID(size_t num, const size_t *indices, const TYPE *vals)
Set ghost values using global identifier.
void getGhostValuesByGlobalID(size_t num, const size_t *indices, TYPE *vals) const
Get ghost values in the vector by their global offset.
virtual void makeConsistent()
Update shared values on entire communicator.
Scalar is a class used to store a scalar variable that may be different types/precision.
UpdateState
The four states a Vector can be in.
ScatterType
Flag to choose algorithm for makeConsistent.
Class to store type info.