MPQC
3.0.0-alpha
|
ActiveMessageGrp provides an implemention of active messages that sends objects derived from ActiveMessage to remote processes and causes their run member to be executed there. More...
#include <util/group/actmsg.h>
Public Member Functions | |
ActiveMessageGrp (const Ref< MessageGrp > &msg, const Ref< ThreadGrp > &thr) | |
Construct an ActiveMessageGrp using a MessageGrp and a ThreadGrp. | |
ActiveMessageGrp (const Ref< KeyVal > &) | |
A KeyVal CTOR for ActiveMessageGrp. | |
Ref< StateSend > | get_statesend () |
Each thread using the ActiveMessageGrp needs its own StateSend object. More... | |
void | send (int node, const Ref< StateSend > &, const Ref< ActiveMessage > &) |
Send the active message to node. More... | |
void | activate () |
Make the object ready to process messages. More... | |
void | deactivate () |
Processes all outstanding messages and disable processing of messages. More... | |
void | sync () |
Synchronize all of the processes in this group. | |
Ref< MessageGrp > | messagegrp () |
Return the MessageGrp used to implement the ActiveMessageGrp. | |
int | n () const |
Return the number of processes. | |
int | me () const |
Return my process identifier, starting at zero. | |
Public Member Functions inherited from sc::DescribedClass | |
DescribedClass (const DescribedClass &) | |
DescribedClass & | operator= (const DescribedClass &) |
ClassDesc * | class_desc () const MPQC__NOEXCEPT |
This returns the unique pointer to the ClassDesc corresponding to the given type_info object. More... | |
const char * | class_name () const |
Return the name of the object's exact type. | |
int | class_version () const |
Return the version of the class. | |
virtual void | print (std::ostream &=ExEnv::out0()) const |
Print the object. | |
Ref< DescribedClass > | ref () |
Return this object wrapped up in a Ref smart pointer. More... | |
Public Member Functions inherited from sc::RefCount | |
size_t | identifier () const |
Return the unique identifier for this object that can be compared for different objects of different types. More... | |
int | lock_ptr () const |
Lock this object. | |
int | unlock_ptr () const |
Unlock this object. | |
void | use_locks (bool inVal) |
start and stop using locks on this object | |
refcount_t | nreference () const |
Return the reference count. | |
refcount_t | reference () |
Increment the reference count and return the new count. | |
refcount_t | dereference () |
Decrement the reference count and return the new count. | |
int | managed () const |
void | unmanage () |
Turn off the reference counting mechanism for this object. More... | |
Protected Member Functions | |
void | init (const Ref< MessageGrp > &msg, const Ref< ThreadGrp > &thr) |
Protected Member Functions inherited from sc::RefCount | |
RefCount (const RefCount &) | |
RefCount & | operator= (const RefCount &) |
Protected Attributes | |
int | active_ |
unsigned int * | nreq_sent_ |
ActiveMessageThread ** | thread_ |
int | statesend_type_ |
Ref< MessageGrp > | msg_ |
Ref< ThreadGrp > | thr_ |
ActiveMessageGrp provides an implemention of active messages that sends objects derived from ActiveMessage to remote processes and causes their run member to be executed there.
void sc::ActiveMessageGrp::activate | ( | ) |
Make the object ready to process messages.
This will also synchronizes the nodes. This must be called by only one thread.
void sc::ActiveMessageGrp::deactivate | ( | ) |
Processes all outstanding messages and disable processing of messages.
This will also synchronize the processes. This must be called by only one thread.
Each thread using the ActiveMessageGrp needs its own StateSend object.
This cannot be called concurrently by multiple threads.
void sc::ActiveMessageGrp::send | ( | int | node, |
const Ref< StateSend > & | , | ||
const Ref< ActiveMessage > & | |||
) |
Send the active message to node.
The give StateOut must not be concurrently used by any other thread. This member can be called concurrently by multiple threads.