source: XMLIO_V2/dev/common/src/cxios.cpp @ 300

Last change on this file since 300 was 300, checked in by ymipsl, 12 years ago

nouvelle version de developpement de xios

  • nouvelle interface fortran
  • recodage complet de la couche de communication
  • et bien d'autres choses...

YM

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1
2#include "xmlioserver_spl.hpp"
3#include "cxios.hpp"
4#include "client_ym.hpp"
5#include "server_ym.hpp"
6#include "tree_manager.hpp"
7#include <boost/functional/hash.hpp>
8#include <mpi.h>
9
10namespace xmlioserver
11{
12  string CXios::rootFile="./iodef.xml" ;
13  string CXios::xiosCodeId="xios.x" ;
14 
15  bool CXios::isClient ;
16  bool CXios::isServer ;
17  MPI_Comm CXios::globalComm ;
18  bool CXios::usingOasis ;
19  bool CXios::usingServer ;   
20 
21  void CXios::initialize()
22  {
23    tree::CTreeManager::ParseFile(rootFile);
24    usingServer=getin<bool>("using_server") ;
25    usingOasis=getin<bool>("using_oasis") ;
26    info.setLevel(getin<int>("info_level")) ;
27    globalComm=MPI_COMM_WORLD ;
28  }
29
30
31  void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm)
32  {
33     
34    initialize() ;
35   
36    isClient=true;
37    if (usingServer) isServer=false;
38    else isServer=true ;
39   
40    ym::CClient::initialize(codeId,localComm,returnComm) ;
41
42  }   
43
44  void CXios::clientFinalize(void)
45  {
46     ym::CClient::finalize() ;   
47  }   
48 
49 
50  void CXios::initServerSide(void)
51  {
52    initialize();
53
54    if (!usingServer) ERROR("void CXios::initServerSide(void)",<<"using_server is set to <false> and server initialization is called") ;
55    isClient=true;
56    isServer=false ;
57
58    ym::CServer::initialize() ;
59  } 
60 
61
62}
Note: See TracBrowser for help on using the repository browser.