source: XIOS/dev/dev_ym/XIOS_COUPLING/src/server.hpp @ 2264

Last change on this file since 2264 was 2212, checked in by ymipsl, 3 years ago

Revisiting Memory tracking :

  • MemTrack? has been improved
    • Not need anymore to use private external libaddr2line, fork addr2line process internaly and use bidrectionnale pipe to send stack adress et get in return the demangle stack name
    • Can use cxa_demangle in backup
  • Block memory leak report is output in separate file (xios_xxx.mem),memory block are ordonned in decreasing size.
  • Possibility to output only the n bigest bloc with : "memtrack_blocs" xios parameters
  • Possibility to output only bloc over a given size with : "memtrack_size" xios parameters
  • Implement new method to retrieve the memory consumed in a time interval very similarely to xios timer :

CMemTracker("xios").resume()
CMemTracker("xios").suspend() ;
etc....

YM

  • 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: 3.0 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{
[1761]12    class CServersRessource ;
13
[300]14    class CServer
15    {
[523]16      public:
17        static void initialize(void);
[1761]18        static void xiosGlobalCommByFileExchange(MPI_Comm serverComm) ;
19        static void xiosGlobalCommByPublishing(MPI_Comm serverComm) ;
20
[523]21        static void finalize(void);
22        static void eventLoop(void);
[1765]23       
[1639]24        static MPI_Comm intraComm;
[1761]25        static MPI_Comm serversComm_;
[1639]26        static std::list<MPI_Comm> interCommLeft;           // interComm between server (primary, classical or secondary) and its client (client or primary server)
27        static std::list<MPI_Comm> interCommRight;          // interComm between primary server and secondary server (non-empty only for primary server pool)
28        static std::list<MPI_Comm> contextInterComms;  // list of context intercomms
29        static std::list<MPI_Comm> contextIntraComms;  // list of context intercomms (needed only in case of secondary servers)
[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:
[1243]47        //! Get rank of the current process in the intraComm
[523]48        static int getRank();
[490]49
[1180]50        //!< Get global ranks of secondary server processes
[1168]51        static vector<int>& getSecondaryServerGlobalRanks();
52
[523]53        //! Open a file stream to write the info logs
[490]54        static void openInfoStream(const StdString& fileName);
[523]55        //! Write the info logs to standard output
[490]56        static void openInfoStream();
[523]57        //! Close the info logs file if it opens
[490]58        static void closeInfoStream();
59
[523]60        //! Open a file stream to write the error log
61        static void openErrorStream(const StdString& fileName);
62        //! Write the error log to standard error output
63        static void openErrorStream();
64        //! Close the error log file if it opens
65        static void closeErrorStream();
66
[1761]67        static CServersRessource* getServersRessource(void) { return serversRessource_;}
68        static void launchServersRessource(MPI_Comm commServer) ;
[2212]69        static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb);
[1761]70     
[523]71      private:
[1243]72        static vector<int> sndServerGlobalRanks;  //!< Global ranks of pool leaders on the secondary server
73        static int rank_;                         //!< If (!oasis) global rank, else rank in the intraComm returned by oasis
74        static int nbContexts;                    //!< Number of contexts registered by server
[490]75        static StdOFStream m_infoStream;
[523]76        static StdOFStream m_errorStream;
[1761]77        static CServersRessource* serversRessource_ ;
[523]78    };
[300]79}
80
81#endif
Note: See TracBrowser for help on using the repository browser.