SC_MEMORYGRPBUF(3)

πŸ“¦
version 2.3.1 Β· 4 versions
, in ubuntu jammy

🌸 NAME 🌸

okay bestie, welcome to the sc::MemoryGrpBuf< data_t >(3) manual page β€” manual name folded in near the top, no boring header line, we move. πŸ’…βœ¨ The MemoryGrpBuf class gives you access to pieces of the global shared memory that have been obtained with MemoryGrp. That's the whole point, periodt.


✨ SYNOPSIS ✨

The include is literally:

#include <memory.h>

πŸ’… Public Member Functions

  • MemoryGrpBuf (const Ref< MemoryGrp > &) β€” Creates a new MemoryGrpBuf given a MemoryGrp reference.
  • data_t * writeonly (distsize_t offset, int length) β€” Request write only access to global memory at the global address offset and with size length.
  • data_t * readwrite (distsize_t offset, int length) β€” Request read write access to global memory at the global address offset and with size length.
  • const data_t * readonly (distsize_t offset, int length) β€” Request read only access to global memory at the global address offset and with size length.
  • data_t * writeonly_on_node (size_t offset, int length, int node=-1) β€” These behave like writeonly, readwrite, and readonly, except the offset is local to the node specified by node.
  • data_t * readwrite_on_node (size_t offset, int length, int node=-1) β€” Same _on_node deal as above, but for readwrite: offset is local to node.
  • const data_t * readonly_on_node (size_t offset, int length, int node=-1) β€” Same _on_node deal as above, but for readonly: offset is local to node.
  • 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.
  • int length () const β€” The length of the current bit of memory.

πŸ¦‹ Detailed Description πŸ¦‹

The template declaration line is exactly:

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

Yes, that trailing " is in the source, and we are not fixing it β€” details are details. 😭

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 are given in terms of sizeof(data_t). That's the unit, bestie. 🫢


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

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. Yes, we said it again, because the original said it again. πŸ’…


πŸ”₯ Member Function Documentation πŸ”₯

🌟 readonly

template<class data_t > const data_t * sc::MemoryGrpBuf< data_t >::readonly (distsize_t offset, int 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. Translation: do not write there before a sync, fr fr. 😭

🌟 readwrite

template<class data_t > data_t * sc::MemoryGrpBuf< data_t >::readwrite (distsize_t offset, int 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. So call release, bestie β€” that's the exit. πŸ’…

🌟 writeonly

template<class data_t > data_t * sc::MemoryGrpBuf< data_t >::writeonly (distsize_t offset, int 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. Do not double-write before a sync; undefined behavior is not the cute kind of chaos. πŸ’€

🌟 writeonly_on_node

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

The _on_node crew is writeonly_on_node, readwrite_on_node, and readonly_on_node, and this is their shared behavior: they behave like writeonly, readwrite, and readonly, except the offset is local to the node specified by node. If node = -1, then the local node is used.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for MPQC from the source code. The robots wrote it; we gave it sparkle. ✨


πŸ’– cute sign-off: MPQC version 2.3.1, dated Sun Oct 4 2020, manual sc::MemoryGrpBuf< data_t >(3). bye bestie! πŸ’–

πŸ“¦ where this page comes from