sc::MessageGrp(3)
π sc::MessageGrp(3) β MPQC π
πΈ NAME πΈ
sc::MessageGrp β bestie, this is the abstract class that provides a mechanism for moving data and objects between nodes in a parallel machine. Thatβs the whole vibe. π
β¨ SYNOPSIS β¨
#include <message.h>
Inherits sc::DescribedClass.
Inherited by sc::intMessageGrp, sc::MPIMessageGrp, and sc::ProcMessageGrp.
π Public Member Functions π
Okay so hereβs the entire public roster. Every overload is here, no skips, no βoops I left out the unsigned char one.β π
MessageGrp (const Ref< KeyVal > &)β the constructor, doing constructor things and taking aRef< KeyVal >.int n ()β hands you the number of processors. π«Άint me ()β tells you which processor you are, and itβs in the range[0,n()).virtual Ref< MessageGrp > clone (void)=0β returns a copy of thisMessageGrpspecialization with its own independent communication context. β¨virtual void send (int target, const double *data, int ndata)β sends messages sequentially over to the target processor.virtual void send (int target, const unsigned int *data, int ndata)β samesendenergy,unsigned intflavor.virtual void send (int target, const int *data, int ndata)β samesendenergy,intflavor.virtual void send (int target, const char *data, int nbyte)β samesendenergy,charflavor.virtual void send (int target, const unsigned char *data, int nbyte)β samesendenergy,unsigned charflavor.virtual void send (int target, const signed char *data, int nbyte)β samesendenergy,signed charflavor.virtual void send (int target, const short *data, int ndata)β samesendenergy,shortflavor.virtual void send (int target, const long *data, int ndata)β samesendenergy,longflavor.virtual void send (int target, const float *data, int ndata)β samesendenergy,floatflavor.void send (int target, double data)β singledouble, sent straight to the target.void send (int target, int data)β singleint, sent straight to the target.virtual void raw_send (int target, const void *data, int nbyte)=0β the raw send hook, pure virtual, no cap.virtual void sendt (int target, int type, const double *data, int ndata)β sends typed messages to the target processor. πvirtual void sendt (int target, int type, const unsigned int *data, int ndata)β typed send,unsigned intflavor.virtual void sendt (int target, int type, const int *data, int ndata)β typed send,intflavor.virtual void sendt (int target, int type, const char *data, int nbyte)β typed send,charflavor.virtual void sendt (int target, int type, const unsigned char *data, int nbyte)β typed send,unsigned charflavor.virtual void sendt (int target, int type, const signed char *data, int nbyte)β typed send,signed charflavor.virtual void sendt (int target, int type, const short *data, int ndata)β typed send,shortflavor.virtual void sendt (int target, int type, const long *data, int ndata)β typed send,longflavor.virtual void sendt (int target, int type, const float *data, int ndata)β typed send,floatflavor.void sendt (int target, int type, double data)β single typeddouble.void sendt (int target, int type, int data)β single typedint.virtual void raw_sendt (int target, int type, const void *data, int nbyte)=0β raw typed send hook, pure virtual.virtual void recv (int sender, double *data, int ndata)β receives messages sent sequentially from the sender. πvirtual void recv (int sender, unsigned int *data, int ndata)β receive,unsigned intflavor.virtual void recv (int sender, int *data, int ndata)β receive,intflavor.virtual void recv (int sender, char *data, int nbyte)β receive,charflavor.virtual void recv (int sender, unsigned char *data, int nbyte)β receive,unsigned charflavor.virtual void recv (int sender, signed char *data, int nbyte)β receive,signed charflavor.virtual void recv (int sender, short *data, int ndata)β receive,shortflavor.virtual void recv (int sender, long *data, int ndata)β receive,longflavor.virtual void recv (int sender, float *data, int ndata)β receive,floatflavor.void recv (int sender, double &data)β receive onedoubleby reference.void recv (int sender, int &data)β receive oneintby reference.virtual void raw_recv (int sender, void *data, int nbyte)=0β raw receive hook, pure virtual.virtual void recvt (int type, double *data, int ndata)β receives messages sent by type. π¦virtual void recvt (int type, unsigned int *data, int ndata)β typed receive,unsigned intflavor.virtual void recvt (int type, int *data, int ndata)β typed receive,intflavor.virtual void recvt (int type, char *data, int nbyte)β typed receive,charflavor.virtual void recvt (int type, unsigned char *data, int nbyte)β typed receive,unsigned charflavor.virtual void recvt (int type, signed char *data, int nbyte)β typed receive,signed charflavor.virtual void recvt (int type, short *data, int ndata)β typed receive,shortflavor.virtual void recvt (int type, long *data, int ndata)β typed receive,longflavor.virtual void recvt (int type, float *data, int ndata)β typed receive,floatflavor.void recvt (int type, double &data)β receive one typeddoubleby reference.void recvt (int type, int &data)β receive one typedintby reference.virtual void raw_recvt (int type, void *data, int nbyte)=0β raw typed receive hook, pure virtual.virtual int probet (int type)=0β asks whether a given typed message has been received. πvirtual void bcast (double *data, int ndata, int from=0)β does broadcasts for all kinds of data types. π£virtual void bcast (unsigned int *data, int ndata, int from=0)β broadcast,unsigned intflavor.virtual void bcast (int *data, int ndata, int from=0)β broadcast,intflavor.virtual void bcast (char *data, int nbyte, int from=0)β broadcast,charflavor.virtual void bcast (unsigned char *data, int nbyte, int from=0)β broadcast,unsigned charflavor.virtual void bcast (signed char *data, int nbyte, int from=0)β broadcast,signed charflavor.virtual void bcast (short *data, int ndata, int from=0)β broadcast,shortflavor.virtual void bcast (long *data, int ndata, int from=0)β broadcast,longflavor.virtual void bcast (float *data, int ndata, int from=0)β broadcast,floatflavor.virtual void raw_bcast (void *data, int nbyte, int from=0)β raw broadcast hook.void bcast (double &data, int from=0)β broadcast onedoubleby reference.void bcast (int &data, int from=0)β broadcast oneintby reference.virtual void raw_collect (const void *part, const int *lengths, void *whole, int bytes_per_datum=1)β collects data distributed on the nodes into a big array replicated on each node. π§void collect (const double *part, const int *lengths, double *whole)β thedoublecollect convenience overload.virtual void sum (double *data, int n, double *=0, int target=-1)β global sum reduction. π₯virtual void sum (unsigned int *data, int n, unsigned int *=0, int target=-1)β global sum reduction,unsigned intflavor.virtual void sum (int *data, int n, int *=0, int target=-1)β global sum reduction,intflavor.virtual void sum (char *data, int n, char *=0, int target=-1)β global sum reduction,charflavor.virtual void sum (unsigned char *data, int n, unsigned char *=0, int target=-1)β global sum reduction,unsigned charflavor.virtual void sum (signed char *data, int n, signed char *=0, int target=-1)β global sum reduction,signed charflavor.void sum (double &data)β sum onedoubleby reference.void sum (int &data)β sum oneintby reference.virtual void max (double *data, int n, double *=0, int target=-1)β global maximization. πvirtual void max (int *data, int n, int *=0, int target=-1)β global maximization,intflavor.virtual void max (unsigned int *data, int n, unsigned int *=0, int target=-1)β global maximization,unsigned intflavor.virtual void max (char *data, int n, char *=0, int target=-1)β global maximization,charflavor.virtual void max (unsigned char *data, int n, unsigned char *=0, int target=-1)β global maximization,unsigned charflavor.virtual void max (signed char *data, int n, signed char *=0, int target=-1)β global maximization,signed charflavor.void max (double &data)β max onedoubleby reference.void max (int &data)β max oneintby reference.virtual void min (double *data, int n, double *=0, int target=-1)β global minimization. πvirtual void min (int *data, int n, int *=0, int target=-1)β global minimization,intflavor.virtual void min (unsigned int *data, int n, unsigned int *=0, int target=-1)β global minimization,unsigned intflavor.virtual void min (char *data, int n, char *=0, int target=-1)β global minimization,charflavor.virtual void min (unsigned char *data, int n, unsigned char *=0, int target=-1)β global minimization,unsigned charflavor.virtual void min (signed char *data, int n, signed char *=0, int target=-1)β global minimization,signed charflavor.void min (double &data)β min onedoubleby reference.void min (int &data)β min oneintby reference.virtual void reduce (double *, int n, GrpReduce< double > &, double *scratch=0, int target=-1)β global generic reduction. βvirtual void reduce (int *, int n, GrpReduce< int > &, int *scratch=0, int target=-1)β generic reduction,intflavor.virtual void reduce (unsigned int *, int n, GrpReduce< unsigned int > &, unsigned int *scratch=0, int target=-1)β generic reduction,unsigned intflavor.virtual void reduce (char *, int n, GrpReduce< char > &, char *scratch=0, int target=-1)β generic reduction,charflavor.virtual void reduce (unsigned char *, int n, GrpReduce< unsigned char > &, unsigned char *scratch=0, int target=-1)β generic reduction,unsigned charflavor.virtual void reduce (signed char *, int n, GrpReduce< signed char > &, signed char *scratch=0, int target=-1)β generic reduction,signed charflavor.virtual void reduce (short *, int n, GrpReduce< short > &, short *scratch=0, int target=-1)β generic reduction,shortflavor.virtual void reduce (float *, int n, GrpReduce< float > &, float *scratch=0, int target=-1)β generic reduction,floatflavor.virtual void reduce (long *, int n, GrpReduce< long > &, long *scratch=0, int target=-1)β generic reduction,longflavor.void reduce (double &data, GrpReduce< double > &r)β reduce onedoubleby reference with aGrpReduce< double >.void reduce (int &data, GrpReduce< int > &r)β reduce oneintby reference with aGrpReduce< int >.virtual void sync ()β synchronizes all of the processors. π«ΆRef< MachineTopology > topology ()β returns theMachineTopologyobject.int classdesc_to_index (const ClassDesc *)β each message group maintains an association ofClassDescwith a global index soSavableStateinformation can be sent between nodes without needing to send the classname and look up theClassDescwith each transfer. π«const ClassDesc * index_to_classdesc (int)β the reverse lookup buddy for thatClassDescindex situation.int nclass () constβ the class-count const member.
π Static Public Member Functions π
static void set_default_messagegrp (const Ref< MessageGrp > &)β sets the default message group; the default message group contains the primary message group to be used by an application. πstatic MessageGrp * get_default_messagegrp ()β returns the default message group. β¨static MessageGrp * initial_messagegrp (int &argc, char **&argv)β creates a message group. π
π‘οΈ Protected Member Functions π‘οΈ
void initialize (int me, int n)β theclassdesc_to_index_andindex_to_classdesc_arrays cannot be initialized by theMessageGrpCTOR, because theMessageGrpspecialization has not yet been initialized and communication is not available. No cap, thatβs just the setup order. π«Ά
π Protected Attributes π
Ref< MachineTopology > topology_β the topology ref hanging out in protected territory.int debug_β the debug int, also protected.
π Detailed Description π
Real talk: the MessageGrp abstract class provides a mechanism for moving data and objects between nodes in a parallel machine. Thatβs the whole point, bestie. π
β¨
β¨ Member Function Documentation β¨
Okay bestie, this is the part where we meet every member function one by one. Buckle up, because there are a lot of them, and they're all serving "similar members exist for each of the basic types" energy. π
π bcast β the broadcast bestie π
virtual void sc::MessageGrp::bcast (double * data, int ndata, int from = 0)
[virtual]
This one does broadcasts of various types of data. And yes, similar members exist for each of the basic types β it's giving "one for every type, no cap." π
π§ classdesc_to_index β the mapping lore π§
int sc::MessageGrp::classdesc_to_index (const ClassDesc *)
Each message group keeps 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. Iykyk. β¨
π initial_messagegrp β the factory energy π
static MessageGrp* sc::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 a string for a ParsedKeyVal constructor or a classname. If this returns null, it is up to the programmer to create a MessageGrp. So like, no auto-magic if it's a null vibe β you're on your own, bestie. π«Ά
π initialize β protected but essential π
void sc::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. So like, the constructor can't do it all β it needs a lil helper. Periodt. π
π₯ max β global maximization π₯
virtual void sc::MessageGrp::max (double * data, int n, double * = 0, int target = -1) [virtual]
Global maximization. Similar members exist for each of the basic types. That's the whole vibe. π
πΈ min β global minimization πΈ
virtual void sc::MessageGrp::min (double * data, int n, double * = 0, int target = -1) [virtual]
Global minimization. Similar members exist for each of the basic types. Twin of max, basically. π
π¦ recv β receive sequentially π¦
virtual void sc::MessageGrp::recv (int sender, double * data, int ndata) [virtual]
Receive messages sent sequentially from the sender. Similar members exist for each of the basic types. So like, messages come in order from that one sender, bestie. π
β recvt β receive by type β
virtual void sc::MessageGrp::recvt (int type, double * data, int ndata) [virtual]
Receive messages sent by type. Similar members exist for each of the basic types. Now you're filtering by type β it's giving selective inbox energy. π¬
π reduce β generic reduction π
virtual void sc::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 sc::MPIMessageGrp.
π send β sequential send π
virtual void sc::MessageGrp::send (int target, const double * data, int ndata) [virtual]
Send messages sequentially to the target processor. Similar members exist for each of the basic types. Slide into their DMs β sequentially, of course. π
π sendt β typed send π
virtual void sc::MessageGrp::sendt (int target, int type, const double * data, int ndata) [virtual]
Send typed messages to the target processor. Similar members exist for each of the basic types. Now with a type attached, so the receiver knows what's tea. π«
π sum β global sum reduction π
virtual void sc::MessageGrp::sum (double * data, int n, double * = 0, int target = -1) [virtual]
Global sum reduction. Similar members exist for each of the basic types.
Reimplemented in sc::MPIMessageGrp.
β¨ Author β¨
This page was generated automatically by Doxygen for MPQC from the source code. π
π That's the whole manual page, bestie β MPQC version 2.3.1, dated Sun Oct 4 2020. Go off and message-group responsibly. Periodt. π
π¦ where this page comes from
- ubuntu jammy: libsc-doc 2.3.1-21
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms