12 #ifndef SST_CORE_CORE_SHAREDREGION_H
13 #define SST_CORE_CORE_SHAREDREGION_H
15 #include <sst/core/sst_types.h>
39 virtual bool merge(uint8_t *target,
const uint8_t *newData,
size_t size);
40 virtual bool merge(uint8_t *target,
size_t size,
const std::vector<ChangeSet> &changeSets);
48 defVal = defaultValue;
51 bool merge(uint8_t *target,
const uint8_t *newData,
size_t size)
override;
60 virtual void modifyRegion(
SharedRegion *sr,
size_t offset,
size_t length,
const void *data) = 0;
62 virtual const void* getConstPtr(
const SharedRegion* sr)
const = 0;
65 virtual SharedRegion* getLocalSharedRegion(
const std::string &key,
size_t size, uint8_t initByte = 0) = 0;
72 virtual void updateState(
bool finalize) = 0;
85 size_t size) : manager(manager), id(
id),
94 void shutdown() { manager->shutdownSharedRegion(
this); }
109 void publish() { manager->publishRegion(
this); }
114 bool isReady()
const {
return manager->isRegionReady(
this); }
121 { manager->modifyRegion(
this, offset, length, data); }
124 void modifyArray(
size_t offset,
const T &data)
125 { manager->modifyRegion(
this, offset*
sizeof(T),
sizeof(T), &data); }
138 return static_cast<T
>(manager->getConstPtr(
this));
void modifyRegion(size_t offset, size_t length, const void *data)
Before the region has published, apply a modification.
Definition: sharedRegion.h:120
Definition: sharedRegion.h:77
bool merge(uint8_t *target, const uint8_t *newData, size_t size) override
Merge the data from 'newData' into 'target'.
Definition: sharedRegion.cc:78
bool isReady() const
Definition: sharedRegion.h:114
void * getRawPtr()
Definition: sharedRegion.h:131
Utility class to define how to merge multiple pieces of shared memory regions Useful in the multi-MPI...
Definition: sharedRegion.h:30
void publish()
Call to denote that you are done making any changes to this region.
Definition: sharedRegion.h:109
size_t getLocalShareID() const
Definition: sharedRegion.h:99
T getPtr() const
Definition: sharedRegion.h:137
virtual bool merge(uint8_t *target, const uint8_t *newData, size_t size)
Merge the data from 'newData' into 'target'.
Definition: sharedRegion.h:44
size_t getSize() const
Definition: sharedRegion.h:104
Definition: sharedRegion.h:56