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