Changeset 286 for XMLIO_V2/dev/common/src/xmlio/node
- Timestamp:
- 10/21/11 19:01:35 (13 years ago)
- Location:
- XMLIO_V2/dev/common/src/xmlio/node
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/common/src/xmlio/node/context.cpp
r278 r286 143 143 #define DECLARE_NODE_PAR(Name_, name_) 144 144 #include "node_type.conf" 145 std::cout << name << std::endl; 145 146 146 DEBUG(<< "L'élément nommé \'" << name 147 147 << "\' dans le contexte \'" << CObjectFactory::GetCurrentContextId() -
XMLIO_V2/dev/common/src/xmlio/node/domain.cpp
r278 r286 517 517 const int zoom_ibegin_cl = ibegin_zoom_sub[k], zoom_ni_cl = ni_zoom_sub[k], 518 518 zoom_jbegin_cl = jbegin_zoom_sub[k], zoom_nj_cl = nj_zoom_sub[k], 519 ibegin_cl = ibegin_sub[k] , 520 jbegin_cl = jbegin_sub[k] , 519 521 ni_cl = iend_sub[k] - ibegin_sub[k] + 1; 520 522 … … 523 525 for (int j = 0; j < zoom_nj_cl; j++) 524 526 { 525 int ii = i /*- (ibegin_serv - 1)*/+ (zoom_ibegin_cl - 1) - (ibegin_zoom_srv - 1);526 int jj = j /*- (jbegin_serv - 1)*/+ (zoom_jbegin_cl - 1) - (jbegin_zoom_srv - 1);527 int ii = i + (ibegin_cl-1) - (ibegin_serv - 1) + (zoom_ibegin_cl - 1) - (ibegin_zoom_srv - 1); 528 int jj = j + (jbegin_cl-1) - (jbegin_serv - 1) + (zoom_jbegin_cl - 1) - (jbegin_zoom_srv - 1); 527 529 (*lonvalue_temp)[ii + jj * zoom_ni_serv] = 528 530 (*lonvalue_loc)[i + j * zoom_ni_cl]; … … 602 604 { 603 605 zoom_ni_loc.setValue(0); 604 zoom_ibegin_loc.setValue( -1);606 zoom_ibegin_loc.setValue(zoom_ibegin.getValue()); 605 607 } 606 608 else … … 622 624 { 623 625 zoom_nj_loc.setValue(0); 624 zoom_jbegin_loc.setValue( -1);626 zoom_jbegin_loc.setValue(zoom_jbegin.getValue()); 625 627 } 626 628 else … … 662 664 this->iend_sub.push_back(this->iend.getValue()); 663 665 this->jend_sub.push_back(this->jend.getValue()); 666 667 this->ibegin_zoom_sub.push_back(this->zoom_ibegin_loc.getValue()); 668 this->jbegin_zoom_sub.push_back(this->zoom_jbegin_loc.getValue()); 669 this->ni_zoom_sub.push_back(this->zoom_ni_loc.getValue()); 670 this->nj_zoom_sub.push_back(this->zoom_nj_loc.getValue()); 664 671 665 672 this->latvalue_sub.push_back(this->latvalue.getValue()); 666 673 this->lonvalue_sub.push_back(this->lonvalue.getValue()); 667 668 if (!this->isEmpty()) 669 { 674 675 676 // if (!this->isEmpty()) 677 // { 670 678 this->completeLonLatClient(); 671 }679 // } 672 680 } 673 681 else 674 682 { // CÃŽté serveur uniquement 675 if (!this->isEmpty())683 // if (!this->isEmpty()) 676 684 this->completeLonLatServer(); 677 685 } … … 707 715 { 708 716 return (this->ibegin_zoom_sub); 717 } 718 719 const std::vector<int> & CDomain::getNiZoomSub(void) const 720 { 721 return (this->ni_zoom_sub); 709 722 } 710 723 … … 729 742 return (this->jbegin_zoom_sub); 730 743 } 744 745 const std::vector<int> & CDomain::getNjZoomSub(void) const 746 { 747 return (this->nj_zoom_sub); 748 } 731 749 732 750 … … 735 753 const std::vector<int> & CDomain::getJEndSub(void) const 736 754 { 737 return (this-> iend_sub);755 return (this->jend_sub); 738 756 } 739 757 -
XMLIO_V2/dev/common/src/xmlio/node/domain.hpp
r278 r286 80 80 const std::vector<int> & getIBeginZoomSub(void) const; 81 81 const std::vector<int> & getJBeginZoomSub(void) const; 82 const std::vector<int> & getNiZoomSub(void) const; 83 const std::vector<int> & getNjZoomSub(void) const; 82 84 83 85 const std::vector<ARRAY(double, 1)> & getLonValueSub(void) const; -
XMLIO_V2/dev/common/src/xmlio/node/field.cpp
r278 r286 220 220 sset.insert(refer_ptr); 221 221 baseRefObject = refer_sptr; 222 refObject.push_back(refer_sptr);222 //ym refObject.push_back(refer_sptr); 223 223 } 224 224 } -
XMLIO_V2/dev/common/src/xmlio/node/field.hpp
r278 r286 166 166 // std::cout << "(writeDate <= currDate) = " << std::boolalpha << (writeDate <= currDate) << std::endl; 167 167 168 //std::cout << ">> " << currDate << " : Envoi de données " << this->getBaseFieldId() << std::endl; 168 std::cout << ">> " << currDate << " : Envoi de données " << this->getBaseFieldId() << std::endl; 169 std::cout << ">> next operation " << opeDate<<std::endl; 169 170 if (opeDate <= currDate) 170 171 { … … 180 181 181 182 *last_operation = currDate; 182 //std::cout << "(*last_operation = currDate) : " << *last_operation << " = " << currDate << std::endl;183 std::cout << "(*last_operation = currDate) : " << *last_operation << " = " << currDate << std::endl; 183 184 } 184 185 … … 188 189 this->incrementNStep(); 189 190 *last_Write = writeDate; 190 //std::cout << "(*last_Write = currDate) : " << *last_Write << " = " << currDate << std::endl;191 std::cout << "(*last_Write = currDate) : " << *last_Write << " = " << currDate << std::endl; 191 192 return (true); 192 193 } -
XMLIO_V2/dev/common/src/xmlio/node/file.cpp
r266 r286 62 62 this->enabledFields = this->getAllFields(); 63 63 64 std::cout<<"---> File :"<<this->name.getValue()<<std::endl ; 64 65 for ( it = this->enabledFields.begin() ; it != this->enabledFields.end(); it++ ) 65 66 { … … 86 87 } 87 88 88 // Le champ est finalement actif, on ajoute la référence au champ de base. 89 // Le champ est finalement actif, on y ajoute sa propre reference. 90 (*it)->refObject.push_back(*it); 91 // Le champ est finalement actif, on y ajoute la référence au champ de base. 92 std::cout<<" Field Enabled : "<<(*it)->getId()<<std::endl ; 89 93 (*it)->setRelFile(CObjectFactory::GetObject(this)); 90 94 (*it)->baseRefObject->refObject.push_back(*it); 95 // A faire, ajouter les references intermediaires... 91 96 } 92 97 … … 133 138 } 134 139 140 void CFile::close(void) 141 { 142 this->data_out->closeFile(); 143 } 135 144 //---------------------------------------------------------------- 136 145 -
XMLIO_V2/dev/common/src/xmlio/node/file.hpp
r219 r286 63 63 64 64 void initializeDataOutput(boost::shared_ptr<io::CDataOutput> dout); 65 65 void close(void) ; 66 66 67 /// Traitements /// 67 68 virtual void solveDescInheritance(const CAttributeMap * const parent = 0); -
XMLIO_V2/dev/common/src/xmlio/node/grid.cpp
r278 r286 5 5 #include "object_template_impl.hpp" 6 6 #include "group_template_impl.hpp" 7 #include <iostream> 8 #include "mpi_manager.hpp" 7 9 8 10 namespace xmlioserver { … … 140 142 for (StdSize s = 0; s < shape_.size(); s++) 141 143 retvalue *= shape_[s]; 144 return (retvalue); 145 } 146 147 StdSize CGrid::getDataSize(void) const 148 { 149 StdSize retvalue ; 150 retvalue=domain->data_ni.getValue() ; 151 if (domain->data_dim.getValue()==2) retvalue*=domain->data_nj.getValue() ; 152 if (this->withAxis) retvalue*=this->axis->size.getValue() ; 153 142 154 return (retvalue); 143 155 } … … 437 449 const std::vector<int> & ibegin = this->domain->getIBeginSub(); 438 450 const std::vector<int> & jbegin = this->domain->getJBeginSub(); 451 const std::vector<int> & iend = this->domain->getIEndSub(); 452 const std::vector<int> & jend = this->domain->getJEndSub(); 439 453 const std::vector<int> & ibegin_zoom = this->domain->getIBeginZoomSub(); 440 454 const std::vector<int> & jbegin_zoom = this->domain->getJBeginZoomSub(); 455 const std::vector<int> & ni_zoom = this->domain->getNiZoomSub(); 456 const std::vector<int> & nj_zoom = this->domain->getNjZoomSub(); 441 457 442 458 const int ibegin_srv = this->domain->ibegin.getValue(); 443 459 const int jbegin_srv = this->domain->jbegin.getValue(); 460 const int iend_srv = this->domain->iend.getValue(); 461 const int jend_srv = this->domain->jend.getValue(); 444 462 const int zoom_ni_srv = this->domain->zoom_ni_loc.getValue(); 445 463 const int zoom_nj_srv = this->domain->zoom_nj_loc.getValue(); … … 447 465 const int ibegin_zoom_srv = this->domain->zoom_ibegin_loc.getValue(); 448 466 const int jbegin_zoom_srv = this->domain->zoom_jbegin_loc.getValue(); 449 467 const int iend_zoom_srv = ibegin_zoom_srv + zoom_ni_srv-1 ; 468 const int jend_zoom_srv = jbegin_zoom_srv + zoom_nj_srv-1 ; 469 470 // std::cout<<"----> computeIndexServer !!"<<std::endl ; 450 471 StdSize dn = 0; 451 472 for (StdSize j = 1; j < this->out_i_index.size(); j++) … … 466 487 int ibegin_zoom_cl = ibegin[i]; //ibegin_zoom[i]; 467 488 int jbegin_zoom_cl = jbegin[i]; //jbegin_zoom[i]; 489 int iend_zoom_cl = iend[i]; //ibegin_zoom[i]; 490 int jend_zoom_cl = jend[i]; //jbegin_zoom[i]; 491 492 int ibegin_cl = ibegin[i]; //ibegin[i]; 493 int jbegin_cl = jbegin[i]; //jbegin[i]; 494 int iend_cl = iend[i]; //ibegin[i]; 495 int jend_cl = jend[i]; //jbegin[i]; 468 496 469 497 if (ibegin_zoom.size() != 0) … … 471 499 ibegin_zoom_cl = ibegin_zoom[i]; 472 500 jbegin_zoom_cl = jbegin_zoom[i]; 501 iend_zoom_cl = ibegin_zoom[i]+ni_zoom[i]-1; 502 jend_zoom_cl = jbegin_zoom[i]+nj_zoom[i]-1; 473 503 } 474 504 475 for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++) 476 { 477 (*storeIndex_srv)[n] = (*storeIndex_cl)[m]; // Faux mais inutile dans le cas serveur. 505 // std::cout<<"--> client No "<<i<<std::endl ; 506 // std::cout<<" ibegin "<<ibegin[i]<<" iend "<<iend[i]<<" jbegin "<<jbegin[i]<<" jend "<<jend[i]<<std::endl ; 507 // std::cout<<"zoom cl : ibegin "<<ibegin_zoom_cl<<" iend "<<iend_zoom_cl<<" jbegin "<<jbegin_zoom_cl<<" jend "<<jend_zoom_cl<<std::endl ; 508 // std::cout<<"--> server "<<std::endl ; 509 // std::cout<<" ibegin "<<ibegin_srv<<" iend "<<iend_srv<<" jbegin "<<jbegin_srv<<" jend "<<jend_srv<<std::endl ; 510 // std::cout<<"zoom : ibegin "<<ibegin_zoom_srv<<" iend "<<iend_zoom_srv<< " ni "<<zoom_ni_srv<<" jbegin "<<jbegin_zoom_srv<<" jend "<<jend_zoom_srv<<" nj "<<zoom_nj_srv<<std::endl ; 511 // std::cout<<"zoom_size "<<ibegin_zoom.size()<<std::endl ; 512 513 if (comm::CMPIManager::IsClient()) 514 { 515 for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++) 516 { 517 (*storeIndex_srv)[n] = (*storeIndex_cl)[m]; // Faux mais inutile dans le cas serveur. 518 519 // (*out_i_index_srv)[n] = (*out_i_index_cl)[m] 520 // /*+ (ibegin_cl - 1) - (ibegin_srv - 1)*/ + (ibegin_zoom_cl - 1) - (ibegin_zoom_srv - 1); 521 // (*out_j_index_srv)[n] = (*out_j_index_cl)[m] 522 // /*+ (jbegin_cl - 1) - (jbegin_srv - 1)*/ + (jbegin_zoom_cl - 1) - (jbegin_zoom_srv - 1); 523 // (*out_l_index_srv)[n] = (*out_l_index_cl)[m]; 524 (*out_i_index_srv)[n] = (*out_i_index_cl)[m] + ibegin_cl - 1 - (ibegin_srv + ibegin_zoom_srv - 1) + 1 ; 525 (*out_j_index_srv)[n] = (*out_j_index_cl)[m] + jbegin_cl - 1 - (jbegin_srv + jbegin_zoom_srv - 1) + 1 ; 526 (*out_l_index_srv)[n] = (*out_l_index_cl)[m]; 527 } 528 } 529 else 530 { 531 for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++) 532 { 533 (*storeIndex_srv)[n] = (*storeIndex_cl)[m]; // Faux mais inutile dans le cas serveur. 478 534 (*out_i_index_srv)[n] = (*out_i_index_cl)[m] 479 /*+ (ibegin_cl - 1) - (ibegin_srv - 1)*/+ (ibegin_zoom_cl - 1) - (ibegin_zoom_srv - 1);535 + (ibegin_cl - 1) - (ibegin_srv - 1) + (ibegin_zoom_cl - 1) - (ibegin_zoom_srv - 1); 480 536 (*out_j_index_srv)[n] = (*out_j_index_cl)[m] 481 /*+ (jbegin_cl - 1) - (jbegin_srv - 1)*/+ (jbegin_zoom_cl - 1) - (jbegin_zoom_srv - 1);537 + (jbegin_cl - 1) - (jbegin_srv - 1) + (jbegin_zoom_cl - 1) - (jbegin_zoom_srv - 1); 482 538 (*out_l_index_srv)[n] = (*out_l_index_cl)[m]; 539 } 540 483 541 } 484 542 485 dn += storeIndex_cl->size(); 486 } 487 543 dn += storeIndex_cl->size(); 544 // std::cout<<"storeIndex_cl->size() "<<storeIndex_cl->size()<<std::endl; 545 546 // std::cout<<"storeIndex_srv->size() "<<storeIndex_srv->size()<<std::endl; 547 } 548 488 549 if (storeIndex_srv->size() != 0) 489 550 { … … 496 557 const int jend_t = 497 558 *std::max_element(out_j_index_srv->begin(), out_j_index_srv->end()); 498 559 560 // std::cout<< "[ grille = " << this->getId() 561 // << ", ibegin_t = " << ibegin_t 562 // << ", jbegin_t = " << jbegin_t 563 // << ", iend_t = " << iend_t 564 // << ", jend_t = " << jend_t 565 // << ", zoom_ni_srv = " << zoom_ni_srv 566 // << ", zoom_nj_srv = " << zoom_nj_srv 567 // << ", nb subdomain = " << out_i_index.size()-1<<std::endl ; 568 499 569 if ((ibegin_t < 0) || (jbegin_t < 0) || 500 570 (iend_t >= zoom_ni_srv) || (jend_t >= zoom_nj_srv)) … … 508 578 << ", zoom_ni_srv = " << zoom_ni_srv 509 579 << ", zoom_nj_srv = " << zoom_nj_srv 580 << ", nb subdomain = " << out_i_index.size()-1 510 581 <<" ] Erreur d'indexation de la grille au niveau du serveur") ; 511 582 } -
XMLIO_V2/dev/common/src/xmlio/node/grid.hpp
r266 r286 71 71 StdSize getLocalSize(void) const; 72 72 StdSize getGlobalSize(void) const; 73 StdSize getDataSize(void) const; 73 74 std::vector<StdSize> getLocalShape(void) const; 74 75 std::vector<StdSize> getGlobalShape(void) const; … … 133 134 void CGrid::inputField(const ARRAY(double, n) field, ARRAY(double, 1) stored) const 134 135 { 135 if (this->get GlobalSize() != field->num_elements())136 if (this->getDataSize() != field->num_elements()) 136 137 ERROR("CGrid::inputField(const ARRAY(double, n) field, ARRAY(double, 1) stored)", 137 << "[ Taille des données attendue = " << this->get GlobalSize() << ", "138 << "[ Taille des données attendue = " << this->getDataSize() << ", " 138 139 << "Taille des données reçue = " << field->num_elements() << " ] " 139 140 << "Le tableau de données n'a pas la bonne taille !") ; -
XMLIO_V2/dev/common/src/xmlio/node/variable.hpp
r274 r286 64 64 65 65 66 template <typename T> inline void getData(T & _data) const; 66 template <typename T> inline T getData(void) const; 67 // bool inline getData<bool>(void) const ; 68 67 69 template <typename T, StdSize N> 68 70 inline void getData(ARRAY(T, N) _data_array) const; … … 81 83 }; // class CVar 82 84 85 86 template <typename T> 87 T CVariable::getData(void) const 88 { 89 T retval ; 90 std::stringstream sstr(std::stringstream::in | std::stringstream::out); 91 sstr<<content ; 92 sstr>>retval ; 93 if (sstr.fail()) ERROR("CVariable::getdata()", 94 << "Cannot convert string <" << content << "> into type required" ); 95 return retval ; 96 } 97 98 template<> 99 bool CVariable::getData<bool>(void) const 100 { 101 if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ; 102 else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ; 103 else ERROR("CVariable::getdata()", 104 << "Cannot convert string <" << content << "> into type required" ); 105 return false ; 106 } 83 107 ///-------------------------------------------------------------- 84 108
Note: See TracChangeset
for help on using the changeset viewer.