MPQC  3.0.0-alpha
sc::MemoryIter Class Reference

This iterates through data in a global array. More...

#include <util/group/memiter.h>

Public Member Functions

 MemoryIter (void *data, distsize_t *offsets, size_t n)
 Create the MemoryIter. More...
 
void begin (distsize_t offset, size_t size)
 Initialize the iterator to a block of the global array. More...
 
int ready ()
 Returns true if there is more data to process.
 
void next ()
 Advance to the next subblock.
 
void * data ()
 The local offset for the current block within the data array given to the constructor.
 
int node ()
 The node on which the current subblock resides.
 
size_t offset ()
 The local offset of the current subblock on the node.
 
size_t size ()
 The size of the current subblock.
 
bool local (distsize_t offset, size_t size, int node)
 Returns true if all data is local to node.
 

Detailed Description

This iterates through data in a global array.

Given an offset and size for data in a globally distributed array, this iterates through the nodes that store the block, giving the size and location of the subblocks resident on each of these nodes.

Constructor & Destructor Documentation

◆ MemoryIter()

sc::MemoryIter::MemoryIter ( void *  data,
distsize_t *  offsets,
size_t  n 
)

Create the MemoryIter.

Parameters
dataan array with n bytes. It is up to the programmer to read/write this array, MemoryIter only maintains the current pointer within this array (see the data() member).
offsetsthe global offset for part stored on each node. This has one entry for each node.
nthe number of nodes

Member Function Documentation

◆ begin()

void sc::MemoryIter::begin ( distsize_t  offset,
size_t  size 
)

Initialize the iterator to a block of the global array.

Parameters
offsetthe offset for the block.
sizethe number of bytes in the block.

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

Generated at Sun Jan 26 2020 23:24:07 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.