Changeset 286 for XMLIO_V2/dev/common/src/xmlio/node/grid.cpp
- Timestamp:
- 10/21/11 19:01:35 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.