[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 | { |
---|
[1761] | 9 | class CPoolRessource ; |
---|
[300] | 10 | class CClient |
---|
| 11 | { |
---|
[523] | 12 | public: |
---|
[1639] | 13 | static void initialize(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm); |
---|
[1761] | 14 | static void xiosGlobalCommByFileExchange(MPI_Comm clientComm, const string& codeId) ; |
---|
| 15 | static void xiosGlobalCommByPublishing(MPI_Comm clientComm, const string& codeId) ; |
---|
[523] | 16 | static void finalize(void); |
---|
[2628] | 17 | static void printProfile(void); |
---|
[1639] | 18 | static void registerContext(const string& id, MPI_Comm contextComm); |
---|
[1761] | 19 | static void registerContext_old(const string& id, MPI_Comm contextComm); |
---|
| 20 | static void callOasisEnddef(void) ; |
---|
| 21 | |
---|
[2332] | 22 | static MPI_Comm intraComm_; |
---|
| 23 | static MPI_Comm interComm_; |
---|
[1639] | 24 | static std::list<MPI_Comm> contextInterComms; |
---|
[1148] | 25 | static int serverLeader; |
---|
[523] | 26 | static bool is_MPI_Initialized ; |
---|
[1761] | 27 | static MPI_Comm clientsComm_ ; |
---|
[300] | 28 | |
---|
[1639] | 29 | static MPI_Comm& getInterComm(); |
---|
[992] | 30 | |
---|
[1243] | 31 | //! Get global rank without oasis and current rank in model intraComm in case of oasis |
---|
[490] | 32 | static int getRank(); |
---|
| 33 | |
---|
[523] | 34 | //! Open a file stream to write the info logs |
---|
[490] | 35 | static void openInfoStream(const StdString& fileName); |
---|
[523] | 36 | //! Write the info logs to standard output |
---|
[490] | 37 | static void openInfoStream(); |
---|
[523] | 38 | //! Close the info logs file if it opens |
---|
[490] | 39 | static void closeInfoStream(); |
---|
| 40 | |
---|
[523] | 41 | //! Open a file stream to write the error log |
---|
| 42 | static void openErrorStream(const StdString& fileName); |
---|
| 43 | //! Write the error log to standard error output |
---|
| 44 | static void openErrorStream(); |
---|
| 45 | //! Close the error log file if it opens |
---|
| 46 | static void closeErrorStream(); |
---|
[1761] | 47 | static CPoolRessource* getPoolRessource(void) { return poolRessource_ ; } |
---|
[2274] | 48 | static void finalizePoolRessource() ; |
---|
[490] | 49 | |
---|
[2212] | 50 | static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); |
---|
[523] | 51 | protected: |
---|
[1148] | 52 | static int rank_; //!< Rank in model intraComm |
---|
[523] | 53 | static StdOFStream m_infoStream; |
---|
| 54 | static StdOFStream m_errorStream; |
---|
[490] | 55 | |
---|
[1761] | 56 | static CPoolRessource* poolRessource_ ; |
---|
[523] | 57 | }; |
---|
[300] | 58 | } |
---|
| 59 | |
---|
| 60 | #endif |
---|