source: XIOS3/trunk/src/cxios.hpp

Last change on this file was 2580, checked in by ymipsl, 9 months ago

Tracking unfree MPI windows and communicators.

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: 6.2 KB
RevLine 
[300]1#ifndef __XIOS_HPP__
2#define __XIOS_HPP__
3
[591]4#include "xios_spl.hpp"
[382]5#include "mpi.hpp"
[697]6#include "registry.hpp"
[1761]7#include "ressources_manager.hpp"
8#include "services_manager.hpp"
9#include "contexts_manager.hpp"
10#include "daemons_manager.hpp"
[1878]11#include "coupler_manager.hpp"
[2209]12#include "registry_manager.hpp"
[2547]13#include "thread_manager.hpp"
[2310]14#include "mpi_garbage_collector.hpp"
[300]15
[335]16namespace xios
[300]17{
[512]18  /*!
19  \class CXios
20  */
[300]21  class CXios
22  {
[512]23    public:
[300]24     static void initialize(void) ;
[1639]25     static void initClientSide(const string & codeId, MPI_Comm& localComm, MPI_Comm& returnComm) ;
[1054]26     static void initServerSide(void) ;
[300]27     static void clientFinalize(void) ;
[346]28     static void parseFile(const string& filename) ;
[490]29
[300]30     template <typename T>
[311]31     static T getin(const string& id,const T& defaultValue) ;
[490]32
[311]33     template <typename T>
[300]34     static T getin(const string& id) ;
35
[512]36    public:
37     static string rootFile ; //!< Configuration filename
38     static string xiosCodeId ; //!< Identity for XIOS
[983]39     static string clientFile;        //!< Filename template for client
40     static string serverFile;        //!< Filename template for server
[1021]41     static string serverPrmFile;  //!< Filename template for primary server in case of two server levels
42     static string serverSndFile;  //!< Filename template for secondary server in case of two server levels
[300]43
[1622]44     static bool xiosStack;    //!< Exception handling
45     static bool systemStack;  //!< Exception handling
46
[512]47     static bool isClient ; //!< Check if xios is client
[992]48     static bool isServer ; //!< Check if xios is server
[490]49
[1639]50     static MPI_Comm globalComm ; //!< Global communicator
[1761]51     static MPI_Comm xiosComm ; //!< Global communicator
[490]52
[523]53     static bool printLogs2Files; //!< Printing out logs into files
[1243]54     static bool usingOasis ;     //!< Using Oasis
55     static bool usingServer ;    //!< Using server (server mode)
56     static bool usingServer2 ;   //!< Using secondary server (server mode). IMPORTANT: Use this variable ONLY in CServer::initialize().
57     static int ratioServer2 ;    //!< Percentage of server processors dedicated to secondary server
58     static int nbPoolsServer2 ;  //!< Number of pools created on the secondary server
[718]59     static double bufferSizeFactor; //!< Factor used to tune the buffer size
60     static const double defaultBufferSizeFactor; //!< Default factor value
[719]61     static StdSize minBufferSize; //!< Minimum buffer size
[1227]62     static StdSize maxBufferSize; //!< Maximum buffer size
[512]63     static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible)
[697]64     static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers
[1158]65     static double recvFieldTimeout; //!< Time to wait for data before issuing an error when receiving a field
[1377]66     static bool checkEventSync; //!< For debuuging, check if event are coherent and synchrone on client side
[2329]67
68     static bool checkSumSend; //!< For debugging, compute a checksum of fields sent by the model to the XIOS client (very expensive !)
69     static bool checkSumRecv; //!< For debugging, compute a checksum of fields received by the model through the XIOS client
70
[2535]71     static bool logMemory; //!< Activate memory monitoring for all XIOS process (generate CSV file for https://forge.ipsl.jussieu.fr/ioserver/chrome/site/XIOS_TOOLS/xios_memory.html)
72     static bool reportMemory; //!< Activate memory reporting for all XIOS process (report in log files)
73
[1761]74     static const string defaultPoolId ;
75     static const string defaultServerId ;
76     static const string defaultGathererId ;
[2407]77     static const string defaultWriterId ;
78     static const string defaultReaderId ;
[2335]79     static const string defaultServicesId ;
[512]80
[2209]81     static CRegistryManager* registryManager_ ;
[1761]82     static CRessourcesManager* ressourcesManager_ ;
[1878]83     static CCouplerManager* couplerManager_ ;
[1761]84     static CServicesManager* servicesManager_ ;
85     static CContextsManager* contextsManager_ ;
86     static CDaemonsManager* daemonsManager_ ;
[2310]87     static CMpiGarbageCollector MpiGarbageCollector_  ;
[512]88    public:
[2310]89     static CMpiGarbageCollector& getMpiGarbageCollector(void) { return MpiGarbageCollector_ ; }
90    public:
[499]91     //! Setting xios to use server mode
92     static void setUsingServer();
[490]93
[499]94     //! Setting xios NOT to use server mode
95     static void setNotUsingServer();
[1761]96     
97     //! is using server mode
98     static bool isUsingServer() {return usingServer;}
[491]99
[512]100     //! Initialize server (if any)
[509]101     static  void initServer();
102
[1761]103     static void launchServicesManager( bool isXiosServer) ;
104     static void launchContextsManager(bool isXiosServer) ;
105     static void launchDaemonsManager(bool isXiosServer) ;
106     static void launchRessourcesManager(bool isXiosServer) ;
[1878]107     static void launchCouplerManager(bool isXiosServer) ;
[2209]108     static void launchRegistryManager(bool isXiosServer) ;
[2547]109     static void launchThreadManager(bool isXiosServer) ;
[1878]110   
[1764]111     static void finalizeServicesManager() ;
112     static void finalizeContextsManager() ;
113     static void finalizeDaemonsManager() ;
114     static void finalizeRessourcesManager() ;
[1878]115     static void finalizeCouplerManager() ;
[2209]116     static void finalizeRegistryManager() ;
[2547]117     static void finalizeThreadManager() ;
[1764]118
[2209]119     static CRegistryManager*   getRegistryManager(void) { return registryManager_ ;}
[1761]120     static CRessourcesManager* getRessourcesManager(void) { return ressourcesManager_ ;}
[1878]121     static CCouplerManager*    getCouplerManager(void) { return couplerManager_ ;}
[1761]122     static CServicesManager*   getServicesManager(void) { return servicesManager_ ;}
123     static CContextsManager*   getContextsManager(void) { return contextsManager_ ;}
124     static CDaemonsManager*    getDaemonsManager(void) { return daemonsManager_ ;}
125     static CPoolRessource*     getPoolRessource(void) ;
[2310]126     
[2580]127     static MPI_Comm& getGlobalComm(void) { return globalComm ;}
128     static MPI_Comm& getXiosComm(void) { return xiosComm ;}
[1761]129     static void setXiosComm(MPI_Comm comm) { xiosComm=comm ;}
130     static CRegistry* getGlobalRegistry(void) { return globalRegistry ;}
131     static void setGlobalRegistry(CRegistry* registry) { globalRegistry=registry ;}
132
[512]133    private:
134      //! Parse only Xios part of configuration file
[511]135      static void parseXiosConfig();
[300]136  } ;
137}
138
[352]139//#include "cxios_impl.hpp"
[512]140#endif // __XIOS_HPP__
Note: See TracBrowser for help on using the repository browser.