MPQC  3.0.0-alpha
sc::MemoryGrpBuf< data_t > Class Template Reference

The MemoryGrpBuf class provides access to pieces of the global shared memory that have been obtained with MemoryGrp. More...

#include <util/group/memory.h>

Public Member Functions

 MemoryGrpBuf (const Ref< MemoryGrp > &)
 Creates a new MemoryGrpBuf given a MemoryGrp reference. More...
 
data_t * writeonly (distsize_t offset, size_t length)
 Request write only access to global memory at the global address offset and with size length. More...
 
data_t * readwrite (distsize_t offset, size_t length)
 Request read write access to global memory at the global address offset and with size length. More...
 
const data_t * readonly (distsize_t offset, size_t length)
 Request read only access to global memory at the global address offset and with size length. More...
 
data_t * writeonly_on_node (size_t offset, size_t length, int node=-1)
 This behaves like writeonly, except the offset is local to the node specified by node. More...
 
data_t * readwrite_on_node (size_t offset, size_t length, int node=-1)
 This behaves like readwrite, except the offset is local to the node specified by node. More...
 
const data_t * readonly_on_node (size_t offset, size_t length, int node=-1)
 This behaves like readonly, except the offset is local to the node specified by node. More...
 
void release ()
 Release the access to the chunk of global memory that was obtained with writeonly, readwrite, readonly, writeonly_on_node, readwrite_on_node, and readonly_on_node.
 
size_t length () const
 The length of the current bit of memory.
 

Detailed Description

template<class data_t>
class sc::MemoryGrpBuf< data_t >

The MemoryGrpBuf class provides access to pieces of the global shared memory that have been obtained with MemoryGrp.

MemoryGrpBuf is a template class that is parameterized on data_t. All lengths and offsets of given in terms of sizeof(data_t).

Constructor & Destructor Documentation

◆ MemoryGrpBuf()

template<class data_t >
sc::MemoryGrpBuf< data_t >::MemoryGrpBuf ( const Ref< MemoryGrp > &  grp)

Creates a new MemoryGrpBuf given a MemoryGrp reference.

This is a template class parameterized on data_t.

Member Function Documentation

◆ readonly()

template<class data_t >
const data_t * sc::MemoryGrpBuf< data_t >::readonly ( distsize_t  offset,
size_t  length 
)

Request read only access to global memory at the global address offset and with size length.

Writing to the specified region without an intervening sync of the MemoryGrp will have undefined results.

◆ readonly_on_node()

template<class data_t >
const data_t * sc::MemoryGrpBuf< data_t >::readonly_on_node ( size_t  offset,
size_t  length,
int  node = -1 
)

This behaves like readonly, except the offset is local to the node specified by node.

If node = -1, then the local node is used.

◆ readwrite()

template<class data_t >
data_t * sc::MemoryGrpBuf< data_t >::readwrite ( distsize_t  offset,
size_t  length 
)

Request read write access to global memory at the global address offset and with size length.

This will lock the memory it uses until release is called unless locking has been turned off in the MemoryGrp object.

◆ readwrite_on_node()

template<class data_t >
data_t * sc::MemoryGrpBuf< data_t >::readwrite_on_node ( size_t  offset,
size_t  length,
int  node = -1 
)

This behaves like readwrite, except the offset is local to the node specified by node.

If node = -1, then the local node is used.

◆ writeonly()

template<class data_t >
data_t * sc::MemoryGrpBuf< data_t >::writeonly ( distsize_t  offset,
size_t  length 
)

Request write only access to global memory at the global address offset and with size length.

Writing the same bit of memory twice without an intervening sync of the MemoryGrp will have undefined results.

◆ writeonly_on_node()

template<class data_t >
data_t * sc::MemoryGrpBuf< data_t >::writeonly_on_node ( size_t  offset,
size_t  length,
int  node = -1 
)

This behaves like writeonly, except the offset is local to the node specified by node.

If node = -1, then the local node is used.


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.