source: XIOS/dev/dev_ym/XIOS_COUPLING/src/cxios.hpp @ 2335

Last change on this file since 2335 was 2335, checked in by jderouillat, 2 years ago

Introduced a new service (named defaultServicesId which contains all gatherers and all IO servers) to manage oasis_enddef through the different levels of servers. OASIS integration is moved in a dedicated virtual class CThirdPartyDriver whose an instance is owned by CServer.

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