ALPS Project: osiris library
Header file osiris/mpdump.h
This header contains classes for message passing using the
Osiris serialization mechanism.
Synopsis
namespace alps {
class OMPDump : public ODump
{
public:
OMPDump();
void init();
void send(const Process& p,int32_t tag);
void send(const ProcessList& p,int32_t tag);
};
class IMPDump : public IDump
{
public:
static int32_t probe(int32_t tag=-1);
static int32_t probe(const Process& p, int32_t tag=-1);
IMPDump();
IMPDump(int32_t tag);
IMPDump(const Process& p, int32_t tag);
void init();
const Process& sender() const;
void receive(const Process& p,int32_t tag);
void receive(int32_t tag);
};
}
The OMPDump class
allows sending of messages using the serialization mechanism.
OMPDump();
creates a new buffer into which the message content can be written using
the serialization mechanism, and then sent to other nodes.
void init();
re-initializes the buffer for a new message.
void send(const Process& p,int32_t tag);
sends the message previously stored using the serialization mechanism
to the given process with the given tag.
void send(const ProcessList& p,int32_t tag);
multicasts the message previously stored using the serialization mechanism
to the given processes with the given tag.
The IMPDump class
allows receiving of messages using the serialization mechansim.
After a message has been sucessfully received it can be read using
the serialization mechanism.
static int probe(int32_t tag=-1);
probes if a message with a given tag waits to be received. If no tag
is given, messages of any tag are probed for. The function returns
the tag of any matched message, or 0 if no message is found.
static int probe(const Process& p, int32_t tag=-1);
probes if a message with a given tag waits to be received from a given
process. If no tag
is given, messages of any tag are probed for. The function returns
the tag of any matched message, or 0 if no message is found.
IMPDump();
creates a new buffer to receive a message.
IMPDump(int32_t tag);
creates a new buffer and starts a blocking receive for a message
with the given tag.
IMPDump(const Process& p, int32_t tag);
creates a new buffer and starts a blocking receive for a message
with the given tag from the given process.
void init();
reinitializes the buffer for a new message.
const Process& sender() const;
returns the process which sent the last succesfully received message. If no
message has been received an invalid Process object is returned.
void receive(const Process& p,int32_t tag);
starts a blocking receive for a message from the given process with the
given tag.
void receive(int32_t tag);
starts a blocking receive for a message from any process with the
given tag.
copyright (c) 1994-2003 by Matthias Troyer