[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" |
---|
[1037] | 7 | #ifdef _usingEP |
---|
| 8 | //#include "ep_declaration.hpp" |
---|
| 9 | #endif |
---|
[300] | 10 | |
---|
[1037] | 11 | |
---|
[335] | 12 | namespace xios |
---|
[300] | 13 | { |
---|
[512] | 14 | /*! |
---|
| 15 | \class CXios |
---|
| 16 | */ |
---|
[300] | 17 | class CXios |
---|
| 18 | { |
---|
[512] | 19 | public: |
---|
[1081] | 20 | CXios(); |
---|
| 21 | static void initialize(void) ; |
---|
| 22 | static void initClientSide(const string & codeId, ep_lib::MPI_Comm& localComm, ep_lib::MPI_Comm& returnComm) ; |
---|
| 23 | static void initServerSide(void) ; |
---|
| 24 | static void clientFinalize(void) ; |
---|
| 25 | static void parseFile(const string& filename) ; |
---|
[490] | 26 | |
---|
[1081] | 27 | template <typename T> |
---|
| 28 | static T getin(const string& id,const T& defaultValue) ; |
---|
[490] | 29 | |
---|
[1081] | 30 | template <typename T> |
---|
| 31 | static T getin(const string& id) ; |
---|
[300] | 32 | |
---|
[512] | 33 | public: |
---|
[1081] | 34 | static const string rootFile; //!< Configuration filename |
---|
[1072] | 35 | |
---|
[1081] | 36 | static const string xiosCodeId ; //!< Identity for XIOS |
---|
[1072] | 37 | |
---|
[1081] | 38 | static const string clientFile; //!< Filename template for client |
---|
[1072] | 39 | |
---|
[1081] | 40 | static const string serverFile; //!< Filename template for server |
---|
[300] | 41 | |
---|
[1081] | 42 | static bool isClient ; //!< Check if xios is client |
---|
[1072] | 43 | |
---|
[1081] | 44 | static bool isServer ; //!< Check if xios is server |
---|
[490] | 45 | |
---|
[1081] | 46 | #pragma omp threadprivate(isClient, isServer) |
---|
[490] | 47 | |
---|
[1081] | 48 | static MPI_Comm globalComm ; //!< Global communicator |
---|
| 49 | #pragma omp threadprivate(globalComm) |
---|
[1072] | 50 | |
---|
[1081] | 51 | static bool printLogs2Files; //!< Printing out logs into files |
---|
[1072] | 52 | |
---|
[1081] | 53 | static bool usingOasis ; //!< Using Oasis |
---|
[1072] | 54 | |
---|
[1081] | 55 | static bool usingServer ; //!< Using server (server mode) |
---|
[1072] | 56 | |
---|
[1081] | 57 | static double bufferSizeFactor; //!< Factor used to tune the buffer size |
---|
[1072] | 58 | |
---|
[1081] | 59 | static const double defaultBufferSizeFactor; //!< Default factor value |
---|
[1072] | 60 | |
---|
[1081] | 61 | static StdSize minBufferSize; //!< Minimum buffer size |
---|
[1072] | 62 | |
---|
[1081] | 63 | static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible) |
---|
[512] | 64 | |
---|
[1081] | 65 | #pragma omp threadprivate(printLogs2Files, usingOasis, usingServer, bufferSizeFactor, minBufferSize, isOptPerformance) |
---|
| 66 | |
---|
| 67 | static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers |
---|
[1095] | 68 | |
---|
[1081] | 69 | |
---|
| 70 | |
---|
[512] | 71 | public: |
---|
[499] | 72 | //! Setting xios to use server mode |
---|
| 73 | static void setUsingServer(); |
---|
[490] | 74 | |
---|
[499] | 75 | //! Setting xios NOT to use server mode |
---|
| 76 | static void setNotUsingServer(); |
---|
[491] | 77 | |
---|
[512] | 78 | //! Initialize server (if any) |
---|
[509] | 79 | static void initServer(); |
---|
| 80 | |
---|
[512] | 81 | private: |
---|
| 82 | //! Parse only Xios part of configuration file |
---|
[511] | 83 | static void parseXiosConfig(); |
---|
[300] | 84 | } ; |
---|
| 85 | } |
---|
| 86 | |
---|
[352] | 87 | //#include "cxios_impl.hpp" |
---|
[512] | 88 | #endif // __XIOS_HPP__ |
---|