MPQC
3.0.0-alpha
|
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. | |
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.
sc::MemoryIter::MemoryIter | ( | void * | data, |
distsize_t * | offsets, | ||
size_t | n | ||
) |
Create the MemoryIter.
data | an 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). |
offsets | the global offset for part stored on each node. This has one entry for each node. |
n | the number of nodes |
void sc::MemoryIter::begin | ( | distsize_t | offset, |
size_t | size | ||
) |
Initialize the iterator to a block of the global array.
offset | the offset for the block. |
size | the number of bytes in the block. |