source: XIOS/dev/branch_openmp/src/client.hpp @ 1460

Last change on this file since 1460 was 1460, checked in by yushan, 3 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: 2.0 KB
Line 
1#ifndef __CLIENT_HPP__
2#define __CLIENT_HPP__
3
4#include "xios_spl.hpp"
5#include "mpi.hpp"
6
7namespace xios
8{
9  class CClient
10  {
11    public:
12      static void initialize(const string& codeId, ep_lib::MPI_Comm& localComm, ep_lib::MPI_Comm& returnComm);
13      static void finalize(void);
14      static void registerContext(const string& id, ep_lib::MPI_Comm contextComm);
15
16      static ep_lib::MPI_Comm intraComm;
17      #pragma omp threadprivate(intraComm)
18
19      static ep_lib::MPI_Comm interComm;
20      #pragma omp threadprivate(interComm)
21
22      //static std::list<MPI_Comm> contextInterComms;
23      static std::list<ep_lib::MPI_Comm> *contextInterComms_ptr;
24      #pragma omp threadprivate(contextInterComms_ptr)
25
26      static int serverLeader;
27      #pragma omp threadprivate(serverLeader)
28
29      static bool is_MPI_Initialized ;
30      #pragma omp threadprivate(is_MPI_Initialized)
31
32      static ep_lib::MPI_Comm& getInterComm();
33
34      //! Get global rank without oasis and current rank in model intraComm in case of oasis
35      static int getRank();
36
37      //! Open a file stream to write the info logs
38      static void openInfoStream(const StdString& fileName);
39      //! Write the info logs to standard output
40      static void openInfoStream();
41      //! Close the info logs file if it opens
42      static void closeInfoStream();
43
44      //! Open a file stream to write the error log
45      static void openErrorStream(const StdString& fileName);
46      //! Write the error log to standard error output
47      static void openErrorStream();
48      //! Close the error log file if it opens
49      static void closeErrorStream();
50
51    protected:
52      static int rank_;                 //!< Rank in model intraComm
53      #pragma omp threadprivate(rank_)
54
55      static StdOFStream m_infoStream;
56      #pragma omp threadprivate(m_infoStream)
57      static StdOFStream m_errorStream;
58      #pragma omp threadprivate(m_errorStream)
59
60      static StdOFStream array_infoStream[16];
61
62      static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb);
63  };
64}
65
66#endif
Note: See TracBrowser for help on using the repository browser.