Ignore:
Timestamp:
10/18/19 15:40:35 (5 years ago)
Author:
ymipsl
Message:

implementing first guess for service functionnalities.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_SERVICES/src/cxios.cpp

    r1639 r1761  
    1111#include "memtrack.hpp" 
    1212#include "registry.hpp" 
     13#include "ressources_manager.hpp" 
     14#include "services_manager.hpp" 
     15#include "servers_ressource.hpp" 
    1316 
    1417namespace xios 
     
    2023  string CXios::serverPrmFile="./xios_server1"; 
    2124  string CXios::serverSndFile="./xios_server2"; 
    22  
     25  const string CXios::defaultPoolId="default_pool_id" ; 
     26  const string CXios::defaultServerId="default_server_id" ; 
     27  const string CXios::defaultGathererId="default_gatherer_id" ; 
     28   
    2329  bool CXios::xiosStack = true; 
    2430  bool CXios::systemStack = false; 
     
    2632  bool CXios::isClient ; 
    2733  bool CXios::isServer ; 
     34   
    2835  MPI_Comm CXios::globalComm ; 
     36  MPI_Comm CXios::xiosComm ; 
     37 
    2938  bool CXios::usingOasis ; 
    3039  bool CXios::usingServer = false; 
     
    4150  double CXios::recvFieldTimeout = 300.0; 
    4251  bool CXios::checkEventSync=false ; 
    43   
     52 
     53  CDaemonsManager*    CXios::daemonsManager_=nullptr ; 
     54  CRessourcesManager* CXios::ressourcesManager_=nullptr ; 
     55  CServicesManager*   CXios::servicesManager_=nullptr ; 
     56  CContextsManager*   CXios::contextsManager_=nullptr ; 
     57 
    4458  //! Parse configuration file and create some objects from it 
    4559  void CXios::initialize() 
     
    107121    isClient = true; 
    108122 
     123    //CClient::initialize(codeId,localComm,returnComm) ; 
    109124    CClient::initialize(codeId,localComm,returnComm) ; 
    110     if (CClient::getRank()==0) globalRegistry = new CRegistry(returnComm) ; 
    111  
     125     
    112126    // If there are no server processes then we are in attached mode 
    113127    // and the clients are also servers 
     
    130144  { 
    131145     CClient::finalize() ; 
    132      if (CClient::getRank()==0) 
    133      { 
    134        info(80)<<"Write data base Registry"<<endl<<globalRegistry->toString()<<endl ; 
    135        globalRegistry->toFile("xios_registry.bin") ; 
    136        delete globalRegistry ; 
    137      } 
    138  
     146           
    139147#ifdef XIOS_MEMTRACK 
    140148 
     
    172180 
    173181    // Initialize all aspects MPI 
     182   // CServer::initialize(); 
     183 
    174184    CServer::initialize(); 
    175     if (CServer::getRank()==0 && CServer::serverLevel != 1) globalRegistry = new CRegistry(CServer::intraComm) ; 
    176      
     185 
     186    //if (CServer::getRank()==0 && CServer::serverLevel != 1) globalRegistry = new CRegistry(CServer::intraComm) ; 
     187 
     188/*     
    177189    if (printLogs2Files) 
    178190    { 
     
    201213    // Enter the loop to listen message from Client 
    202214    CServer::eventLoop(); 
    203  
     215*/ 
    204216    // Finalize 
     217/*     
    205218    if (CServer::serverLevel == 0) 
    206219    { 
     
    271284      delete globalRegistry; 
    272285    } 
     286  */ 
     287 
    273288    CServer::finalize(); 
    274289 
     
    305320    usingServer = false; 
    306321  } 
     322 
     323  void CXios::launchRessourcesManager(bool isXiosServer) 
     324  { 
     325    ressourcesManager_ = new CRessourcesManager(isXiosServer) ; 
     326  } 
     327 
     328  void CXios::launchServicesManager(bool isXiosServer) 
     329  { 
     330    servicesManager_ = new CServicesManager(isXiosServer) ; 
     331  } 
     332 
     333  void CXios::launchContextsManager(bool isXiosServer) 
     334  { 
     335    contextsManager_ = new CContextsManager(isXiosServer) ; 
     336  } 
     337   
     338  void CXios::launchDaemonsManager(bool isXiosServer) 
     339  { 
     340    daemonsManager_ = new CDaemonsManager(isXiosServer) ; 
     341  } 
     342 
     343  CPoolRessource* CXios::getPoolRessource(void) 
     344  { 
     345    if (isClient) return CClient::getPoolRessource() ; 
     346    else if (isServer) return CServer::getServersRessource()->getPoolRessource() ; 
     347  } 
    307348} 
     349 
Note: See TracChangeset for help on using the changeset viewer.