source: XIOS/dev/branch_yushan_merged/src/cxios.hpp @ 1179

Last change on this file since 1179 was 1134, checked in by yushan, 7 years ago

branch merged with trunk r1130

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