source: XIOS/dev/dev_olga/src/server.hpp @ 1063

Last change on this file since 1063 was 1054, checked in by oabramkina, 7 years ago

dev: intermediate commit.

  • 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.7 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
[335]10namespace xios
[300]11{
12    class CServer
13    {
[523]14      public:
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);
[1054]24        static void registerContext(void* buff,int count, int leaderRank=0);
[490]25
[523]26        static MPI_Comm intraComm;
[1054]27        static list<MPI_Comm> interCommLeft;           // interComm between server (primary, classical or secondary) and its client (client or primary server)
28        static list<MPI_Comm> interCommRight;          // interComm between primary server and secondary server (non-empty only for primary server pool)
29        static std::list<MPI_Comm> contextInterComms;  // significance ??
[523]30        static CEventScheduler* eventScheduler;
[983]31
[1021]32        static int serverLevel ;
[1009]33
[523]34        struct contextMessage
35        {
36          int nbRecv;
37          int leaderRank;
38        };
[300]39
[523]40        static bool isRoot;
[490]41
[1054]42        static map<string,CContext*> contextList;
[523]43        static bool finished;
44        static bool is_MPI_Initialized;
[490]45
[523]46      public:
47        //! Get rank of the current process
48        static int getRank();
[490]49
[523]50        //! Open a file stream to write the info logs
[490]51        static void openInfoStream(const StdString& fileName);
[523]52        //! Write the info logs to standard output
[490]53        static void openInfoStream();
[523]54        //! Close the info logs file if it opens
[490]55        static void closeInfoStream();
56
[523]57        //! Open a file stream to write the error log
58        static void openErrorStream(const StdString& fileName);
59        //! Write the error log to standard error output
60        static void openErrorStream();
61        //! Close the error log file if it opens
62        static void closeErrorStream();
63
64      private:
65        static int rank;
[1054]66        static int serverLeader;  //!< Leader of the classical or primary server (needed in case of secondary servers)
67        static int serverSize;    //!< Number of procs dedicated to servers (primary and seconday (if any) combined)
68        static int nbPools;       //!< Number of secondary server pools
69        static int poolId;        //!< id of a secondary server pool starting from 1
[490]70        static StdOFStream m_infoStream;
[523]71        static StdOFStream m_errorStream;
72
73        static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb);
74    };
[300]75}
76
77#endif
Note: See TracBrowser for help on using the repository browser.