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;
53 bool merge(uint8_t *target,
size_t size,
const std::vector<ChangeSet> &changeSets)
override {
64 virtual void modifyRegion(
SharedRegion *sr,
size_t offset,
size_t length,
const void *data) = 0;
66 virtual const void* getConstPtr(
const SharedRegion* sr)
const = 0;
69 virtual SharedRegion* getLocalSharedRegion(
const std::string &key,
size_t size, uint8_t initByte = 0) = 0;
76 virtual void updateState(
bool finalize) = 0;
89 size_t size) : manager(manager), id(
id),
98 void shutdown() { manager->shutdownSharedRegion(
this); }
113 void publish() { manager->publishRegion(
this); }
118 bool isReady()
const {
return manager->isRegionReady(
this); }
125 { manager->modifyRegion(
this, offset, length, data); }
128 void modifyArray(
size_t offset,
const T &data)
129 { manager->modifyRegion(
this, offset*
sizeof(T),
sizeof(T), &data); }
142 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:124
Definition: sharedRegion.h:81
bool merge(uint8_t *target, const uint8_t *newData, size_t size) override
Merge the data from 'newData' into 'target'.
Definition: sharedRegion.cc:77
bool isReady() const
Definition: sharedRegion.h:118
void * getRawPtr()
Definition: sharedRegion.h:135
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:113
size_t getLocalShareID() const
Definition: sharedRegion.h:103
T getPtr() const
Definition: sharedRegion.h:141
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:108
Definition: sharedRegion.h:60