Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

MessageGrp Class Reference

The MessageGrp abstract class provides a mechanism for moving data and objects between nodes in a parallel machine. More...

#include <message.h>

Inheritance diagram for MessageGrp

Inheritance graph
[legend]
Collaboration diagram for MessageGrp:

Collaboration graph
[legend]
List of all members.

Public Methods

 MessageGrp ()
 MessageGrp (const Ref< KeyVal > &)
virtual ~MessageGrp ()
int n ()
 Returns the number of processors.

int me ()
 Returns my processor number. In the range [0,n()).

virtual void send (int target, double *data, int ndata)
 Send messages sequentially to the target processor. More...

virtual void send (int target, unsigned int *data, int ndata)
virtual void send (int target, int *data, int ndata)
virtual void send (int target, char *data, int nbyte)
virtual void send (int target, unsigned char *data, int nbyte)
virtual void send (int target, signed char *data, int nbyte)
virtual void send (int target, short *data, int ndata)
virtual void send (int target, long *data, int ndata)
virtual void send (int target, float *data, int ndata)
void send (int target, double data)
void send (int target, int data)
virtual void raw_send (int target, void *data, int nbyte)=0
virtual void sendt (int target, int type, double *data, int ndata)
 Send typed messages to the target processor. More...

virtual void sendt (int target, int type, unsigned int *data, int ndata)
virtual void sendt (int target, int type, int *data, int ndata)
virtual void sendt (int target, int type, char *data, int nbyte)
virtual void sendt (int target, int type, unsigned char *data, int nbyte)
virtual void sendt (int target, int type, signed char *data, int nbyte)
virtual void sendt (int target, int type, short *data, int ndata)
virtual void sendt (int target, int type, long *data, int ndata)
virtual void sendt (int target, int type, float *data, int ndata)
void sendt (int target, int type, double data)
void sendt (int target, int type, int data)
virtual void raw_sendt (int target, int type, void *data, int nbyte)=0
virtual void recv (int sender, double *data, int ndata)
 Receive messages sent sequentually from the sender. More...

virtual void recv (int sender, unsigned int *data, int ndata)
virtual void recv (int sender, int *data, int ndata)
virtual void recv (int sender, char *data, int nbyte)
virtual void recv (int sender, unsigned char *data, int nbyte)
virtual void recv (int sender, signed char *data, int nbyte)
virtual void recv (int sender, short *data, int ndata)
virtual void recv (int sender, long *data, int ndata)
virtual void recv (int sender, float *data, int ndata)
void recv (int sender, double &data)
void recv (int sender, int &data)
virtual void raw_recv (int sender, void *data, int nbyte)=0
virtual void recvt (int type, double *data, int ndata)
 Receive messages sent by type. More...

virtual void recvt (int type, unsigned int *data, int ndata)
virtual void recvt (int type, int *data, int ndata)
virtual void recvt (int type, char *data, int nbyte)
virtual void recvt (int type, unsigned char *data, int nbyte)
virtual void recvt (int type, signed char *data, int nbyte)
virtual void recvt (int type, short *data, int ndata)
virtual void recvt (int type, long *data, int ndata)
virtual void recvt (int type, float *data, int ndata)
void recvt (int type, double &data)
void recvt (int type, int &data)
virtual void raw_recvt (int type, void *data, int nbyte)=0
virtual int probet (int type)=0
 Ask if a given typed message has been received.

virtual void bcast (double *data, int ndata, int from=0)
 Do broadcasts of various types of data. More...

virtual void bcast (unsigned int *data, int ndata, int from=0)
virtual void bcast (int *data, int ndata, int from=0)
virtual void bcast (char *data, int nbyte, int from=0)
virtual void bcast (unsigned char *data, int nbyte, int from=0)
virtual void bcast (signed char *data, int nbyte, int from=0)
virtual void bcast (short *data, int ndata, int from=0)
virtual void bcast (long *data, int ndata, int from=0)
virtual void bcast (float *data, int ndata, int from=0)
virtual void raw_bcast (void *data, int nbyte, int from=0)
void bcast (double &data, int from=0)
void bcast (int &data, int from=0)
virtual void raw_collect (const void *part, const int *lengths, void *whole, int bytes_per_datum=1)
 Collect data distributed on the nodes to a big array replicated on each node.

void collect (const double *part, const int *lengths, double *whole)
virtual void sum (double *data, int n, double *=0, int target=-1)
 Global sum reduction. More...

virtual void sum (unsigned int *data, int n, unsigned int *=0, int target=-1)
virtual void sum (int *data, int n, int *=0, int target=-1)
virtual void sum (char *data, int n, char *=0, int target=-1)
virtual void sum (unsigned char *data, int n, unsigned char *=0, int target=-1)
virtual void sum (signed char *data, int n, signed char *=0, int target=-1)
void sum (double &data)
void sum (int &data)
virtual void max (double *data, int n, double *=0, int target=-1)
 Global maximization. More...

virtual void max (int *data, int n, int *=0, int target=-1)
virtual void max (unsigned int *data, int n, unsigned int *=0, int target=-1)
virtual void max (char *data, int n, char *=0, int target=-1)
virtual void max (unsigned char *data, int n, unsigned char *=0, int target=-1)
virtual void max (signed char *data, int n, signed char *=0, int target=-1)
void max (double &data)
void max (int &data)
virtual void min (double *data, int n, double *=0, int target=-1)
 Global minimization. More...

