- Timestamp:
- 11/23/21 13:12:46 (3 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/config/scalar_attribute.conf
r2207 r2264 9 9 /* LOCAL and GLOBAL*/ 10 10 DECLARE_ATTRIBUTE(bool, mask, false) 11 DECLARE_ATTRIBUTE(double, value) 11 DECLARE_ATTRIBUTE(double, value, false) 12 DECLARE_ATTRIBUTE(int, n, false) 12 13 DECLARE_ATTRIBUTE(StdString, bounds_name) 13 14 DECLARE_ARRAY(double, 1 , bounds) -
XIOS/dev/dev_ym/XIOS_COUPLING/src/io/nc4_data_output.cpp
r1962 r2264 2282 2282 std::vector<StdString> domainList = grid->getDomainList(); 2283 2283 std::vector<StdString> axisList = grid->getAxisList(); 2284 std::vector<StdString> scalarList = grid->getScalarList() ; 2284 2285 int numElement = axisDomainOrder.numElements(); 2285 2286 int idxDomain = domainList.size() - 1, idxAxis = axisList.size() - 1; … … 2318 2319 if (1 == axisDomainOrder.numElements()) 2319 2320 { 2321 CScalar* scalar = CScalar::get(scalarList[scalarList.size()-1]); 2320 2322 start.push_back(0); 2321 count.push_back( 1);2323 count.push_back(scalar->n); 2322 2324 } 2323 2325 --idx; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/io/onetcdf4.cpp
r1957 r2264 477 477 if (sizes.size()==0) 478 478 { 479 array_size=1 ; 480 sstart.push_back(0); 481 scount.push_back(1); 479 480 if ((start != NULL) && (count != NULL) && start->size()==1 && count->size()==1) // pur scalar case 481 array_size*=(*count)[0] ; 482 else array_size=1 ; 482 483 } 483 484 else … … 492 493 sstart.push_back(record); 493 494 scount.push_back(1); 494 if ((start == NULL) && 495 (count == NULL)) i++; 496 it++; 495 if ((start == NULL) && (count == NULL)) i++; 496 it++; 497 if (it==end) 498 { 499 if ((start != NULL) && (count != NULL) && start->size()==1 && count->size()==1) // pur scalar case 500 { 501 scount[0]=(*count)[0] ; 502 array_size *= (*count)[0]; 503 } 504 } 497 505 } 498 506 499 507 for (;it != end; it++) 500 508 { … … 569 577 int grpid = this->getCurrentGroup(); 570 578 int varid = this->getVariable(name); 579 571 580 StdSize array_size = 1; 572 581 std::vector<StdSize> sstart, scount; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/io/onetcdf4_impl.hpp
r1755 r2264 19 19 std::vector<StdSize> sstart, scount; 20 20 21 if (this->wmpi && collective) 22 CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 23 if (this->wmpi && !collective) 24 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 21 if (this->wmpi && collective) CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 22 if (this->wmpi && !collective) CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 25 23 26 24 CTimer::get("Files : get data infos").resume(); 27 this->getWriteDataInfos 28 (name, record, array_size, sstart, scount, start, count); 25 this->getWriteDataInfos(name, record, array_size, sstart, scount, start, count); 29 26 CTimer::get("Files : get data infos").suspend(); 30 27 31 28 if (data.numElements() != array_size) 32 29 { … … 36 33 << " ] Invalid input data !" ); 37 34 } 38 39 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 35 36 if (this->wmpi && sstart.size()==0) CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); // pure scalar case 37 if (data.numElements()==0 && sstart.size()==0) {}// pure scalar case if nothing to write, write nothing (independent access) 38 else this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 40 39 } 41 40 -
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.