[342] | 1 | #ifndef __CLIENT_HPP__ |
---|
| 2 | #define __CLIENT_HPP__ |
---|
[300] | 3 | |
---|
[591] | 4 | #include "xios_spl.hpp" |
---|
[382] | 5 | #include "mpi.hpp" |
---|
[300] | 6 | |
---|
[335] | 7 | namespace xios |
---|
[490] | 8 | { |
---|
[1331] | 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); |
---|
[490] | 15 | |
---|
[1331] | 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) |
---|
[300] | 21 | |
---|
[1331] | 22 | //static std::list<MPI_Comm> contextInterComms; |
---|
| 23 | static std::list<ep_lib::MPI_Comm> *contextInterComms_ptr; |
---|
| 24 | #pragma omp threadprivate(contextInterComms_ptr) |
---|
[490] | 25 | |
---|
[1331] | 26 | static int serverLeader; |
---|
| 27 | #pragma omp threadprivate(serverLeader) |
---|
| 28 | |
---|
| 29 | static bool is_MPI_Initialized ; |
---|
| 30 | #pragma omp threadprivate(is_MPI_Initialized) |
---|
[490] | 31 | |
---|
[1331] | 32 | //! Get rank of the current process |
---|
| 33 | static int getRank(); |
---|
[490] | 34 | |
---|
[1331] | 35 | //! Open a file stream to write the info logs |
---|
| 36 | static void openInfoStream(const StdString& fileName); |
---|
| 37 | //! Write the info logs to standard output |
---|
| 38 | static void openInfoStream(); |
---|
| 39 | //! Close the info logs file if it opens |
---|
| 40 | static void closeInfoStream(); |
---|
[490] | 41 | |
---|
[1331] | 42 | //! Open a file stream to write the error log |
---|
| 43 | static void openErrorStream(const StdString& fileName); |
---|
| 44 | //! Write the error log to standard error output |
---|
| 45 | static void openErrorStream(); |
---|
| 46 | //! Close the error log file if it opens |
---|
| 47 | static void closeErrorStream(); |
---|
| 48 | |
---|
| 49 | protected: |
---|
| 50 | static int rank; |
---|
| 51 | #pragma omp threadprivate(rank) |
---|
| 52 | |
---|
| 53 | static StdOFStream m_infoStream; |
---|
| 54 | #pragma omp threadprivate(m_infoStream) |
---|
| 55 | static StdOFStream m_errorStream; |
---|
| 56 | #pragma omp threadprivate(m_errorStream) |
---|
| 57 | |
---|
[1342] | 58 | static StdOFStream array_infoStream[16]; |
---|
| 59 | |
---|
[1331] | 60 | static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); |
---|
| 61 | }; |
---|
[300] | 62 | } |
---|
| 63 | |
---|
| 64 | #endif |
---|