source: XIOS/dev/branch_openmp/src/cxios.hpp @ 1482

Last change on this file since 1482 was 1460, checked in by yushan, 6 years ago

branch_openmp merged with XIOS_DEV_CMIP6@1459

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 3.6 KB
Line 
1#ifndef __XIOS_HPP__
2#define __XIOS_HPP__
3
4#include "xios_spl.hpp"
5#include "mpi.hpp"
6#include "registry.hpp"
7
8namespace xios
9{
10  /*!
11  \class CXios
12  */
13  class CXios
14  {
15    public:
16      static void initialize(void) ;
17      static void initClientSide(const string & codeId, ep_lib::MPI_Comm& localComm, ep_lib::MPI_Comm& returnComm) ;
18      static void initServerSide(void) ;
19      static void clientFinalize(void) ;
20      static void parseFile(const string& filename) ;
21
22      template <typename T>
23      static T getin(const string& id,const T& defaultValue) ;
24
25      template <typename T>
26      static T getin(const string& id) ;
27
28    public:
29     static const string rootFile ; //!< Configuration filename
30     static const string xiosCodeId ; //!< Identity for XIOS
31     static const string clientFile;        //!< Filename template for client
32     static const string serverFile;        //!< Filename template for server
33     static const string serverPrmFile;  //!< Filename template for primary server in case of two server levels
34     static const string serverSndFile;  //!< Filename template for secondary server in case of two server levels
35
36     static bool isClient ; //!< Check if xios is client
37     #pragma omp threadprivate(isClient)
38     static bool isServer ; //!< Check if xios is server
39     #pragma omp threadprivate(isServer)
40
41     static ep_lib::MPI_Comm globalComm ; //!< Global communicator
42     #pragma omp threadprivate(globalComm)
43
44     static bool printLogs2Files; //!< Printing out logs into files
45     #pragma omp threadprivate(printLogs2Files)
46     static bool usingOasis ;     //!< Using Oasis
47     #pragma omp threadprivate(usingOasis)
48     static bool usingServer ;    //!< Using server (server mode)
49     #pragma omp threadprivate(usingServer)
50     static bool usingServer2 ;   //!< Using secondary server (server mode). IMPORTANT: Use this variable ONLY in CServer::initialize().
51     #pragma omp threadprivate(usingServer2)
52     static int ratioServer2 ;    //!< Percentage of server processors dedicated to secondary server
53     #pragma omp threadprivate(ratioServer2)
54     static int nbPoolsServer2 ;  //!< Number of pools created on the secondary server
55     #pragma omp threadprivate(nbPoolsServer2)
56     static double bufferSizeFactor; //!< Factor used to tune the buffer size
57     #pragma omp threadprivate(bufferSizeFactor)
58     static const double defaultBufferSizeFactor; //!< Default factor value
59     static StdSize minBufferSize; //!< Minimum buffer size
60     #pragma omp threadprivate(minBufferSize)
61     static StdSize maxBufferSize; //!< Maximum buffer size
62     #pragma omp threadprivate(minBufferSize)
63     static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible)
64     #pragma omp threadprivate(isOptPerformance)
65     static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers
66     #pragma omp threadprivate(globalRegistry)
67     static double recvFieldTimeout; //!< Time to wait for data before issuing an error when receiving a field
68     #pragma omp threadprivate(recvFieldTimeout)
69     static bool checkEventSync; //!< For debuuging, check if event are coherent and synchrone on client side
70
71    public:
72     //! Setting xios to use server mode
73     static void setUsingServer();
74
75     //! Setting xios NOT to use server mode
76     static void setNotUsingServer();
77
78     //! Initialize server (if any)
79     static  void initServer();
80
81    private:
82      //! Parse only Xios part of configuration file
83      static void parseXiosConfig();
84  } ;
85}
86
87//#include "cxios_impl.hpp"
88#endif // __XIOS_HPP__
Note: See TracBrowser for help on using the repository browser.