The MessageGrp abstract class provides a way of accessing distributed memory in a parallel machine.
Several specializations are available. For one processor, ProcMemoryGrp provides a simple stub implementation. Otherwise, the specializations that work well are ShmMemoryGrp, ParagonMemoryGrp, and MPLMemoryGrp. If your parallel operation system and libraries do not directly support active messages or global shared memory you can try IParagonMemoryGrp or MPIMemoryGrp, as is appropriate. However, these latter specializations do not always work and perform poorly.
If a MemoryGrp is not given to the program, then one will be automatically chosen depending on which MessageGrp is used by default, the type of machine on which the code was compiled, and what options were given at configuration time. The following rules are applied until the first matching set of criteria are found.
\item If there is only one processor, then ProcMemoryGrp is used.
\item Otherwise, no memory group can be created.
\end{itemize}
Member Function Documentation
virtual void sc::MemoryGrp::catchup
(
)
[virtual]
Processes outstanding requests.
Some memory group implementations don't have access to real shared memory or even active messages. Instead, requests are processed whenever certain memory group routines are called. This can cause large latencies and buffer overflows. If this is a problem, then the catchup member can be called to process all outstanding requests.
MemoryGrp* sc::MemoryGrp::initial_memorygrp
(
int &
argc,
char **
argv
)
[static]
Create a memory group.
This routine looks for a -memorygrp argument, then the environmental variable MEMORYGRP, and, finally, the default MessageGrp object to decide which specialization of MemoryGrp would be appropriate. The argument to -memorygrp should be either string for a ParsedKeyVal constructor or a classname. The default ThreadGrp and MessageGrp objects should be initialized before this is called.
virtual void* sc::MemoryGrp::obtain_readwrite
(
distsize_t
offset,
int
size
)
[pure virtual]
Only one thread can have an unreleased obtain_readwrite at a time.
The actual memory region locked can be larger than that requested. If the memory region is already locked this will block. For this reason, data should be held as read/write for as short a time as possible.