source: XIOS/dev/branch_yushan_merged/src/server.hpp @ 1141

Last change on this file since 1141 was 1134, checked in by yushan, 7 years ago

branch merged with trunk r1130

  • 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: 2.1 KB
RevLine 
[342]1#ifndef __SERVER_HPP__
2#define __SERVER_HPP__
[300]3
[591]4#include "xios_spl.hpp"
[300]5#include "context.hpp"
[697]6#include "context_client.hpp"
[382]7#include "mpi.hpp"
[492]8#include "event_scheduler.hpp"
[300]9
[1134]10#ifdef _usingEP
11#include "ep_declaration.hpp"
12#endif
13
[335]14namespace xios
[300]15{
16    class CServer
17    {
[523]18      public:
19        static void initialize(void);
20        static void finalize(void);
21        static void eventLoop(void);
22        static void contextEventLoop(void);
23        static void listenContext(void);
24        static void listenFinalize(void);
25        static void recvContextMessage(void* buff,int count);
26        static void listenRootContext(void);
27        static void listenRootFinalize(void);
28        static void registerContext(void* buff,int count, int leaderRank=0);
[490]29
[523]30        static MPI_Comm intraComm;
31        static list<MPI_Comm> interComm;
[655]32        static std::list<MPI_Comm> contextInterComms;
[523]33        static CEventScheduler* eventScheduler;
[697]34       
[523]35        struct contextMessage
36        {
37          int nbRecv;
38          int leaderRank;
39        };
[300]40
[523]41        static bool isRoot;
[490]42
[523]43        static map<string,CContext*> contextList;
44        static bool finished;
45        static bool is_MPI_Initialized;
[490]46
[523]47      public:
48        //! Get rank of the current process
49        static int getRank();
[490]50
[523]51        //! Open a file stream to write the info logs
[490]52        static void openInfoStream(const StdString& fileName);
[523]53        //! Write the info logs to standard output
[490]54        static void openInfoStream();
[523]55        //! Close the info logs file if it opens
[490]56        static void closeInfoStream();
57
[523]58        //! Open a file stream to write the error log
59        static void openErrorStream(const StdString& fileName);
60        //! Write the error log to standard error output
61        static void openErrorStream();
62        //! Close the error log file if it opens
63        static void closeErrorStream();
64
65      private:
66        static int rank;
[490]67        static StdOFStream m_infoStream;
[523]68        static StdOFStream m_errorStream;
69
70        static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb);
71    };
[300]72}
73
74#endif
Note: See TracBrowser for help on using the repository browser.