source: XIOS3/trunk/src/transport/context_server.hpp @ 2547

Last change on this file since 2547 was 2547, checked in by ymipsl, 10 months ago

Major update :

  • New method to lock and unlock one-sided windows (window_dynamic) to avoid network overhead
  • Introducing multithreading on server sided to manage more efficiently dead-lock occuring (similar to co-routine which will be available and implemented in futur c++ standard), based on c++ threads
  • Suprression of old "attached mode" which is replaced by online writer and reder filters

YM

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#ifndef __CONTEXT_SERVER_HPP__
2#define __CONTEXT_SERVER_HPP__
3#include "xios_spl.hpp"
4#include "event_server.hpp"
5#include "buffer_server.hpp"
6#include "mpi.hpp"
7#include "event_scheduler.hpp"
8
9namespace xios
10{
11  class CContext ;
12  class CContextClient;
13
14  class CContextServer
15  {
16    public:
17   
18    enum ETransport { generic, legacy, oneSided}  ;
19     
20    template<ETransport transport=generic> 
21    static CContextServer* getNew(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
22   
23    CContextServer(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
24    ~CContextServer() {} 
25    void setAssociatedClient(CContextClient* associatedClient) {associatedClient_=associatedClient ;}
26    CContextClient* getAssociatedClient(void) { return associatedClient_ ;}
27    int getIntraCommRank(void) { return intraCommRank ;}
28    int getIntraCommSize(void) { return intraCommSize ;}
29
30    virtual bool eventLoop(bool enableEventsProcessing = true) = 0 ;
31    virtual void releaseBuffers(void)=0;
32   
33    protected :
34
35      MPI_Comm intraComm ;
36      int intraCommSize ;
37      int intraCommRank ;
38
39      MPI_Comm interComm ;
40      int commSize ;
41      int clientSize_ ;
42
43      CContext* context ;
44      CContextClient* associatedClient_ ;
45
46      size_t hashId ;
47      shared_ptr<CEventScheduler> eventScheduler_=nullptr ;
48  } ;
49 
50  template<>
51  CContextServer* CContextServer::getNew<CContextServer::generic>(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
52 
53  template<>
54  CContextServer* CContextServer::getNew<CContextServer::oneSided>(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
55
56  template<>
57  CContextServer* CContextServer::getNew<CContextServer::legacy>(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
58
59}
60
61#endif
Note: See TracBrowser for help on using the repository browser.