30#ifndef _util_group_actmsg_h
31#define _util_group_actmsg_h
35#include <util/group/thread.h>
36#include <util/group/memmsg.h>
37#include <util/group/mstate.h>
41class ActiveMessageGrp;
73 unsigned int nreq_recd_;
79 unsigned int nreq_recd() {
return nreq_recd_; }
80 void set_nreq_recd(
unsigned int val) { nreq_recd_ = val; }
90 unsigned int *nreq_sent_;
133 int n()
const {
return msg_->n(); }
135 int me()
const {
return msg_->me(); }
This is an ActiveMessage derivative used for testing.
Definition actmsg.h:58
void run(int sender, int type, ActiveMessageGrp *context)
This is called when ActiveMessageGrp is used to send an ActiveMessage object to a process.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
ActiveMessageGrp provides an implemention of active messages that sends objects derived from ActiveMe...
Definition actmsg.h:87
Ref< StateSend > get_statesend()
Each thread using the ActiveMessageGrp needs its own StateSend object.
ActiveMessageGrp(const Ref< MessageGrp > &msg, const Ref< ThreadGrp > &thr)
Construct an ActiveMessageGrp using a MessageGrp and a ThreadGrp.
void send(int node, const Ref< StateSend > &, const Ref< ActiveMessage > &)
Send the active message to node.
void activate()
Make the object ready to process messages.
void deactivate()
Processes all outstanding messages and disable processing of messages.
Ref< MessageGrp > messagegrp()
Return the MessageGrp used to implement the ActiveMessageGrp.
Definition actmsg.h:130
int n() const
Return the number of processes.
Definition actmsg.h:133
void sync()
Synchronize all of the processes in this group.
ActiveMessageGrp(const Ref< KeyVal > &)
A KeyVal CTOR for ActiveMessageGrp.
int me() const
Return my process identifier, starting at zero.
Definition actmsg.h:135
This is a help class that is used by ActiveMessageGrp.
Definition actmsg.h:69
void run()
This is called with the Thread is run from a ThreadGrp.
Derivatives of ActiveMessage can be constructed in one process and executed in another by using Activ...
Definition actmsg.h:46
virtual void run(int sender, int type, ActiveMessageGrp *context)=0
This is called when ActiveMessageGrp is used to send an ActiveMessage object to a process.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
Definition actmsg.h:50
Classes which need runtime information about themselves and their relationship to other classes can v...
Definition class.h:233
A template class that maintains references counts.
Definition ref.h:361
Base class for objects that can save/restore state.
Definition state.h:45
Restores fundamental and user-defined types from images created with StateOut.
Definition statein.h:79
Serializes fundamental and user-defined types.
Definition stateout.h:71
The Thread abstract class defines an interface which must be implemented by classes wishing to be run...
Definition thread.h:75
Contains all MPQC code up to version 3.
Definition mpqcin.h:14