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

Last change on this file since 1878 was 1878, checked in by ymipsl, 4 years ago

Coupling Branch.
Implementing a coupler scheduler, to impose order for intercommunicator creation between several coupling context.
Two way coupling is now working.

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