source: XIOS/dev/branch_yushan/src/cxios.hpp @ 1144

Last change on this file since 1144 was 1128, checked in by yushan, 7 years ago

log OK with threads

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