Changeset 2264 for XIOS/dev/dev_ym/XIOS_COUPLING/src/node
- Timestamp:
- 11/23/21 13:12:46 (3 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src/node
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
r2230 r2264 100 100 { 101 101 case EVENT_ID_UPDATE_DATA : 102 // return true; // temporary 102 103 recvUpdateData(event); 103 104 return true; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp
r2236 r2264 1427 1427 else if (element.type==TYPE_SCALAR) posDistributed++ ; 1428 1428 } 1429 if (posDistributed==elements.size()) posDistributed=0 ; // grid composed only of scalar 1429 1430 1430 1431 vector<CLocalView*> localViews ; … … 1453 1454 { 1454 1455 CScalar* scalar = (CScalar*) elements[i].ptr ; 1455 scalar->computeRemoteElement(client, posDistributed==i ? EDistributionType:: BANDS: EDistributionType::NONE) ;1456 scalar->computeRemoteElement(client, posDistributed==i ? EDistributionType::ROOT : EDistributionType::NONE) ; 1456 1457 remoteViews.push_back(scalar->getRemoteElement(client)->getView(CElementView::FULL)) ; 1457 1458 localViews.push_back(scalar->getLocalView(CElementView::FULL)) ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp
r2206 r2264 112 112 if (checkAttributes_done_) return ; 113 113 checkAttributes_done_ = true ; 114 114 115 if (n.isEmpty()) n=1 ; 115 116 if (mask.isEmpty()) mask=true ; 116 117 … … 342 343 int rank = CContext::getCurrent()->getIntraCommRank() ; 343 344 344 CArray<size_t,1> ind(1) ; 345 ind(0)=0 ; 346 localElement_ = new CLocalElement(rank, 1, ind) ; 345 346 CArray<size_t,1> index(n) ; 347 if (n==1) index(0)=0 ; 348 localElement_ = new CLocalElement(rank, 1, index) ; 347 349 } 348 350 349 351 void CScalar::addFullView(void) 350 352 { 351 CArray<int,1> index( 1) ;352 for(int i=0; i<1 ; i++) index(0)=0 ;353 CArray<int,1> index(n) ; 354 if (n==1) index(0)=0 ; 353 355 localElement_ -> addView(CElementView::FULL, index) ; 354 356 } … … 357 359 { 358 360 CArray<int,1> index ; 359 if (mask )361 if (mask && n==1) 360 362 { 361 363 index.resize(1) ; … … 386 388 CContext* context = CContext::getCurrent(); 387 389 map<int, CArray<size_t,1>> globalIndex ; 388 389 int nbServer = client->serverSize;390 390 size_t nglo=1 ; 391 CArray<size_t,1> indGlo(nglo) ; 392 for(size_t i=0;i<nglo;i++) indGlo(i) = i ; 393 for (auto& rankServer : client->getRanksServerLeader()) globalIndex[rankServer].reference(indGlo.copy()) ; 394 391 392 if (type==EDistributionType::ROOT) // Bands distribution to send to file server 393 { 394 for (auto& rankServer : client->getRanksServerLeader()) 395 { 396 auto& globalInd = globalIndex[rankServer] ; 397 if (rankServer==0) 398 { 399 globalInd.resize(1) ; 400 globalInd(0)=0 ; 401 } 402 } 403 } 404 else if (type==EDistributionType::NONE) // domain is not distributed ie all servers get the same local domain 405 { 406 int nbServer = client->serverSize; 407 CArray<size_t,1> indGlo(nglo) ; 408 for(size_t i=0;i<nglo;i++) indGlo(i) = i ; 409 for (auto& rankServer : client->getRanksServerLeader()) globalIndex[rankServer].reference(indGlo.copy()) ; 410 } 395 411 remoteElement_[client] = new CDistributedElement(nglo, globalIndex) ; 396 412 remoteElement_[client]->addFullView() ; … … 477 493 // construct the local dimension and indexes 478 494 auto& globalIndex=localElement_->getGlobalIndex() ; 479 int nk=globalIndex.numElements() ;495 n=globalIndex.numElements() ; 480 496 // no distribution for scalar => nk ==1 or maybe 0 ? 481 497 } … … 504 520 CContext* context = CContext::getCurrent(); 505 521 localElement_->addView(CElementView::WORKFLOW, serverMask) ; 506 mask = serverMask(0) ;522 if (serverMask.numElements()==1) mask = serverMask(0) ; 507 523 508 524 serverFromClientConnector_ = new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW)) ;
Note: See TracChangeset
for help on using the changeset viewer.