[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" |
---|
[300] | 7 | |
---|
[335] | 8 | namespace xios |
---|
[300] | 9 | { |
---|
[512] | 10 | /*! |
---|
| 11 | \class CXios |
---|
| 12 | */ |
---|
[300] | 13 | class CXios |
---|
| 14 | { |
---|
[512] | 15 | public: |
---|
[300] | 16 | static void initialize(void) ; |
---|
| 17 | static void initClientSide(const string & codeId, MPI_Comm& localComm, MPI_Comm& returnComm) ; |
---|
[1054] | 18 | static void initServerSide(void) ; |
---|
[300] | 19 | static void clientFinalize(void) ; |
---|
[346] | 20 | static void parseFile(const string& filename) ; |
---|
[490] | 21 | |
---|
[300] | 22 | template <typename T> |
---|
[311] | 23 | static T getin(const string& id,const T& defaultValue) ; |
---|
[490] | 24 | |
---|
[311] | 25 | template <typename T> |
---|
[300] | 26 | static T getin(const string& id) ; |
---|
| 27 | |
---|
[512] | 28 | public: |
---|
| 29 | static string rootFile ; //!< Configuration filename |
---|
| 30 | static string xiosCodeId ; //!< Identity for XIOS |
---|
[983] | 31 | static string clientFile; //!< Filename template for client |
---|
| 32 | static string serverFile; //!< Filename template for server |
---|
[1021] | 33 | static string serverPrmFile; //!< Filename template for primary server in case of two server levels |
---|
| 34 | static string serverSndFile; //!< Filename template for secondary server in case of two server levels |
---|
[300] | 35 | |
---|
[512] | 36 | static bool isClient ; //!< Check if xios is client |
---|
[992] | 37 | static bool isServer ; //!< Check if xios is server |
---|
[490] | 38 | |
---|
[512] | 39 | static MPI_Comm globalComm ; //!< Global communicator |
---|
[490] | 40 | |
---|
[523] | 41 | static bool printLogs2Files; //!< Printing out logs into files |
---|
[1243] | 42 | static bool usingOasis ; //!< Using Oasis |
---|
| 43 | static bool usingServer ; //!< Using server (server mode) |
---|
| 44 | static bool usingServer2 ; //!< Using secondary server (server mode). IMPORTANT: Use this variable ONLY in CServer::initialize(). |
---|
| 45 | static int ratioServer2 ; //!< Percentage of server processors dedicated to secondary server |
---|
| 46 | static int nbPoolsServer2 ; //!< Number of pools created on the secondary server |
---|
[718] | 47 | static double bufferSizeFactor; //!< Factor used to tune the buffer size |
---|
| 48 | static const double defaultBufferSizeFactor; //!< Default factor value |
---|
[719] | 49 | static StdSize minBufferSize; //!< Minimum buffer size |
---|
[1227] | 50 | static StdSize maxBufferSize; //!< Maximum buffer size |
---|
[512] | 51 | static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible) |
---|
[697] | 52 | static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers |
---|
[1158] | 53 | static double recvFieldTimeout; //!< Time to wait for data before issuing an error when receiving a field |
---|
[1377] | 54 | static bool checkEventSync; //!< For debuuging, check if event are coherent and synchrone on client side |
---|
[512] | 55 | |
---|
| 56 | public: |
---|
[499] | 57 | //! Setting xios to use server mode |
---|
| 58 | static void setUsingServer(); |
---|
[490] | 59 | |
---|
[499] | 60 | //! Setting xios NOT to use server mode |
---|
| 61 | static void setNotUsingServer(); |
---|
[491] | 62 | |
---|
[512] | 63 | //! Initialize server (if any) |
---|
[509] | 64 | static void initServer(); |
---|
| 65 | |
---|
[512] | 66 | private: |
---|
| 67 | //! Parse only Xios part of configuration file |
---|
[511] | 68 | static void parseXiosConfig(); |
---|
[300] | 69 | } ; |
---|
| 70 | } |
---|
| 71 | |
---|
[352] | 72 | //#include "cxios_impl.hpp" |
---|
[512] | 73 | #endif // __XIOS_HPP__ |
---|