cxios.hpp 2.8 KB

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