62 bool empty(
int treeId,
int stackId)
const;
120 if (
_data[localTreeNumber]._stackNumberToData.count(stackNumber)==0 ) {
121 _data[localTreeNumber]._stackNumberToData.insert(
122 std::pair< int, T* >(
134 assertion3(localTreeId>=0,localTreeId,treeId,stackId);
136 return _data[localTreeId]._stackNumberToData.count(stackId)==0
137 or
_data[localTreeId]._stackNumberToData.at(stackId)->empty();
156 assertion3(localTreeId>=0,localTreeId,key.first,key.second);
157 assertion4(localTreeId<
static_cast<int>(
_data.size()),localTreeId,
_data.size(),key.first,key.second);
158 return _data[localTreeId]._stackNumberToData.count(key.second)==1;
165 assertion3(localTreeId>=0,localTreeId,key.first,key.second);
166 assertion4(localTreeId<
static_cast<int>(
_data.size()),localTreeId,
_data.size(),key.first,key.second);
169 return _data[localTreeId]._stackNumberToData[key.second];
182 assertion3(localTreeId>=0,localTreeId,key.first,key.second);
183 assertion4(localTreeId<
static_cast<int>(
_data.size()),localTreeId,
_data.size(),key.first,key.second);
184 assertion4(
_data[localTreeId]._stackNumberToData.count(key.second)==1,localTreeId,
_data.size(),key.first,key.second);
185 assertion3(key.second>=0,localTreeId,key.first,key.second);
186 return _data[localTreeId]._stackNumberToData.at(key.second);
192 std::string result =
"(" + std::to_string(
_data.size() );
206 std::set<peano4::maps::StackKey> result;
207 for (
int i = 0; i < static_cast<int>(
_data.size()); i++) {
208 for (
auto& pp:
_data[i]._stackNumberToData) {
218 for (
auto& p:
_data) {
219 for (
auto& pp: p._stackNumberToData) {
235 if (
static_cast<int>(
_data.size()) > localTreeId) {
236 for (
auto& p:
_data[localTreeId]._stackNumberToData) {
252 for (
auto& p:
_data) {
253 for (
auto& pp: p._stackNumberToData) {
254 if (pp.second->empty()) {
266 if (
static_cast<int>(
_data.size()) > localTreeId) {
267 for (
auto& p:
_data[localTreeId]._stackNumberToData) {
#define assertion4(expr, param0, param1, param2, param3)
#define assertion3(expr, param0, param1, param2)
void createStack(int localTreeNumber, int stackNumber)
This routine is not thread-safe, i.e.
std::string toString() const
void clear(int spacetree)
T * getForPush(const StackKey &key)
T * getForPush(int treeId, int stackId)
Get the stack belonging to a tree.
std::set< StackKey > getKeys()
This one should be const, but I might need a semaphore, so I have to omit the const qualifier.
T * getForPop(const StackKey &key)
bool holdsStack(int treeId, int stackId) const
For debugging/assertions.
std::vector< TreeData > _data
void garbageCollection(int spacetree)
bool empty(int treeId, int stackId) const
T * getForPop(int treeId, int stackId)
bool holdsStack(const StackKey &key) const
int getLocalTreeId(int treeId) const
static bool isStorageStackNumber(int number)
There are communication stacks and storage stacks.
static Node & getInstance()
This operation returns the singleton instance.
static Rank & getInstance()
This operation returns the singleton instance.
The parallel namespace is Peano's core abstracts from both MPI and multicore parallelisation.
The map namespaces hosts various map implementations.
std::pair< int, int > StackKey
Unique key identifying a stack.
std::map< int, T * > _stackNumberToData