Changeset 253 for XMLIO_V2/dev/dev_rv/src4/xmlio/main_server.cpp
- Timestamp:
- 07/07/11 19:05:48 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src4/xmlio/main_server.cpp
r249 r253 35 35 CMPIManager::Initialise(&argc, &argv); 36 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);59 37 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;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 38 } 82 83 39 CMPIManager::Finalize(); 84 40 } … … 86 42 { 87 43 std::cerr << _exception.getMessage() << std::endl; 88 CMPIManager::Finalize();89 44 return (-1); 90 45 }
Note: See TracChangeset
for help on using the changeset viewer.