1 #ifndef __CONTEXT_CLIENT_HPP__
2 #define __CONTEXT_CLIENT_HPP__
37 bool getBuffers(
const list<int>& serverList,
const list<int>& sizeList, list<CBufferOut*>& retBuffers,
bool nonBlocking =
false);
53 std::list<int>& rankRecvLeader,
54 std::list<int>& rankRecvNotLeader);
60 void setBufferSize(
const std::map<int,StdSize>& mapSize,
const std::map<int,StdSize>& maxEventSize);
91 bool isEmpty()
const {
return ranks.empty(); };
96 for (std::list<CBufferOut*>::iterator it = buffers.begin(); it != buffers.end(); it++)
115 #endif // __CONTEXT_CLIENT_HPP__
CContextClient(CContext *parent, MPI_Comm intraComm, MPI_Comm interComm, CContext *parentServer=0)
static void computeLeader(int clientRank, int clientSize, int serverSize, std::list< int > &rankRecvLeader, std::list< int > &rankRecvNotLeader)
void sendEvent(CEventClient &event)
In case of attached mode, the current context must be reset to context for client.
MPI_Comm intraComm
Communicator of client group.
void releaseBuffers(void)
Release all buffers.
int clientSize
Size of client group.
std::list< int > ranksServerNotLeader
List of server ranks for which the client is not leader.
CContext * parentServer
Event temporarily buffered (used only on the server)
void setBufferSize(const std::map< int, StdSize > &mapSize, const std::map< int, StdSize > &maxEventSize)
Set the buffer size for each connection.
const std::list< int > & getRanksServerNotLeader(void) const
Get leading server in the group of connected server.
size_t timeLine
Timeline of each event.
std::map< int, StdSize > mapBufferSize_
Mapping of server and buffer size for each connection to server.
bool checkBuffers(void)
Verify state of buffers.
bool isAttachedModeEnabled() const
Check if the attached mode is used.
const std::list< int > & getRanksServerLeader(void) const
Get leading server in the group of connected server.
map< int, CClientBuffer * > buffers
Buffers for connection to servers.
bool getBuffers(const list< int > &serverList, const list< int > &sizeList, list< CBufferOut * > &retBuffers, bool nonBlocking=false)
Get buffers for each connection to the servers.
void finalize(void)
Finalize context client and do some reports.
std::list< int > ranksServerLeader
List of server ranks for which the client is leader.
A context can be both on client and on server side.
StdSize maxBufferedEvents
Maximum number of events that can be buffered.
int clientRank
Rank of current client.
bool sendTemporarilyBufferedEvent()
Send the temporarily buffered event (if any).
std::map< int, StdSize > maxEventSizes
Maximum event sizes estimated for each connection to server.
MPI_Comm interComm
Communicator of server group.
int serverSize
Size of server group.
bool hasTemporarilyBufferedEvent() const
bool isServerNotLeader(void) const
Check if client connects to leading server.
bool havePendingRequests(void)
CContext * context
Context for client.
struct xios::CContextClient::@0 tmpBufferedEvent
void newBuffer(int rank)
Make a new buffer for a certain connection to server with specific rank.
void waitEvent(list< int > &ranks)
If client is also server (attached mode), after sending event, it should process right away the incom...
std::list< CBufferOut * > buffers
bool isServerLeader(void) const
Check if client connects to leading server.