1 | #ifndef __CLIENT_HPP__ |
---|
2 | #define __CLIENT_HPP__ |
---|
3 | |
---|
4 | #include "xios_spl.hpp" |
---|
5 | #include "mpi.hpp" |
---|
6 | |
---|
7 | |
---|
8 | namespace xios |
---|
9 | { |
---|
10 | class CClient |
---|
11 | { |
---|
12 | public: |
---|
13 | static void initialize(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm); |
---|
14 | static void finalize(void); |
---|
15 | static void registerContext(const string& id, ep_lib::MPI_Comm contextComm); |
---|
16 | |
---|
17 | static MPI_Comm intraComm; |
---|
18 | #pragma omp threadprivate(intraComm) |
---|
19 | |
---|
20 | static MPI_Comm interComm; |
---|
21 | #pragma omp threadprivate(interComm) |
---|
22 | |
---|
23 | static std::list<MPI_Comm> contextInterComms; |
---|
24 | // #pragma omp threadprivate(contextInterComms) |
---|
25 | //std::list<MPI_Comm> contextInterComms; |
---|
26 | |
---|
27 | static int serverLeader; |
---|
28 | //#pragma omp threadprivate(serverLeader) |
---|
29 | |
---|
30 | static bool is_MPI_Initialized ; |
---|
31 | //#pragma omp threadprivate(is_MPI_Initialized) |
---|
32 | |
---|
33 | //! Get rank of the current process |
---|
34 | static int getRank(); |
---|
35 | |
---|
36 | //! Open a file stream to write the info logs |
---|
37 | static void openInfoStream(const StdString& fileName); |
---|
38 | //! Write the info logs to standard output |
---|
39 | static void openInfoStream(); |
---|
40 | //! Close the info logs file if it opens |
---|
41 | static void closeInfoStream(); |
---|
42 | |
---|
43 | //! Open a file stream to write the error log |
---|
44 | static void openErrorStream(const StdString& fileName); |
---|
45 | //! Write the error log to standard error output |
---|
46 | static void openErrorStream(); |
---|
47 | //! Close the error log file if it opens |
---|
48 | static void closeErrorStream(); |
---|
49 | |
---|
50 | protected: |
---|
51 | static int rank; |
---|
52 | #pragma omp threadprivate(rank) |
---|
53 | |
---|
54 | static StdOFStream m_infoStream; |
---|
55 | //#pragma omp threadprivate(m_infoStream) |
---|
56 | |
---|
57 | static StdOFStream m_errorStream; |
---|
58 | //#pragma omp threadprivate(m_errorStream) |
---|
59 | |
---|
60 | static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); |
---|
61 | }; |
---|
62 | } |
---|
63 | |
---|
64 | #endif |
---|