Changeset 2019 for XIOS/dev/dev_trunk_graph/src/context_client.hpp
- Timestamp:
- 01/22/21 12:00:29 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_graph/src/context_client.hpp
r1232 r2019 14 14 { 15 15 class CContext; 16 16 class CContextServer ; 17 17 /*! 18 18 \class CContextClient … … 31 31 // Send event to server 32 32 void sendEvent(CEventClient& event); 33 bool sendTemporarilyBufferedEvent();34 33 void waitEvent(list<int>& ranks); 34 void waitEvent_old(list<int>& ranks); 35 35 36 36 // Functions to set/get buffers 37 bool getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking = false);37 bool getBuffers(const size_t timeLine, const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking = false); 38 38 void newBuffer(int rank); 39 39 bool checkBuffers(list<int>& ranks); … … 47 47 const std::list<int>& getRanksServerNotLeader(void) const; 48 48 49 bool isAttachedModeEnabled() const; 50 bool hasTemporarilyBufferedEvent() const { return !tmpBufferedEvent.isEmpty(); }; 49 /*! 50 * Check if the attached mode is used. 51 * 52 * \return true if and only if attached mode is used 53 */ 54 bool isAttachedModeEnabled() const { return isAttached_ ; } 51 55 52 56 static void computeLeader(int clientRank, int clientSize, int serverSize, … … 56 60 // Close and finalize context client 57 61 // void closeContext(void); Never been implemented. 62 bool isNotifiedFinalized(void) ; 58 63 void finalize(void); 59 64 60 65 void setBufferSize(const std::map<int,StdSize>& mapSize, const std::map<int,StdSize>& maxEventSize); 66 67 int getRemoteSize(void) {return serverSize;} 68 int getServerSize(void) {return serverSize;} 69 MPI_Comm getIntraComm(void) {return intraComm ;} 70 int getIntraCommSize(void) {return clientSize ;} 71 int getIntraCommRank(void) {return clientRank ;} 72 73 /*! set the associated server (dual chanel client/server) */ 74 void setAssociatedServer(CContextServer* associatedServer) { associatedServer=associatedServer_;} 75 /*! get the associated server (dual chanel client/server) */ 76 CContextServer* getAssociatedServer(void) { return associatedServer_;} 61 77 62 78 public: … … 71 87 int serverSize; //!< Size of server group 72 88 73 MPI_Comm interComm; //!< Communicator of server group 89 MPI_Comm interComm; //!< Communicator of server group (interCommunicator) 90 91 MPI_Comm interCommMerged; //!< Communicator of the client group + server group (intraCommunicator) needed for one sided communication. 74 92 75 93 MPI_Comm intraComm; //!< Communicator of client group 76 94 95 MPI_Comm commSelf; //!< Communicator of the client alone. Needed to create a new communicator between 1 proc client and 1 proc server for one sided communication 96 77 97 map<int,CClientBuffer*> buffers; //!< Buffers for connection to servers 78 98 99 bool pureOneSided ; //!< if true, client will communicated with servers only trough one sided communication. Otherwise the hybrid mode P2P /One sided is used. 100 79 101 private: 102 void lockBuffers(list<int>& ranks) ; 103 void unlockBuffers(list<int>& ranks) ; 104 80 105 //! Mapping of server and buffer size for each connection to server 81 106 std::map<int,StdSize> mapBufferSize_; … … 84 109 //! Maximum number of events that can be buffered 85 110 StdSize maxBufferedEvents; 86 87 struct {88 std::list<int> ranks, sizes;89 std::list<CBufferOut*> buffers;90 91 bool isEmpty() const { return ranks.empty(); };92 void clear() {93 ranks.clear();94 sizes.clear();95 96 for (std::list<CBufferOut*>::iterator it = buffers.begin(); it != buffers.end(); it++)97 delete *it;98 99 buffers.clear();100 };101 } tmpBufferedEvent; //! Event temporarily buffered (used only on the server)102 111 103 112 //! Context for server (Only used in attached mode) … … 110 119 std::list<int> ranksServerNotLeader; 111 120 121 std::vector<std::vector<MPI_Win> >windows ; //! one sided mpi windows to expose client buffers to servers == windows[nbServers][2] 122 bool isAttached_ ; 123 CContextServer* associatedServer_ ; //!< The server associated to the pair client/server 124 112 125 }; 113 126 }
Note: See TracChangeset
for help on using the changeset viewer.