Ignore:
Timestamp:
11/14/14 17:56:37 (9 years ago)
Author:
mhnguyen
Message:

Correct bug causing infinite run on multiple server and do some code clean

+) Correct a stupid typo which causes the bug
+) Add comments for class Contextclient
+) Remove some redundant codes

Test
+) On Curie
+) Connection mode: Attached: One and Multiple; Seperated: One and Multiple server
+) File mode: One and multiple file
+) All tests passed (Will it make the trusting board become red :)? )

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/context_client.hpp

    r511 r512  
    1212  class CContext ; 
    1313 
     14  /*! 
     15  \class CContextClient 
     16  A context can be both on client and on server side. In order to differenciate the role of 
     17  context on each side, e.x client sending events, server receiving and processing events, there is a need of 
     18  concrete "context" classes for both sides. 
     19  CContextClient processes and sends events from client to server where CContextServer receives these events 
     20  and processes them. 
     21  */ 
    1422  class CContextClient 
    1523  { 
     24    public: 
     25    // Contructor 
     26    CContextClient(CContext* parent,MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0) ; 
    1627 
    17     public: 
    18     CContextClient(CContext* parent,MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0) ; 
    19 //    void registerEvent(CEventClient& event) ; 
     28    // Send event to server 
     29    void sendEvent(CEventClient& event) ; 
     30    void waitEvent(list<int>& ranks) ; 
    2031 
    21 //    list<CBufferOut*> newEvent(CEventClient& event,list<int>& sizes) ; 
    22     void sendEvent(CEventClient& event) ; 
    23  
     32    // Functions relates to set/get buffers 
    2433    list<CBufferOut*> getBuffers(list<int>& serverlist, list<int>& sizeList) ; 
    2534    void newBuffer(int rank) ; 
    26     size_t timeLine ; 
    27     int clientRank ; 
    28     int clientSize ; 
    29     int serverSize ; 
    30 //    set<int> connectedServer ; 
    31     MPI_Comm interComm ; 
    32     MPI_Comm intraComm ; 
    33     map<int,CClientBuffer*> buffers ; 
    3435    bool checkBuffers(list<int>& ranks) ; 
    3536    bool checkBuffers(void); 
    3637    void releaseBuffers(void); 
    37     void closeContext(void) ; 
     38 
    3839    bool isServerLeader(void) ; 
    3940    int getServerLeader(void) ; 
     41 
     42    // Close and finalize context client 
     43    void closeContext(void) ; 
    4044    void finalize(void) ; 
    41     void waitEvent(list<int>& ranks) ; 
    4245 
    4346    void setBufferSize(const std::map<int, StdSize>& mapSize); 
    4447    void sendBufferSizeEvent(); 
    4548 
    46     CContext* context ; 
     49    public: 
     50      CContext* context ; //!< Context for client 
     51 
     52      size_t timeLine ; //!< Timeline of each event 
     53 
     54      int clientRank ; //!< Rank of current client 
     55 
     56      int clientSize ; //!< Size of client group 
     57 
     58      int serverSize ; //!< Size of server group 
     59 
     60      MPI_Comm interComm ; //!< Communicator of server group 
     61 
     62      MPI_Comm intraComm ; //!< Communicator of client group 
     63 
     64      map<int,CClientBuffer*> buffers ; //!< Buffers for connection to servers 
    4765 
    4866    private: 
    49     std::map<int, StdSize> mapBufferSize_; 
    50     CContext* parentServer; 
     67      //! Mapping of server and buffer size for each connection to server 
     68      std::map<int, StdSize> mapBufferSize_; 
     69 
     70      //! Context for server (Only used in attached mode) 
     71      CContext* parentServer; 
     72 
     73    public: // Some function should be removed in the future 
     74      //    void registerEvent(CEventClient& event) ; 
     75//    list<CBufferOut*> newEvent(CEventClient& event,list<int>& sizes) ; 
    5176//    bool locked ; 
     77//    set<int> connectedServer ; 
    5278 
    5379  } ; 
    54  
    55  
    56  
    57  
    5880} 
    5981 
    60  
    61  
    62 #endif 
     82#endif // __CONTEXT_CLIENT_HPP__ 
Note: See TracChangeset for help on using the changeset viewer.