Galois
|
A class that defines functions that a network interface in Galois should have. More...
#include <Network.h>
Public Member Functions | |
NetworkInterface () | |
Constructor for interface. More... | |
virtual | ~NetworkInterface () |
Destructor destroys MPI (if it exists). More... | |
void | sendMsg (uint32_t dest, void(*recv)(uint32_t, RecvBuffer &), SendBuffer &buf) |
Send a message to a given (dest) host. More... | |
template<typename... Args> | |
void | sendSimple (uint32_t dest, void(*recv)(uint32_t, Args...), Args...param) |
Send a message letting the network handle the serialization and deserialization slightly slower. More... | |
virtual void | sendTagged (uint32_t dest, uint32_t tag, SendBuffer &buf, int type=0)=0 |
Send a message to a given (dest) host. More... | |
void | broadcast (void(*recv)(uint32_t, RecvBuffer &), SendBuffer &buf, bool self=false) |
Send a message to all hosts. More... | |
template<typename... Args> | |
void | broadcastSimple (void(*recv)(uint32_t, Args...), Args...param) |
Broadcast a message allowing the network to handle serialization and deserialization. More... | |
void | handleReceives () |
Receive and dispatch messages. More... | |
void | resetMemUsage () |
Wrapper to reset the mem usage tracker's stats. More... | |
void | reportMemUsage () const |
Reports the memory usage tracker's statistics to the stat manager. More... | |
virtual std::optional < std::pair< uint32_t, RecvBuffer > > | recieveTagged (uint32_t tag, std::unique_lock< substrate::SimpleLock > *rlg, int type=0)=0 |
Receive a tagged message. More... | |
virtual void | flush ()=0 |
move send buffers out to network More... | |
virtual bool | anyPendingSends ()=0 |
virtual bool | anyPendingReceives ()=0 |
virtual unsigned long | reportSendBytes () const =0 |
Get how many bytes were sent. More... | |
virtual unsigned long | reportSendMsgs () const =0 |
Get how many messages were sent. More... | |
virtual unsigned long | reportRecvBytes () const =0 |
Get how many bytes were received. More... | |
virtual unsigned long | reportRecvMsgs () const =0 |
Get how many messages were received. More... | |
virtual std::vector< unsigned long > | reportExtra () const =0 |
Get any other extra statistics that might need to be reported; varies depending on implementation. More... | |
virtual std::vector< std::pair < std::string, unsigned long > > | reportExtraNamed () const =0 |
Get the names of the extra things that are returned by reportExtra. More... | |
Static Public Attributes | |
static uint32_t | ID = 0 |
This machine's host ID. More... | |
static uint32_t | Num = 1 |
The total number of machines in the current program. More... | |
Protected Member Functions | |
void | initializeMPI () |
Initialize the MPI system. Should only be called once per process. More... | |
void | finalizeMPI () |
Finalize the MPI system. Should only be called once per process. More... | |
Protected Attributes | |
MemUsageTracker | memUsageTracker |
Memory usage tracker. More... | |
std::atomic< size_t > | inflightSends |
Number of inflight sends and receives. More... | |
std::atomic< size_t > | inflightRecvs |
A class that defines functions that a network interface in Galois should have.
How the sends/recvs/stat-collecting happens as well as the network layer itself is up to the implemention of the class.
NetworkInterface::NetworkInterface | ( | ) |
Constructor for interface.
|
virtual |
Destructor destroys MPI (if it exists).
|
pure virtual |
|
pure virtual |
void NetworkInterface::broadcast | ( | void(*)(uint32_t, RecvBuffer &) | recv, |
SendBuffer & | buf, | ||
bool | self = false |
||
) |
Send a message to all hosts.
A message is simply a landing pad (recv) and some data (buf) buf is invalidated by this operation
void galois::runtime::NetworkInterface::broadcastSimple | ( | void(*)(uint32_t, Args...) | recv, |
Args... | param | ||
) |
Broadcast a message allowing the network to handle serialization and deserialization.
|
protected |
Finalize the MPI system. Should only be called once per process.
|
pure virtual |
move send buffers out to network
void NetworkInterface::handleReceives | ( | ) |
Receive and dispatch messages.
|
protected |
Initialize the MPI system. Should only be called once per process.
|
pure virtual |
Receive a tagged message.
|
pure virtual |
Get any other extra statistics that might need to be reported; varies depending on implementation.
|
pure virtual |
Get the names of the extra things that are returned by reportExtra.
void NetworkInterface::reportMemUsage | ( | ) | const |
Reports the memory usage tracker's statistics to the stat manager.
|
pure virtual |
Get how many bytes were received.
|
pure virtual |
Get how many messages were received.
|
pure virtual |
Get how many bytes were sent.
|
pure virtual |
Get how many messages were sent.
|
inline |
Wrapper to reset the mem usage tracker's stats.
void NetworkInterface::sendMsg | ( | uint32_t | dest, |
void(*)(uint32_t, RecvBuffer &) | recv, | ||
SendBuffer & | buf | ||
) |
Send a message to a given (dest) host.
A message is simply a landing pad (recv, funciton pointer) and some data (buf) on the receiver, recv(buf) will be called durring handleReceives() buf is invalidated by this operation
void galois::runtime::NetworkInterface::sendSimple | ( | uint32_t | dest, |
void(*)(uint32_t, Args...) | recv, | ||
Args... | param | ||
) |
Send a message letting the network handle the serialization and deserialization slightly slower.
|
pure virtual |
Send a message to a given (dest) host.
A message is simply a tag (tag) and some data (buf) on the receiver, buf will be returned on a receiveTagged(tag) buf is invalidated by this operation
|
static |
This machine's host ID.
|
protected |
|
protected |
Number of inflight sends and receives.
|
protected |
Memory usage tracker.
|
static |
The total number of machines in the current program.