Ignore:
Timestamp:
05/26/15 16:13:46 (6 years ago)
Author:
rlacroix
Message:

Allow using more servers than clients.

This will be useful later when implementing server to client communications.

File:
1 edited

Legend:

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

    r591 r595  
    1010namespace xios 
    1111{ 
    12   class CContext ; 
     12  class CContext; 
    1313 
    1414  /*! 
     
    2323  { 
    2424    public: 
    25     // Contructor 
    26     CContextClient(CContext* parent,MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0) ; 
     25      // Contructor 
     26      CContextClient(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0); 
    2727 
    28     // Send event to server 
    29     void sendEvent(CEventClient& event) ; 
    30     void waitEvent(list<int>& ranks) ; 
     28      // Send event to server 
     29      void sendEvent(CEventClient& event); 
     30      void waitEvent(list<int>& ranks); 
    3131 
    32     // Functions relates to set/get buffers 
    33     list<CBufferOut*> getBuffers(list<int>& serverlist, list<int>& sizeList) ; 
    34     void newBuffer(int rank) ; 
    35     bool checkBuffers(list<int>& ranks) ; 
    36     bool checkBuffers(void); 
    37     void releaseBuffers(void); 
     32      // Functions relates to set/get buffers 
     33      list<CBufferOut*> getBuffers(list<int>& serverlist, list<int>& sizeList); 
     34      void newBuffer(int rank); 
     35      bool checkBuffers(list<int>& ranks); 
     36      bool checkBuffers(void); 
     37      void releaseBuffers(void); 
    3838 
    39     bool isServerLeader(void) ; 
    40     int getServerLeader(void) ; 
     39      bool isServerLeader(void) const; 
     40      const std::list<int>& getRanksServerLeader(void) const; 
    4141 
    42     // Close and finalize context client 
    43     void closeContext(void) ; 
    44     void finalize(void) ; 
     42      // Close and finalize context client 
     43      void closeContext(void); 
     44      void finalize(void); 
    4545 
    46     void setBufferSize(const std::map<int, StdSize>& mapSize); 
    47     void sendBufferSizeEvent(); 
     46      void setBufferSize(const std::map<int,StdSize>& mapSize); 
     47      void sendBufferSizeEvent(); 
    4848 
    4949    public: 
    50       CContext* context ; //!< Context for client 
     50      CContext* context; //!< Context for client 
    5151 
    52       size_t timeLine ; //!< Timeline of each event 
     52      size_t timeLine; //!< Timeline of each event 
    5353 
    54       int clientRank ; //!< Rank of current client 
     54      int clientRank; //!< Rank of current client 
    5555 
    56       int clientSize ; //!< Size of client group 
     56      int clientSize; //!< Size of client group 
    5757 
    58       int serverSize ; //!< Size of server group 
     58      int serverSize; //!< Size of server group 
    5959 
    60       MPI_Comm interComm ; //!< Communicator of server group 
     60      MPI_Comm interComm; //!< Communicator of server group 
    6161 
    62       MPI_Comm intraComm ; //!< Communicator of client group 
     62      MPI_Comm intraComm; //!< Communicator of client group 
    6363 
    64       map<int,CClientBuffer*> buffers ; //!< Buffers for connection to servers 
     64      map<int,CClientBuffer*> buffers; //!< Buffers for connection to servers 
    6565 
    6666    private: 
    6767      //! Mapping of server and buffer size for each connection to server 
    68       std::map<int, StdSize> mapBufferSize_; 
     68      std::map<int,StdSize> mapBufferSize_; 
    6969 
    7070      //! Context for server (Only used in attached mode) 
    7171      CContext* parentServer; 
    7272 
     73      //! List of server ranks for which the client is leader 
     74      std::list<int> ranksServerLeader; 
     75 
    7376    public: // Some function should be removed in the future 
    74       //    void registerEvent(CEventClient& event) ; 
    75 //    list<CBufferOut*> newEvent(CEventClient& event,list<int>& sizes) ; 
    76 //    bool locked ; 
    77 //    set<int> connectedServer ; 
     77      //    void registerEvent(CEventClient& event); 
     78//    list<CBufferOut*> newEvent(CEventClient& event,list<int>& sizes); 
     79//    bool locked; 
     80//    set<int> connectedServer; 
    7881 
    79   } ; 
     82  }; 
    8083} 
    8184 
Note: See TracChangeset for help on using the changeset viewer.