Last change
on this file since 2269 was
548,
checked in by rlacroix, 10 years ago
|
Backport r523 into the stable branch.
Improve the message error handling by mimicking the behavior of the info/report logs.
Output the error messages to the standart error message until the context is correctly initialized. Then, output the error messages to a file if the user has set "print_file" parameter to "true".
- Fix: Errors that occured before MPI was initialized (e.g. during the config file parsing) caused a MPI error on top of the original error.
- Fix: The error file could sometimes be misnamed if the error happened before the context was completely known.
|
-
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:
1.4 KB
|
Rev | Line | |
---|
[342] | 1 | #ifndef __CLIENT_HPP__ |
---|
| 2 | #define __CLIENT_HPP__ |
---|
[300] | 3 | |
---|
| 4 | #include "xmlioserver_spl.hpp" |
---|
[382] | 5 | #include "mpi.hpp" |
---|
[300] | 6 | |
---|
[335] | 7 | namespace xios |
---|
[490] | 8 | { |
---|
[300] | 9 | class CClient |
---|
| 10 | { |
---|
[548] | 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); |
---|
[490] | 15 | |
---|
[548] | 16 | static MPI_Comm intraComm; |
---|
| 17 | static MPI_Comm interComm; |
---|
| 18 | static int serverLeader; |
---|
| 19 | static bool is_MPI_Initialized ; |
---|
[300] | 20 | |
---|
[548] | 21 | //! Get rank of the current process |
---|
[490] | 22 | static int getRank(); |
---|
| 23 | |
---|
[548] | 24 | //! Open a file stream to write the info logs |
---|
[490] | 25 | static void openInfoStream(const StdString& fileName); |
---|
[548] | 26 | //! Write the info logs to standard output |
---|
[490] | 27 | static void openInfoStream(); |
---|
[548] | 28 | //! Close the info logs file if it opens |
---|
[490] | 29 | static void closeInfoStream(); |
---|
| 30 | |
---|
[548] | 31 | //! Open a file stream to write the error log |
---|
| 32 | static void openErrorStream(const StdString& fileName); |
---|
| 33 | //! Write the error log to standard error output |
---|
| 34 | static void openErrorStream(); |
---|
| 35 | //! Close the error log file if it opens |
---|
| 36 | static void closeErrorStream(); |
---|
[490] | 37 | |
---|
[548] | 38 | protected: |
---|
| 39 | static int rank; |
---|
| 40 | static StdOFStream m_infoStream; |
---|
| 41 | static StdOFStream m_errorStream; |
---|
[490] | 42 | |
---|
[548] | 43 | static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); |
---|
| 44 | }; |
---|
[300] | 45 | } |
---|
| 46 | |
---|
| 47 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.