Changeset 249 for XMLIO_V2/dev/dev_rv/src4/xmlio/main_server.cpp
- Timestamp:
- 07/06/11 13:55:03 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src4/xmlio/main_server.cpp
r242 r249 16 16 #include "xmlioserver_spl.hpp" 17 17 18 #include "inetcdf4.hpp" 19 #include "inetcdf4_impl.hpp" 20 #include "inetcdf4_adv.hpp" 21 #include "inetcdf4_adv_impl.hpp" 22 #include "lscereader.hpp" 18 #include "mpi_interface.hpp" 19 #include "onetcdf4.hpp" 20 #include "onetcdf4_impl.hpp" 23 21 24 22 namespace xios = xmlioserver; … … 27 25 //~ using namespace xios::tree; 28 26 //~ using namespace xios::xml; 29 //~using namespace xios::comm;27 using namespace xios::comm; 30 28 //~ using namespace xios::func; 31 using namespace xios::vtk;32 29 33 30 // Point d'entrée du programme serveur principal. 34 int main (int XIOS_UNUSED (argc), char ** XIOS_UNUSED (argv), char ** XIOS_UNUSED (env))31 int main (int argc, char ** argv, char ** XIOS_UNUSED (env)) 35 32 { 36 33 try 37 34 { 35 CMPIManager::Initialise(&argc, &argv); 36 { 37 MPI_Comm cworld = CMPIManager::GetCommWorld(); 38 int rank = CMPIManager::GetCommRank(); 39 int size = CMPIManager::GetCommSize(); 40 41 CONetCDF4 output("wk/data/herve.nc", false, &cworld); 42 43 CONetCDF4::CNetCDF4Path path; 44 path.push_back("ozdoba"); 45 46 output.addGroup("ozdoba"); 47 output.setCurrentPath(path); 48 output.addDimension("time"); 49 output.addDimension("x", 10); 50 output.addDimension("y", 10); 51 52 std::vector<std::string> dims; 53 dims.push_back("time"); 54 dims.push_back("x"); 55 dims.push_back("y"); 56 57 std::string toto("toto"); 58 output.addVariable(toto, NC_INT, dims); 38 59 60 output.writeAttribute("att1", "llo"); 61 62 std::vector<int> vvv; 63 vvv.push_back(1); 64 output.writeAttribute("att1", vvv, &toto); 65 vvv.push_back(5); 66 output.writeAttribute("att5", vvv, &toto); 67 68 boost::multi_array<int, 2> data(boost::extents[2][10]); 69 boost::multi_array<int, 2>::iterator it = data.begin(), end = data.end(); 70 71 for (std::size_t i = 0; i < data.num_elements(); i++) data.data()[i] = rank; 39 72 73 std::vector<std::size_t> _start; 74 std::vector<std::size_t> _count; 75 _start.push_back(10*rank/size); 76 _count.push_back(2); 77 _start.push_back(0); 78 _count.push_back(10); 79 80 output.writeData( data, toto, 0, false, &_start, &_count); 81 } 40 82 83 CMPIManager::Finalize(); 41 84 } 42 85 catch (xios::CException & _exception) 43 86 { 44 87 std::cerr << _exception.getMessage() << std::endl; 88 CMPIManager::Finalize(); 45 89 return (-1); 46 90 }
Note: See TracChangeset
for help on using the changeset viewer.