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