1 | #ifndef __XIOS_HPP__ |
---|
2 | #define __XIOS_HPP__ |
---|
3 | |
---|
4 | #include "xios_spl.hpp" |
---|
5 | #include "mpi.hpp" |
---|
6 | #include "registry.hpp" |
---|
7 | #include "ressources_manager.hpp" |
---|
8 | #include "services_manager.hpp" |
---|
9 | #include "contexts_manager.hpp" |
---|
10 | #include "daemons_manager.hpp" |
---|
11 | #include "coupler_manager.hpp" |
---|
12 | #include "registry_manager.hpp" |
---|
13 | |
---|
14 | namespace xios |
---|
15 | { |
---|
16 | /*! |
---|
17 | \class CXios |
---|
18 | */ |
---|
19 | class CXios |
---|
20 | { |
---|
21 | public: |
---|
22 | static void initialize(void) ; |
---|
23 | static void initClientSide(const string & codeId, MPI_Comm& localComm, MPI_Comm& returnComm) ; |
---|
24 | static void initServerSide(void) ; |
---|
25 | static void clientFinalize(void) ; |
---|
26 | static void parseFile(const string& filename) ; |
---|
27 | |
---|
28 | template <typename T> |
---|
29 | static T getin(const string& id,const T& defaultValue) ; |
---|
30 | |
---|
31 | template <typename T> |
---|
32 | static T getin(const string& id) ; |
---|
33 | |
---|
34 | public: |
---|
35 | static string rootFile ; //!< Configuration filename |
---|
36 | static string xiosCodeId ; //!< Identity for XIOS |
---|
37 | static string clientFile; //!< Filename template for client |
---|
38 | static string serverFile; //!< Filename template for server |
---|
39 | static string serverPrmFile; //!< Filename template for primary server in case of two server levels |
---|
40 | static string serverSndFile; //!< Filename template for secondary server in case of two server levels |
---|
41 | |
---|
42 | static bool xiosStack; //!< Exception handling |
---|
43 | static bool systemStack; //!< Exception handling |
---|
44 | |
---|
45 | static bool isClient ; //!< Check if xios is client |
---|
46 | static bool isServer ; //!< Check if xios is server |
---|
47 | |
---|
48 | static MPI_Comm globalComm ; //!< Global communicator |
---|
49 | static MPI_Comm xiosComm ; //!< Global communicator |
---|
50 | |
---|
51 | static bool printLogs2Files; //!< Printing out logs into files |
---|
52 | static bool usingOasis ; //!< Using Oasis |
---|
53 | static bool usingServer ; //!< Using server (server mode) |
---|
54 | static bool usingServer2 ; //!< Using secondary server (server mode). IMPORTANT: Use this variable ONLY in CServer::initialize(). |
---|
55 | static int ratioServer2 ; //!< Percentage of server processors dedicated to secondary server |
---|
56 | static int nbPoolsServer2 ; //!< Number of pools created on the secondary server |
---|
57 | static double bufferSizeFactor; //!< Factor used to tune the buffer size |
---|
58 | static const double defaultBufferSizeFactor; //!< Default factor value |
---|
59 | static StdSize minBufferSize; //!< Minimum buffer size |
---|
60 | static StdSize maxBufferSize; //!< Maximum buffer size |
---|
61 | static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible) |
---|
62 | static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers |
---|
63 | static double recvFieldTimeout; //!< Time to wait for data before issuing an error when receiving a field |
---|
64 | static bool checkEventSync; //!< For debuuging, check if event are coherent and synchrone on client side |
---|
65 | |
---|
66 | static const string defaultPoolId ; |
---|
67 | static const string defaultServerId ; |
---|
68 | static const string defaultGathererId ; |
---|
69 | |
---|
70 | |
---|
71 | static CRegistryManager* registryManager_ ; |
---|
72 | static CRessourcesManager* ressourcesManager_ ; |
---|
73 | static CCouplerManager* couplerManager_ ; |
---|
74 | static CServicesManager* servicesManager_ ; |
---|
75 | static CContextsManager* contextsManager_ ; |
---|
76 | static CDaemonsManager* daemonsManager_ ; |
---|
77 | |
---|
78 | |
---|
79 | public: |
---|
80 | //! Setting xios to use server mode |
---|
81 | static void setUsingServer(); |
---|
82 | |
---|
83 | //! Setting xios NOT to use server mode |
---|
84 | static void setNotUsingServer(); |
---|
85 | |
---|
86 | //! is using server mode |
---|
87 | static bool isUsingServer() {return usingServer;} |
---|
88 | |
---|
89 | //! Initialize server (if any) |
---|
90 | static void initServer(); |
---|
91 | |
---|
92 | static void launchServicesManager( bool isXiosServer) ; |
---|
93 | static void launchContextsManager(bool isXiosServer) ; |
---|
94 | static void launchDaemonsManager(bool isXiosServer) ; |
---|
95 | static void launchRessourcesManager(bool isXiosServer) ; |
---|
96 | static void launchCouplerManager(bool isXiosServer) ; |
---|
97 | static void launchRegistryManager(bool isXiosServer) ; |
---|
98 | |
---|
99 | static void finalizeServicesManager() ; |
---|
100 | static void finalizeContextsManager() ; |
---|
101 | static void finalizeDaemonsManager() ; |
---|
102 | static void finalizeRessourcesManager() ; |
---|
103 | static void finalizeCouplerManager() ; |
---|
104 | static void finalizeRegistryManager() ; |
---|
105 | |
---|
106 | static CRegistryManager* getRegistryManager(void) { return registryManager_ ;} |
---|
107 | static CRessourcesManager* getRessourcesManager(void) { return ressourcesManager_ ;} |
---|
108 | static CCouplerManager* getCouplerManager(void) { return couplerManager_ ;} |
---|
109 | static CServicesManager* getServicesManager(void) { return servicesManager_ ;} |
---|
110 | static CContextsManager* getContextsManager(void) { return contextsManager_ ;} |
---|
111 | static CDaemonsManager* getDaemonsManager(void) { return daemonsManager_ ;} |
---|
112 | static CPoolRessource* getPoolRessource(void) ; |
---|
113 | |
---|
114 | static MPI_Comm getGlobalComm(void) { return globalComm ;} |
---|
115 | static MPI_Comm getXiosComm(void) { return xiosComm ;} |
---|
116 | static void setXiosComm(MPI_Comm comm) { xiosComm=comm ;} |
---|
117 | static CRegistry* getGlobalRegistry(void) { return globalRegistry ;} |
---|
118 | static void setGlobalRegistry(CRegistry* registry) { globalRegistry=registry ;} |
---|
119 | |
---|
120 | private: |
---|
121 | //! Parse only Xios part of configuration file |
---|
122 | static void parseXiosConfig(); |
---|
123 | } ; |
---|
124 | } |
---|
125 | |
---|
126 | //#include "cxios_impl.hpp" |
---|
127 | #endif // __XIOS_HPP__ |
---|