source: XMLIO_V2/dev/common/src/xmlio/main_server.cpp @ 286

Last change on this file since 286 was 286, checked in by ymipsl, 13 years ago

reprise en main de la version de H. Ozdoba. Correction de différentes erreurs de conception et bug.
Version NEMO operationnel en client/server, interoperabilita avec OASIS, reconstition de fichiers via netcdf4/HDF5

YM

File size: 1.8 KB
Line 
1// XmlIOServer
2#include "xmlioserver.hpp"
3
4#include "attribute_template_impl.hpp"
5#include "group_template_impl.hpp"
6
7#include "client.hpp"
8#include "server.hpp"
9#include "oasis_cinterface.hpp"
10#include <string>
11#include <iostream>
12
13#include <unistd.h>
14
15
16// Point d'entrée du programme principal
17
18int main (int argc, char ** argv, char ** UNUSED (env))
19{
20   try
21   {
22      MPI_Comm comm_client=MPI_COMM_NULL, comm_client_server=MPI_COMM_NULL, comm_server=MPI_COMM_NULL, comm_parent=MPI_COMM_NULL;
23//      sleep(60) ;
24      CTreeManager::ParseFile("iodef.xml");
25
26      CTreeManager::SetCurrentContextId(StdString("xios"));
27      boost::shared_ptr<CVariable> var = CObjectFactory::GetObject<CVariable>("buffer_client_size"); 
28      std::cout<<CObjectFactory::GetObject<CVariable>("xios","using_oasis")->getData<bool>()<<std::endl;
29     
30//      oasis_init(std::string("ionemo")) ;
31//      std::cout<<"Initialisation OASIS Ok"<<std::endl ;
32//      oasis_get_intracomm(comm_parent,std::string("oceanx")) ;
33//      std::cout<<"Appel Oasis intracom Ok"<<std::endl ;
34      CXIOSManager::Initialise(CXIOSManager::CLIENT_SERVER, &argc, &argv);
35     
36      std::cout<<"Appel Dispatch client ?"<<std::endl ;
37      std::cout<<comm_client<<" "<<comm_client_server<<" "<<comm_server<<"  "<<comm_parent<<std::endl ;
38      CMPIManager::DispatchClient(true, comm_client, comm_client_server, comm_server, comm_parent);
39      std::cout<<"Appel Dispatch client Ok"<<std::endl ;
40      CXIOSManager::RunServer("Nemo", comm_client_server, comm_server);
41      CTreeManager::SetCurrentContextId(StdString("nemo"));
42      CServer::CreateServer(comm_client_server)->run();
43      CXIOSManager::Finalize (); 
44
45   }
46   catch (CException & exc)
47   {
48      std::cerr << exc.getMessage () << std::endl;
49      CMPIManager::Finalize ();
50      return (EXIT_FAILURE);
51   }
52   return (EXIT_SUCCESS);
53}
54
Note: See TracBrowser for help on using the repository browser.