virtual void min (int *data, int n, int *=0, int target=-1)
virtual void min (unsigned int *data, int n, unsigned int *=0, int target=-1)
virtual void min (char *data, int n, char *=0, int target=-1)
virtual void min (unsigned char *data, int n, unsigned char *=0, int target=-1)
virtual void min (signed char *data, int n, signed char *=0, int target=-1)
void min (double &data)
void min (int &data)
virtual void reduce (double *, int n, GrpReduce< double > &, double *scratch=0, int target=-1)
 Global generic reduction. More...

virtual void reduce (int *, int n, GrpReduce< int > &, int *scratch=0, int target=-1)
virtual void reduce (unsigned int *, int n, GrpReduce< unsigned int > &, unsigned int *scratch=0, int target=-1)
virtual void reduce (char *, int n, GrpReduce< char > &, char *scratch=0, int target=-1)
virtual void reduce (unsigned char *, int n, GrpReduce< unsigned char > &, unsigned char *scratch=0, int target=-1)
virtual void reduce (signed char *, int n, GrpReduce< signed char > &, signed char *scratch=0, int target=-1)
virtual void reduce (short *, int n, GrpReduce< short > &, short *scratch=0, int target=-1)
virtual void reduce (float *, int n, GrpReduce< float > &, float *scratch=0, int target=-1)
virtual void reduce (long *, int n, GrpReduce< long > &, long *scratch=0, int target=-1)
void reduce (double &data, GrpReduce< double > &r)
void reduce (int &data, GrpReduce< int > &r)
virtual void sync ()
 Synchronize all of the processors.

virtual int last_source ()=0
 Returns information about the last message received or probed.

virtual int last_size ()=0
virtual int last_type ()=0
int classdesc_to_index (const ClassDesc *)
 Each message group maintains an association of ClassDesc with a global index so SavableState information can be sent between nodes without needing to send the classname and look up the ClassDesc with each transfer. More...

const ClassDescindex_to_classdesc (int)
int nclass () const

Static Public Methods

void set_default_messagegrp (const Ref< MessageGrp > &)
 The default message group contains the primary message group to be used by an application.

MessageGrp* get_default_messagegrp ()
 Returns the default message group.

MessageGrp* initial_messagegrp (int &argc, char **argv)
 Create a message group. More...


Protected Methods

void initialize (int me, int n)
 The classdesc_to_index_ and index_to_classdesc_ arrays cannot be initialized by the MessageGrp CTOR, because the MessageGrp specialization has not yet been initialized and communication is not available. More...


Protected Attributes

Ref<MachineTopology> topology_
int debug_

Detailed Description

The MessageGrp abstract class provides a mechanism for moving data and objects between nodes in a parallel machine.


Member Function Documentation

void MessageGrp::bcast ( double * data,
int ndata,
int from = 0 ) [virtual]
 

Do broadcasts of various types of data.

Similar members exist for each of the basic types.

int MessageGrp::classdesc_to_index ( const ClassDesc * )
 

Each message group maintains an association of ClassDesc with a global index so SavableState information can be sent between nodes without needing to send the classname and look up the ClassDesc with each transfer.

These routines return information about that mapping.

MessageGrp * MessageGrp::initial_messagegrp ( int & argc,
char ** argv ) [static]
 

Create a message group.

This routine looks for a -messagegrp argument, then the environmental variable MESSAGEGRP to decide which specialization of MessageGrp would be appropriate. The argument to -messagegrp should be either string for a ParsedKeyVal constructor or a classname. If this returns null, it is up to the programmer to create a MessageGrp.

void MessageGrp::initialize ( int me,
int n ) [protected]
 

The classdesc_to_index_ and index_to_classdesc_ arrays cannot be initialized by the MessageGrp CTOR, because the MessageGrp specialization has not yet been initialized and communication is not available.

CTOR's of specializations of MessageGrp must call the initialize member in their body to complete the initialization process.

void MessageGrp::max ( double * data,
int n,
double * = 0,
int target = -1 ) [virtual]
 

Global maximization.

Similar members exist for each of the basic types.

void MessageGrp::min ( double * data,
int n,
double * = 0,
int target = -1 ) [virtual]
 

Global minimization.

Similar members exist for each of the basic types.

void MessageGrp::recv ( int sender,
double * data,
int ndata ) [virtual]
 

Receive messages sent sequentually from the sender.

Similar members exist for each of the basic types.

void MessageGrp::recvt ( int type,
double * data,
int ndata ) [virtual]
 

Receive messages sent by type.

Similar members exist for each of the basic types.

void MessageGrp::reduce ( double *,
int n,
GrpReduce< double > &,
double * scratch = 0,
int target = -1 ) [virtual]
 

Global generic reduction.

Similar members exist for each of the basic types.

Reimplemented in MPIMessageGrp.

void MessageGrp::send ( int target,
double * data,
int ndata ) [virtual]
 

Send messages sequentially to the target processor.

Similar members exist for each of the basic types.

void MessageGrp::sendt ( int target,
int type,
double * data,
int ndata ) [virtual]
 

Send typed messages to the target processor.

Similar members exist for each of the basic types.

void MessageGrp::sum ( double * data,
int n,
double * = 0,
int target = -1 ) [virtual]
 

Global sum reduction.

Similar members exist for each of the basic types.


The documentation for this class was generated from the following file:
Generated at Thu Oct 4 18:09:21 2001 for MPQC 2.0.0 using the documentation package Doxygen 1.2.5.