Ignore:
Timestamp:
12/01/14 16:21:48 (10 years ago)
Author:
rlacroix
Message:

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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/server.hpp

    r501 r523  
    1111    class CServer 
    1212    { 
    13        public: 
     13      public: 
     14        static void initialize(void); 
     15        static void finalize(void); 
     16        static void eventLoop(void); 
     17        static void contextEventLoop(void); 
     18        static void listenContext(void); 
     19        static void listenFinalize(void); 
     20        static void recvContextMessage(void* buff,int count); 
     21        static void listenRootContext(void); 
     22        static void listenRootFinalize(void); 
     23        static void registerContext(void* buff,int count, int leaderRank=0); 
    1424 
    15        static void initialize(void) ; 
    16        static void finalize(void) ; 
    17        static void eventLoop(void) ; 
    18        static void contextEventLoop(void) ; 
    19        static void listenContext(void) ; 
    20        static void listenFinalize(void) ; 
    21        static void recvContextMessage(void* buff,int count) ; 
    22        static void listenRootContext(void) ; 
    23        static void listenRootFinalize(void) ; 
    24        static void registerContext(void* buff,int count, int leaderRank=0) ; 
     25        static MPI_Comm intraComm; 
     26        static list<MPI_Comm> interComm; 
     27        static CEventScheduler* eventScheduler; 
    2528 
    26        static MPI_Comm intraComm ; 
    27        static list<MPI_Comm> interComm ; 
    28        static CEventScheduler* eventScheduler ; 
     29        struct contextMessage 
     30        { 
     31          int nbRecv; 
     32          int leaderRank; 
     33        }; 
    2934 
    30        struct contextMessage 
    31        { 
    32          int nbRecv ; 
    33          int leaderRank ; 
    34        } ; 
     35        static bool isRoot; 
    3536 
    36        static bool isRoot ; 
     37        static map<string,CContext*> contextList; 
     38        static bool finished; 
     39        static bool is_MPI_Initialized; 
    3740 
    38        static map<string,CContext*> contextList ; 
    39        static bool finished ; 
    40        static bool is_MPI_Initialized ; 
     41      public: 
     42        //! Get rank of the current process 
     43        static int getRank(); 
    4144 
    42        public: 
    43          //! Get rank of the current process 
    44          static int getRank(); 
    45  
    46         //! Print Information into a file 
     45        //! Open a file stream to write the info logs 
    4746        static void openInfoStream(const StdString& fileName); 
    48  
    49         //! Print information to standard output 
     47        //! Write the info logs to standard output 
    5048        static void openInfoStream(); 
    51  
    52         //! Close Info stream (closing file) 
     49        //! Close the info logs file if it opens 
    5350        static void closeInfoStream(); 
    5451 
    55        private: 
     52        //! Open a file stream to write the error log 
     53        static void openErrorStream(const StdString& fileName); 
     54        //! Write the error log to standard error output 
     55        static void openErrorStream(); 
     56        //! Close the error log file if it opens 
     57        static void closeErrorStream(); 
     58 
     59      private: 
     60        static int rank; 
    5661        static StdOFStream m_infoStream; 
    57         static int rank ; 
    58     } ; 
     62        static StdOFStream m_errorStream; 
     63 
     64        static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); 
     65    }; 
    5966} 
    6067 
Note: See TracChangeset for help on using the changeset viewer.