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

Last change on this file was 2596, checked in by jderouillat, 8 months ago

Check that all events are managed before the end of the simulation (forget the declaration of a pure virtual method)

  • Property svn:executable set to *
File size: 1.9 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, p2p, 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    virtual ~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    virtual bool hasPendingEvent(void)=0;
33   
34    protected :
35
36      MPI_Comm intraComm ;
37      int intraCommSize ;
38      int intraCommRank ;
39
40      MPI_Comm interComm ;
41      int commSize ;
42      int clientSize_ ;
43
44      CContext* context ;
45      CContextClient* associatedClient_ ;
46
47      size_t hashId ;
48      shared_ptr<CEventScheduler> eventScheduler_=nullptr ;
49  } ;
50 
51  template<>
52  CContextServer* CContextServer::getNew<CContextServer::generic>(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
53 
54  template<>
55  CContextServer* CContextServer::getNew<CContextServer::oneSided>(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
56
57  template<>
58  CContextServer* CContextServer::getNew<CContextServer::p2p>(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
59
60  template<>
61  CContextServer* CContextServer::getNew<CContextServer::legacy>(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
62
63}
64
65#endif
Note: See TracBrowser for help on using the repository browser.