Changeset 187
- Timestamp:
- 05/03/11 11:55:06 (14 years ago)
- Location:
- XMLIO_V2/dev/dev_rv
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/Makefile.wk
r186 r187 2 2 ################### Projet xios - xmlioserver ##################### 3 3 # # 4 # * Copyright© OZDOBA Hervé (herve.ozdoba@lsce.ipsl.fr) * #4 # * © OZDOBA Hervé (herve.ozdoba@lsce.ipsl.fr) * # 5 5 # * © MEURDESOIF Yann (yann.meurdesoif@cea.fr) * # 6 6 # * Avril 2010 - Octobre 2011 * # … … 15 15 VTK = no 16 16 GUI = no 17 NPROC = 317 NPROC = 6 18 18 CSUITE = gnu 19 19 PFORME = fedora-wk -
XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template_impl.hpp
r182 r187 59 59 T CAttributeTemplate<T>::getValue(void) const 60 60 { 61 if (SuperClass::isEmpty()) 62 ERROR("T CAttributeTemplate<T>::getValue(void) const", 63 << "[ id = " << this->getId() << "]" 64 << " L'attribut est requis mais n'est pas défini !"); 61 65 return (SuperClass::getValue<T>()); 62 66 } -
XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_nemo.f90
r184 r187 20 20 comm_client_server ! communicateur client-serveur 21 21 REAL(kind = 8), DIMENSION(10000) :: real_array 22 INTEGER :: rankGrp, error23 INTEGER :: ibegin, iend, jbegin, jend, data_ni, data_ibegin 22 INTEGER :: rankGrp, sizeGrp, error, i 23 INTEGER :: ibegin, iend, jbegin, jend, data_ni, data_ibegin, ni_glo, nj_glo 24 24 TYPE(XDate) :: init_date_nemo = XDate(1985, 03, 15, 17, 35, 00) 25 25 TYPE(XHandle) :: nemo_style_ctxt = NULLHANDLE … … 28 28 temp_mod__ = NULLHANDLE, & 29 29 temp_mod___ = NULLHANDLE 30 31 32 30 33 31 CALL MPI_COMM_RANK(comm_client, rankGrp, error) 34 32 CALL MPI_COMM_SIZE(comm_client, sizeGrp, error) 33 34 DO i = 1, 10000 35 real_array(i) = i; 36 END DO 37 35 38 IF (rankGrp .EQ. 0) THEN 36 39 PRINT*," Starting NEMO Client Tests ..." … … 71 74 ftype = GFIELD, & 72 75 operation_ = "instant", & 73 enabled_ = .TRUE._1) 76 enabled_ = .TRUE._1, & 77 freq_op_ = "1h") 74 78 75 79 CALL xml_tree_add(parent_hdl = temp_mod, & … … 214 218 child_id = "simple_domaine_grp") 215 219 220 221 ni_glo = 100 222 nj_glo = 50 216 223 IF (rankGrp .EQ. 0) THEN 217 224 ibegin = 1 225 iend = 26 226 jbegin = 1 227 jend = 50 228 data_ni = 25 229 data_ibegin = 0 230 ELSE IF (rankGrp .EQ. 1) THEN 231 ibegin = 25 218 232 iend = 51 219 233 jbegin = 1 220 234 jend = 50 221 data_ni = 50222 data_ibegin = 0223 ELSE IF (rankGrp .EQ. 1) THEN235 data_ni = 25 236 data_ibegin = 1 237 ELSE IF (rankGrp .EQ. 2) THEN 224 238 ibegin = 50 239 iend = 76 240 jbegin = 1 241 jend = 50 242 data_ni = 25 243 data_ibegin = 1 244 ELSE IF (rankGrp .EQ. 3) THEN 245 ibegin = 75 225 246 iend = 100 226 247 jbegin = 1 227 248 jend = 50 228 data_ni = 50229 data_ibegin = 1 249 data_ni = 25 250 data_ibegin = 1 230 251 END IF 231 252 … … 235 256 latvalue_ = real_array(1:((jend-jbegin+1)*(iend-ibegin+1))), & 236 257 data_dim_ = 2, & 237 ni_glo_ = 100,&238 nj_glo_ = 50,&258 ni_glo_ = ni_glo, & 259 nj_glo_ = nj_glo, & 239 260 ibegin_ = ibegin, & 240 261 iend_ = iend, & … … 269 290 zoom_ibegin_ = 21, & 270 291 zoom_jbegin_ = 5 , & 271 zoom_ni_ = 60, &292 zoom_ni_ = 20, & 272 293 zoom_nj_ = 15) 273 294 … … 278 299 child_id = "simple_domaine1") 279 300 301 302 ni_glo = 90 303 nj_glo = 20 280 304 IF (rankGrp .EQ. 0) THEN 281 305 ibegin = 1 282 306 iend = 90 283 307 jbegin = 1 284 jend = 10308 jend = 5 285 309 ELSE IF (rankGrp .EQ. 1) THEN 286 310 ibegin = 1 287 311 iend = 90 312 jbegin = 6 313 jend = 10 314 ELSE IF (rankGrp .EQ. 2) THEN 315 ibegin = 1 316 iend = 90 288 317 jbegin = 11 318 jend = 15 319 ELSE IF (rankGrp .EQ. 3) THEN 320 ibegin = 1 321 iend = 90 322 jbegin = 16 289 323 jend = 20 290 324 END IF … … 298 332 latvalue_ = real_array(1:((jend-jbegin+1)*(iend-ibegin+1))), & 299 333 data_dim_ = 2, & 300 ni_glo_ = 90,&301 nj_glo_ = 20,&334 ni_glo_ = ni_glo, & 335 nj_glo_ = nj_glo, & 302 336 ibegin_ = ibegin, & 303 337 iend_ = iend, & -
XMLIO_V2/dev/dev_rv/src/xmlio/functor.cpp
r152 r187 15 15 16 16 CFunctor::CFunctor(const StdString & id, DoubleArray doutput, 17 const std::vector< size_t> size,17 const std::vector<StdSize> size, 18 18 const CFunData & data, CFuncType type) 19 19 : SuperClass(id) … … 36 36 { return (this->doutput); } 37 37 38 const std::vector< size_t> & CFunctor::getShape(void) const38 const std::vector<StdSize> & CFunctor::getShape(void) const 39 39 { return (this->size); } 40 40 41 size_tCFunctor::getSize(void) const41 StdSize CFunctor::getSize(void) const 42 42 { return (this->doutput->size()); } 43 43 44 44 //--------------------------------------------------------------- 45 45 46 void CFunctor::resize( size_t x, size_t y, size_tz)46 void CFunctor::resize(StdSize x, StdSize y, StdSize z) 47 47 { 48 48 this->size.clear(); … … 55 55 void CFunctor::resize(const std::vector<StdSize> & sizes) 56 56 { 57 size_tnewsize = 1;57 StdSize newsize = 1; 58 58 this->size.clear(); 59 59 std::vector<StdSize>::const_iterator it = sizes.begin(), end = sizes.end(); -
XMLIO_V2/dev/dev_rv/src/xmlio/main_server.cpp
r185 r187 16 16 CXIOSManager::Initialise(CXIOSManager::CLIENT_SERVER, &argc, &argv); 17 17 18 CXIOSManager::AddClient("nemo" , 2, 2, &nemo_fake_entry);18 CXIOSManager::AddClient("nemo" , 4, 2, &nemo_fake_entry); 19 19 //CXIOSManager::AddClient("orchidee", 1, 1, &orchidee_fake_entry); 20 20 //CXIOSManager::AddClient("lmdz" , 4, 2, &lmdz_fake_entry); -
XMLIO_V2/dev/dev_rv/src/xmlio/manager/xios_manager.hpp
r180 r187 48 48 comm::CMPIManager::GetCommWorld()); 49 49 50 p rotected:50 public : 51 51 52 52 /// Accesseurs statiques /// … … 54 54 static XIOSStatus GetStatus(void); 55 55 static StdString GetClientName(void); 56 57 protected : 56 58 57 59 static StdSize GetNbClient(void); -
XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.cpp
r185 r187 5 5 #include "group_template_impl.hpp" 6 6 7 #include "mpi_manager.hpp" 8 7 9 #include <algorithm> 8 10 … … 14 16 CDomain::CDomain(void) 15 17 : CObjectTemplate<CDomain>(), CDomainAttributes() 16 , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[ 10][10])), relFiles()18 , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[0][0])), relFiles() 17 19 , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub() 18 20 , lonvalue_sub(), latvalue_sub() … … 21 23 CDomain::CDomain(const StdString & id) 22 24 : CObjectTemplate<CDomain>(id), CDomainAttributes() 23 , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[ 10][10])), relFiles()25 , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[0][0])), relFiles() 24 26 , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub() 25 27 , lonvalue_sub(), latvalue_sub() … … 124 126 (ni_glo.isEmpty() || nj_glo.getValue() <= 0 )) 125 127 ERROR("CDomain::checkAttributes(void)", 128 << "[ Id = " << this->getId() << " ] " 126 129 << "Le domaine global est mal défini," 127 130 << " vérifiez les valeurs de \'ni_glo\' et \'nj_glo\' !") ; … … 159 162 ibegin.getValue() < 1 || iend.getValue() > ni_glo.getValue()) 160 163 ERROR("CDomain::checkAttributes(void)", 164 << "[ Id = " << this->getId() << " ] " 161 165 << "Domaine local mal défini," 162 166 << " vérifiez les valeurs ni, ni_glo, ibegin, iend") ; … … 294 298 data_ibegin.setValue(0) ; 295 299 if (data_jbegin.isEmpty() && (data_dim.getValue() == 2)) 296 300 data_jbegin.setValue(0) ; 297 301 298 302 if (!data_ni.isEmpty() && (data_ni.getValue() <= 0)) … … 398 402 void CDomain::completeLonLat(void) 399 403 { 400 //ARRAY_CREATE(value, valuetype, numdims, extent)// todo 401 //ARRAY_CREATE(value, valuetype, numdims, extent) 404 ARRAY_CREATE(lonvalue_temp, double, 1, [0]); 405 ARRAY_CREATE(latvalue_temp, double, 1, [0]); 406 407 const int ibegin_serv = ibegin.getValue(), 408 jbegin_serv = jbegin.getValue(), 409 zoom_ni_serv = zoom_ni_loc.getValue(), 410 zoom_nj_serv = zoom_nj_loc.getValue(); 411 412 /*std::cout << "Rang du serveur :" << comm::CMPIManager::GetCommRank() << std::endl 413 << "Begin serv : " << ibegin_serv << ", " << jbegin_serv << std::endl 414 << "End serv : " << iend_serv << ", " << jend_serv << std::endl 415 << "Zoom_loc begin : " << zoom_ibegin_loc << ", " << zoom_jbegin_loc << std::endl 416 << "Zoom_loc size : " << zoom_ni_loc << ", " << zoom_nj_loc << std::endl;*/ 417 402 418 403 419 ARRAY(double, 1) lonvalue_ = this->lonvalue.getValue(), … … 406 422 if (this->data_dim.getValue() == 2) 407 423 { 424 StdSize dm = zoom_ni_serv * zoom_nj_serv; 408 425 StdSize dn = this->ni.getValue() * this->nj.getValue(); 426 409 427 lonvalue_->resize(boost::extents[dn]); 410 428 latvalue_->resize(boost::extents[dn]); 411 412 for (StdSize k = 0; k < lonvalue_sub.size(); k++) 413 { 414 int l = 0; 415 ARRAY(double, 1) lonvalue_loc = this->lonvalue_sub[k], 416 latvalue_loc = this->latvalue_sub[k]; 417 const int ibegin_loc = ibegin_sub[k], iend_loc = iend_sub[k], 418 jbegin_loc = jbegin_sub[k], jend_loc = jend_sub[k]; 419 420 for (int i = ibegin_loc-1; i <= (iend_loc-1); i++) 421 { 422 for (int j = jbegin_loc-1; j <= (jend_loc-1); j++) 423 { 424 (*lonvalue_)[i+j*this->ni.getValue()] = (*lonvalue_loc)[l]; 425 (*latvalue_)[i+j*this->ni.getValue()] = (*latvalue_loc)[l++]; 426 } 427 } 428 } 429 } 430 else 431 { 432 StdSize dn = this->ni.getValue(); 433 lonvalue_->resize(boost::extents[dn]); 434 latvalue_->resize(boost::extents[dn]); 429 lonvalue_temp->resize(boost::extents[dm]); 430 latvalue_temp->resize(boost::extents[dm]); 435 431 436 432 for (StdSize k = 0; k < lonvalue_sub.size(); k++) … … 442 438 jbegin_loc = jbegin_sub[k], jend_loc = jend_sub[k]; 443 439 444 for (int i = ibegin_loc-1; i <= (iend_loc-1); i++) 440 for (int i = ibegin_loc - ibegin_serv; i < (iend_loc - ibegin_serv + 1); i++) 441 { 442 for (int j = jbegin_loc - jbegin_serv; j < (jend_loc - jbegin_serv + 1); j++) 443 { 444 (*lonvalue_)[i + j * this->ni.getValue()] = (*lonvalue_loc)[l]; 445 (*latvalue_)[i + j * this->ni.getValue()] = (*latvalue_loc)[l++]; 446 } 447 } 448 } 449 this->lonvalue.setValue(lonvalue_temp); 450 this->latvalue.setValue(latvalue_temp); 451 } 452 else 453 { 454 lonvalue_->resize(boost::extents[this->ni.getValue()]); 455 latvalue_->resize(boost::extents[this->nj.getValue()]); 456 lonvalue_temp->resize(boost::extents[zoom_ni_serv]); 457 latvalue_temp->resize(boost::extents[zoom_nj_serv]); 458 459 for (StdSize k = 0; k < lonvalue_sub.size(); k++) 460 { 461 int l = 0; 462 ARRAY(double, 1) lonvalue_loc = this->lonvalue_sub[k], 463 latvalue_loc = this->latvalue_sub[k]; 464 const int ibegin_loc = ibegin_sub[k], iend_loc = iend_sub[k], 465 jbegin_loc = jbegin_sub[k], jend_loc = jend_sub[k]; 466 467 for (int i = ibegin_loc - ibegin_serv; i < (iend_loc - ibegin_loc + 1); i++) 445 468 (*lonvalue_)[i] = (*lonvalue_loc)[l++]; 446 469 447 for (int j = jbegin_loc -1, l = 0; j <= (jend_loc-1); j++)470 for (int j = jbegin_loc - jbegin_serv; j < (jend_loc - jbegin_loc + 1); j++) 448 471 (*latvalue_)[j] = (*latvalue_loc)[l++]; 449 } 472 } 473 this->lonvalue.setValue(lonvalue_temp); 474 this->latvalue.setValue(latvalue_temp); 450 475 } 451 476 } … … 551 576 else 552 577 { // CÃŽté serveur uniquement 553 this->completeLonLat(); 578 if (!this->isEmpty()) 579 this->completeLonLat(); 554 580 } 555 581 this->completeMask(); -
XMLIO_V2/dev/dev_rv/src/xmlio/node/field.cpp
r182 r187 7 7 #include "node_type.hpp" 8 8 9 #include "xios_manager.hpp" 10 9 11 namespace xmlioserver{ 10 12 namespace tree { … … 14 16 CField::CField(void) 15 17 : CObjectTemplate<CField>(), CFieldAttributes() 16 , baseRefObject(), refObject(), grid(), file(), foperation(NULL) 18 , refObject(), baseRefObject() 19 , grid(), file() 20 , freq_operation(), freq_write() 21 , foperation() 22 , data() 17 23 { /* Ne rien faire de plus */ } 18 24 19 25 CField::CField(const StdString & id) 20 26 : CObjectTemplate<CField>(id), CFieldAttributes() 21 , baseRefObject(), refObject(), foperation(NULL) 27 , refObject(), baseRefObject() 28 , grid(), file() 29 , freq_operation(), freq_write() 30 , foperation() 31 , data() 22 32 { /* Ne rien faire de plus */ } 23 33 … … 26 36 this->grid.reset() ; 27 37 this->file.reset() ; 28 if (this->foperation == NULL)29 delete this->foperation;38 this->foperation.reset() ; 39 this->data.reset() ; 30 40 } 31 41 … … 107 117 boost::shared_ptr<CField> refer_sptr; 108 118 CField * refer_ptr = this; 119 109 120 this->baseRefObject = CObjectFactory::GetObject<CField>(this); 121 110 122 while (refer_ptr->hasDirectFieldReference()) 111 123 { … … 131 143 void CField::solveOperation(void) 132 144 { 133 // TODO : à compléter; 145 using namespace func; 146 using namespace date; 147 148 StdString id = this->getBaseFieldReference()->getId(); 149 if (operation.isEmpty() || freq_op.isEmpty() || this->file->output_freq.isEmpty()) 150 { 151 ERROR("CField::solveOperation(void)", 152 << "[ id = " << id << "]" 153 << "Impossible de définir une opération pour le champ !"); 154 } 155 156 if (CXIOSManager::GetStatus() == CXIOSManager::LOC_SERVER) 157 { 158 this->freq_operation = CDuration::FromString(this->file->output_freq.getValue()); 159 this->freq_write = CDuration::FromString(this->file->output_freq.getValue()); 160 //this->foperation = boost::shared_ptr<func::CFunctor>(new CInstant()); 161 } 162 else 163 { 164 this->freq_operation = CDuration::FromString(freq_op.getValue()); 165 this->freq_write = CDuration::FromString(this->file->output_freq.getValue()); 166 167 #define DECLARE_FUNCTOR(MType, mtype) \ 168 if (operation.getValue().compare(#mtype) == 0){} 169 //this->foperation = boost::shared_ptr<func::CFunctor>(new C##MType()); 170 171 #include "functor_type.conf" 172 } 134 173 } 135 174 -
XMLIO_V2/dev/dev_rv/src/xmlio/node/field.hpp
r181 r187 5 5 #include "xmlioserver_spl.hpp" 6 6 #include "group_factory.hpp" 7 8 7 #include "functor.hpp" 9 8 #include "functor_type.hpp" 10 9 #include "duration.hpp" 11 10 #include "declare_group.hpp" 12 11 … … 90 89 91 90 /// Propriétés privées /// 91 92 std::vector<boost::shared_ptr<CField> > refObject; 92 93 boost::shared_ptr<CField> baseRefObject; 93 std::vector<boost::shared_ptr<CField> > refObject; 94 boost::shared_ptr<CGrid> grid ; 95 boost::shared_ptr<CFile> file; 94 96 95 boost::shared_ptr<CGrid> grid;96 boost::shared_ptr< CFile> file;97 98 func::CFunctor * foperation;97 date::CDuration freq_operation, freq_write; 98 boost::shared_ptr<func::CFunctor> foperation; 99 100 ARRAY(double, 1) data; 99 101 100 102 }; // class CField -
XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.cpp
r185 r187 64 64 if (domain->IsWritten(this->filename)) return; 65 65 domain->checkAttributes(); 66 67 if (domain->isEmpty()) return; 66 68 67 69 std::vector<StdString> dim0, dim1; … … 201 203 boost::shared_ptr<CDomain> domain = 202 204 CObjectFactory::GetObject<CDomain>(grid->domain_ref.getValue()); 205 206 if (domain->isEmpty()) return; 203 207 204 208 StdString timeid = StdString("time_counter"); … … 263 267 SuperClassWriter::addAttribute 264 268 ("units", field->unit.getValue(), &fieldid); 265 266 if (!field->operation.isEmpty()) 267 SuperClassWriter::addAttribute 269 270 SuperClassWriter::addAttribute 268 271 ("online_operation", field->operation.getValue(), &fieldid); 269 270 { 272 273 if (wtime) 274 { 275 SuperClassWriter::addAttribute 276 ("interval_operation", field->freq_op.getValue(), &fieldid); 277 SuperClassWriter::addAttribute 278 ("interval_write", field->getRelFile()->output_freq.getValue(), &fieldid); 279 } 280 281 { // Ecriture des coordonnées 282 271 283 StdString coordstr; //boost::algorithm::join(coodinates, " ") 272 284 std::vector<StdString>::iterator -
XMLIO_V2/dev/dev_rv/xmlioserver.geany
r170 r187 19 19 20 20 [files] 21 current_page=2 22 FILE_NAME_0=0;Make;0;16;1;1;0;/work/dev_rv/Makefile.wk;0;3 23 FILE_NAME_1=0;C++;0;16;0;1;0;/work/dev_rv/src/xmlio/main_server.cpp;0;3 24 FILE_NAME_2=0;C++;0;16;0;1;0;/work/dev_rv/src/xmlio/xml_node.cpp;0;3 21 current_page=9 22 FILE_NAME_0=840;Make;0;16;1;1;0;/work/dev_rv/Makefile.wk;0;3 23 FILE_NAME_1=138;C++;0;16;0;1;0;/work/dev_rv/src/xmlio/main_server.cpp;0;3 24 FILE_NAME_2=13467;C++;0;16;0;1;0;/work/dev_rv/src/xmlio/node/grid.cpp;0;3 25 FILE_NAME_3=2395;C++;0;16;0;1;0;/work/dev_rv/src/xmlio/node/domain.hpp;0;3 26 FILE_NAME_4=3378;C++;0;16;0;1;0;/work/dev_rv/src/xmlio/node/grid.hpp;0;3 27 FILE_NAME_5=1286;Conf;0;16;0;1;0;/work/dev_rv/src/xmlio/config/domain_attribute.conf;0;3 28 FILE_NAME_6=160;C++;0;16;0;1;0;/work/dev_rv/src/xmlio/output/onetcdf4.hpp;0;3 29 FILE_NAME_7=2909;C++;0;16;0;1;0;/work/dev_rv/src/xmlio/output/nc4_data_output.cpp;0;3 30 FILE_NAME_8=356;C++;0;16;0;1;0;/work/dev_rv/src/xmlio/array_mac.hpp;0;3 31 FILE_NAME_9=4101;Fortran;0;16;0;1;0;/work/dev_rv/src/xmlio/fortran/impi_interface.f90;0;3 32 FILE_NAME_10=6236;C++;0;16;0;1;0;/work/dev_rv/src/xmlio/manager/mpi_manager.cpp;0;3 33 FILE_NAME_11=189;C++;0;16;0;1;0;/work/dev_rv/src/xmlio/fortran/impi_interface.hpp;0;3 25 34 26 35 [build-menu]
Note: See TracChangeset
for help on using the changeset viewer.