- Timestamp:
- 04/01/15 17:53:02 (9 years ago)
- Location:
- XIOS/trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/inputs/COMPLETE/context_atmosphere.xml
r584 r586 17 17 18 18 <axis_definition> 19 <axis id="axis_atm" zoom_size="2" zoom_end=" 3" />19 <axis id="axis_atm" zoom_size="2" zoom_end="2" /> 20 20 </axis_definition> 21 21 -
XIOS/trunk/inputs/Version2/iodef.xml
r569 r586 6 6 7 7 8 <field_definition level="1" enabled=". TRUE.">8 <field_definition level="1" enabled=".FALSE."> 9 9 <field id="field_AA" operation="average" freq_op="3600s" domain_ref="domain_A" axis_ref="axis_A" /> 10 10 <field id="field_A" operation="average" freq_op="3600s" grid_ref="grid_A" /> 11 11 <field id="field_Axis" operation="average" freq_op="3600s" grid_ref="grid_Axis" /> 12 12 <field id="field_All_Axis" operation="average" freq_op="3600s" grid_ref="grid_All_Axis" /> 13 <field id="field_Scalar" operation="average" freq_op="3600s" grid_ref="ScalarGrid" /> 13 14 </field_definition> 14 15 … … 16 17 <file_definition type="multiple_file" par_access="collective" output_freq="6h" output_level="10" enabled=".TRUE."> 17 18 <file id="output" name="output"> 18 <field field_ref="field_A" />19 <!-- <field field_ref="field_A" />--> 19 20 </file> 20 <file id="output_Axis" name="output_Axis"> 21 <!-- <field field_ref="field_Axis" />--> 22 <field field_ref="field_All_Axis" /> 21 <file id="output_Axis" name="output_Axis" type="one_file"> 22 <field field_ref="field_Axis" /> 23 </file> 24 <file id="output_All_Axis" name="output_All_Axis" type="one_file"> 25 <!-- <field field_ref="field_All_Axis" />--> 26 </file> 27 <file id="output_Scalar" name="output_Scalar" type="one_file"> 28 <!-- <field field_ref="field_Scalar" />--> 23 29 </file> 24 30 </file_definition> … … 50 56 <axis axis_ref="axis_C" /> 51 57 </grid> 58 <grid id="ScalarGrid"> 59 </grid> 52 60 </grid_group> 53 61 </grid_definition> … … 68 76 <variable_group id="buffer"> 69 77 <variable id="optimal_buffer_size" type="string">performance</variable> 70 <variable id="buffer_factor_size" type="double">1 0.0</variable>78 <variable id="buffer_factor_size" type="double">1.0</variable> 71 79 </variable_group> 72 80 -
XIOS/trunk/src/interface/c/icdata.cpp
r576 r586 365 365 // ---------------------- Ecriture des données ------------------------------ 366 366 367 void cxios_write_data_k8 1(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize)367 void cxios_write_data_k80(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize) 368 368 { 369 369 std::string fieldid_str; … … 380 380 } 381 381 382 void cxios_write_data_k82(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize) 383 { 384 std::string fieldid_str; 385 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 386 387 CTimer::get("XIOS").resume() ; 388 CTimer::get("XIOS send field").resume() ; 389 CContext* context = CContext::getCurrent() ; 390 if (!context->hasServer) context->client->checkBuffers() ; 391 392 CArray<double,2>data(data_k8,shape(data_Xsize,data_Ysize),neverDeleteData) ; 393 CField::get(fieldid_str)->setData(data) ; 394 CTimer::get("XIOS send field").suspend() ; 395 CTimer::get("XIOS").suspend() ; 396 } 397 398 void cxios_write_data_k83(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize, int data_Zsize) 399 { 400 std::string fieldid_str; 401 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 402 403 CTimer::get("XIOS").resume() ; 404 CTimer::get("XIOS send field").resume() ; 405 CContext* context = CContext::getCurrent() ; 406 if (!context->hasServer) context->client->checkBuffers() ; 407 408 CArray<double,3>data(data_k8,shape(data_Xsize,data_Ysize,data_Zsize),neverDeleteData) ; 409 CField::get(fieldid_str)->setData(data) ; 410 CTimer::get("XIOS send field").suspend() ; 411 CTimer::get("XIOS").suspend() ; 412 } 413 414 void cxios_write_data_k41(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize) 382 void cxios_write_data_k40(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize) 415 383 { 416 384 std::string fieldid_str; … … 430 398 } 431 399 400 void cxios_write_data_k81(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize) 401 { 402 std::string fieldid_str; 403 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 404 405 CTimer::get("XIOS").resume() ; 406 CTimer::get("XIOS send field").resume() ; 407 CContext* context = CContext::getCurrent() ; 408 if (!context->hasServer) context->client->checkBuffers() ; 409 CArray<double,(StdSize)1> data(data_k8,shape(data_Xsize),neverDeleteData) ; 410 CField::get(fieldid_str)->setData(data) ; 411 CTimer::get("XIOS send field").suspend() ; 412 CTimer::get("XIOS").suspend() ; 413 } 414 415 void cxios_write_data_k82(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize) 416 { 417 std::string fieldid_str; 418 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 419 420 CTimer::get("XIOS").resume() ; 421 CTimer::get("XIOS send field").resume() ; 422 CContext* context = CContext::getCurrent() ; 423 if (!context->hasServer) context->client->checkBuffers() ; 424 425 CArray<double,2>data(data_k8,shape(data_Xsize,data_Ysize),neverDeleteData) ; 426 CField::get(fieldid_str)->setData(data) ; 427 CTimer::get("XIOS send field").suspend() ; 428 CTimer::get("XIOS").suspend() ; 429 } 430 431 void cxios_write_data_k83(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize, int data_Zsize) 432 { 433 std::string fieldid_str; 434 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 435 436 CTimer::get("XIOS").resume() ; 437 CTimer::get("XIOS send field").resume() ; 438 CContext* context = CContext::getCurrent() ; 439 if (!context->hasServer) context->client->checkBuffers() ; 440 441 CArray<double,3>data(data_k8,shape(data_Xsize,data_Ysize,data_Zsize),neverDeleteData) ; 442 CField::get(fieldid_str)->setData(data) ; 443 CTimer::get("XIOS send field").suspend() ; 444 CTimer::get("XIOS").suspend() ; 445 } 446 447 void cxios_write_data_k41(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize) 448 { 449 std::string fieldid_str; 450 if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 451 452 CTimer::get("XIOS").resume() ; 453 CTimer::get("XIOS send field").resume() ; 454 CContext* context = CContext::getCurrent() ; 455 if (!context->hasServer) context->client->checkBuffers() ; 456 457 CArray<float,1> data_tmp(data_k4,shape(data_Xsize),neverDeleteData) ; 458 CArray<double,1> data(data_Xsize) ; 459 data=data_tmp ; 460 CField::get(fieldid_str)->setData(data) ; 461 CTimer::get("XIOS send field").suspend() ; 462 CTimer::get("XIOS").suspend() ; 463 } 464 432 465 void cxios_write_data_k42(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize, int data_Ysize) 433 466 { -
XIOS/trunk/src/interface/fortran/idata.F90
r501 r586 48 48 SUBROUTINE cxios_solve_inheritance() BIND(C) 49 49 END SUBROUTINE cxios_solve_inheritance 50 51 SUBROUTINE cxios_write_data_k80(fieldid, fieldid_size, data_k8, data_Xsize) BIND(C) 52 USE ISO_C_BINDING 53 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid 54 REAL (kind = C_DOUBLE) :: data_k8 55 INTEGER (kind = C_INT) , VALUE :: fieldid_size 56 INTEGER (kind = C_INT) , VALUE :: data_Xsize 57 END SUBROUTINE cxios_write_data_k80 58 59 SUBROUTINE cxios_write_data_k40(fieldid, fieldid_size, data_k4, data_Xsize) BIND(C) 60 USE ISO_C_BINDING 61 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: fieldid 62 REAL (kind = C_FLOAT) :: data_k4 63 INTEGER (kind = C_INT) , VALUE :: fieldid_size 64 INTEGER (kind = C_INT) , VALUE :: data_Xsize 65 END SUBROUTINE cxios_write_data_k40 50 66 51 67 … … 261 277 262 278 279 SUBROUTINE xios(send_field_r8)(fieldid, data_k8) 280 IMPLICIT NONE 281 CHARACTER(len = *) , INTENT(IN) :: fieldid 282 REAL (kind = 8), INTENT(IN) :: data_k8 283 CALL cxios_write_data_k80(fieldid, len(fieldid), data_k8, 1) 284 END SUBROUTINE xios(send_field_r8) 285 286 SUBROUTINE xios(send_field_r4)(fieldid, data_k4) 287 IMPLICIT NONE 288 CHARACTER(len = *) , INTENT(IN) :: fieldid 289 REAL (kind = 4), INTENT(IN) :: data_k4 290 CALL cxios_write_data_k40(fieldid, len(fieldid), data_k4, 1) 291 END SUBROUTINE xios(send_field_r4) 292 293 294 263 295 SUBROUTINE xios(send_field_r8_1d)(fieldid, data1d_k8) 264 296 IMPLICIT NONE -
XIOS/trunk/src/interface/fortran/ixios.F90
- Property svn:executable set to *
r576 r586 11 11 12 12 USE icontext_attr, ONLY : xios(set_context_attr), xios(get_context_attr), xios(is_defined_context_attr) 13 xios(setVar_logic), xios(setVar_char), xios(send_field_r8), xios(send_field_r4) 13 14 14 15 USE idata, ONLY : xios(initialize), xios(init_server), xios(finalize), xios(context_initialize), xios(context_is_initialized), & … … 38 39 39 40 USE ifield, ONLY : txios(field), txios(fieldgroup), xios(is_valid_field), xios(is_valid_fieldgroup) 41 xios(send_field_r4_1d), xios(send_field_r4_2d), xios(send_field_r4_3d), & 42 xios(send_field_r8), xios(send_field_r4) 40 43 41 44 USE ifield_attr, ONLY : xios(set_field_attr), xios(get_field_attr), xios(is_defined_field_attr) -
XIOS/trunk/src/node/axis.cpp
r570 r586 280 280 zoom_begin_srv=0 ; zoom_end_srv=0 ; zoom_size_srv=0 ; 281 281 } 282 283 if (size == ni) 284 { 285 zoom_begin_srv = zoom_begin.getValue(); 286 zoom_end_srv = zoom_end; 287 zoom_size_srv = zoom_end_srv-zoom_begin_srv+1 ; 288 } 282 289 } 283 290 -
XIOS/trunk/src/node/field.cpp
r569 r586 11 11 #include "type.hpp" 12 12 #include "context_client.hpp" 13 #include "context_server.hpp" 13 14 #include <set> 14 15 … … 254 255 { 255 256 if (!getRelFile()->allDomainEmpty) 257 { 256 258 if (grid->doGridHaveDataToWrite() || getRelFile()->type == CFile::type_attr::one_file) // if (! grid->domain->isEmpty() || getRelFile()->type == CFile::type_attr::one_file) 257 259 { … … 260 262 getRelFile()->getDataOutput()->writeFieldData(CField::get(this)); 261 263 } 264 } 262 265 } 263 266 … … 560 563 domList = grid->getDomainList(); 561 564 axisList = grid->getAxisList(); 565 if (domList.empty() && axisList.empty() && (!(this->grid->scalar_grid.getValue()))) 566 { 567 this->grid = CGrid::createGrid(vecDom, vecAxis); 568 } 562 569 } 563 570 else … … 566 573 << grid_ref.getValue() << "\' is wrong"); 567 574 } 575 else 576 { 577 this->grid = CGrid::createGrid(vecDom, vecAxis); 578 } 568 579 569 580 if (grid_ref.isEmpty() && domain_ref.isEmpty() && axis_ref.isEmpty()) … … 572 583 << "At least one dimension must be defined for this field."); 573 584 } 574 575 576 if (domList.empty() && axisList.empty())577 {578 this->grid = CGrid::createGrid(vecDom, vecAxis);579 }580 585 } 581 586 -
XIOS/trunk/src/node/grid.cpp
- Property svn:executable set to *
r585 r586 24 24 , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false), clientDistribution_(0), isIndexSent(false) 25 25 , serverDistribution_(0), serverDistributionDescription_(0), clientServerMap_(0), writtenDataSize_(0), globalDim_() 26 , connectedDataSize_(), connectedServerRank_() 26 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true) 27 27 { 28 28 setVirtualDomainGroup(); … … 35 35 , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false), clientDistribution_(0), isIndexSent(false) 36 36 , serverDistribution_(0), serverDistributionDescription_(0), clientServerMap_(0), writtenDataSize_(0), globalDim_() 37 , connectedDataSize_(), connectedServerRank_() 37 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true) 38 38 { 39 39 setVirtualDomainGroup(); … … 166 166 StdSize CGrid::getDataSize(void) const 167 167 { 168 StdSize retvalue = 1; 169 if (true == scalar_grid.getValue()) return retvalue; 168 170 std::vector<int> dataNindex = clientDistribution_->getDataNIndex(); 169 StdSize retvalue = 1; 171 170 172 for (int i = 0; i < dataNindex.size(); ++i) retvalue *= dataNindex[i]; 171 173 return (retvalue); … … 175 177 { 176 178 double secureFactor = 2.5 * sizeof(double) * CXios::bufferServerFactorSize; 177 StdSize retVal ;179 StdSize retVal = 1; 178 180 std::map<int, StdSize> ret; 179 std::map<int, size_t >::const_iterator it = connectedDataSize_.begin(), itE = connectedDataSize_.end(); 180 for (; it != itE; ++it) 181 std::map<int, size_t >::const_iterator itb = connectedDataSize_.begin(), it, itE = connectedDataSize_.end(); 182 183 if (true == scalar_grid.getValue()) 184 { 185 for (it = itb; it != itE; ++it) 186 { 187 retVal *= secureFactor; 188 ret.insert(std::make_pair(it->first, retVal)); 189 } 190 return ret; 191 } 192 193 for (it = itb; it != itE; ++it) 181 194 { 182 195 retVal = it->second; … … 185 198 } 186 199 200 if (connectedDataSize_.empty()) 201 { 202 for (int i = 0; i < connectedServerRank_.size(); ++i) 203 { 204 retVal = 1; 205 retVal *= secureFactor; 206 ret.insert(std::make_pair<int,StdSize>(connectedServerRank_[i], retVal)); 207 } 208 } 209 187 210 return ret; 188 211 } … … 203 226 CContext* context = CContext::getCurrent() ; 204 227 CContextClient* client=context->client ; 228 229 if (true == scalar_grid) 230 { 231 if (context->hasClient) 232 if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndexScalarGrid(); this->isIndexSent = true; } 233 234 if (this->isChecked) return; 235 if (context->hasClient) 236 { 237 this->computeIndexScalarGrid(); 238 } 239 240 this->isChecked = true; 241 return; 242 } 205 243 206 244 if (context->hasClient) … … 315 353 // First of all, compute distribution on client side 316 354 clientDistribution_ = new CDistributionClient(client->clientRank, this); 355 // Get local data index on client 356 storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().numElements()); 357 storeIndex_client = (clientDistribution_->getLocalDataIndexOnClient()); 358 isDataDistributed_= clientDistribution_->isDataDistributed(); 359 360 if (!doGridHaveDataDistributed()) 361 { 362 if (0 == client->clientRank) 363 { 364 size_t ssize = clientDistribution_->getLocalDataIndexOnClient().numElements(); 365 for (int rank = 0; rank < client->serverSize; ++rank) 366 connectedDataSize_[rank] = ssize; 367 } 368 return; 369 } 370 371 // Compute mapping between client and server 317 372 size_t globalSizeIndex = 1, indexBegin, indexEnd; 318 373 int range, clientSize = client->clientSize; … … 377 432 378 433 nbSenders = clientServerMap_->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_); 379 380 // Get local data index on client381 storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().numElements());382 storeIndex_client = (clientDistribution_->getLocalDataIndexOnClient());383 434 } 384 435 … … 409 460 if (!domains.empty()) for (int i = 0; i < domains.size(); ++i) new_id += domains[i]->getId() + StdString("_"); 410 461 if (!axis.empty()) for (int i = 0; i < axis.size(); ++i) new_id += axis[i]->getId() + StdString("_") ; 462 if (domains.empty() && axis.empty()) new_id += StdString("scalar_grid"); 411 463 new_id += StdString("_"); 412 464 … … 427 479 } 428 480 429 grid->computeGridGlobalDimension(domains, axis, grid->axis_domain_order); 481 if (domains.empty() && axis.empty()) grid->scalar_grid = true; 482 else grid->scalar_grid = false; 483 484 grid->computeGridGlobalDimension(domains, axis, grid->axisDomainOrder); 430 485 431 486 return (grid); … … 463 518 for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)] ; 464 519 } 520 521 void CGrid::computeIndexScalarGrid() 522 { 523 CContext* context = CContext::getCurrent(); 524 CContextClient* client=context->client; 525 526 storeIndex_client.resize(1); 527 storeIndex_client[0] = 0; 528 if (0 == client->clientRank) 529 { 530 for (int rank = 0; rank < client->serverSize; ++rank) 531 connectedDataSize_[rank] = 1; 532 } 533 isDataDistributed_ = false; 534 } 535 536 void CGrid::sendIndexScalarGrid() 537 { 538 CContext* context = CContext::getCurrent() ; 539 CContextClient* client=context->client ; 540 541 CEventClient event(getType(),EVENT_ID_INDEX); 542 list<shared_ptr<CMessage> > list_msg ; 543 list< CArray<size_t,1>* > listOutIndex; 544 if (0 == client->clientRank) 545 { 546 for (int rank = 0; rank < client->serverSize; ++rank) 547 { 548 int nb = 1; 549 CArray<size_t, 1> outGlobalIndexOnServer(nb); 550 CArray<int, 1> outLocalIndexToServer(nb); 551 for (int k = 0; k < nb; ++k) 552 { 553 outGlobalIndexOnServer(k) = 0; 554 outLocalIndexToServer(k) = 0; 555 } 556 557 storeIndex_toSrv.insert( pair<int,CArray<int,1>* >(rank,new CArray<int,1>(outLocalIndexToServer) )); 558 listOutIndex.push_back(new CArray<size_t,1>(outGlobalIndexOnServer)); 559 560 list_msg.push_back(shared_ptr<CMessage>(new CMessage)); 561 *list_msg.back()<<getId()<<isDataDistributed_<<*listOutIndex.back(); 562 563 event.push(rank, 1, *list_msg.back()); 564 } 565 client->sendEvent(event); 566 } 567 else 568 client->sendEvent(event); 569 570 for(list<CArray<size_t,1>* >::iterator it=listOutIndex.begin();it!=listOutIndex.end();++it) delete *it ; 571 } 465 572 466 573 void CGrid::sendIndex(void) … … 477 584 const CArray<size_t,1>& globalIndexSendToServer = clientDistribution_->getGlobalDataIndexSendToServer(); 478 585 479 std::map<int, std::vector<size_t> >::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap;480 itbGlobalMap = itGlobalMap = globalIndexOnServer.begin();481 iteGlobalMap = globalIndexOnServer.end();482 483 int nbGlobalIndex = globalIndexSendToServer.numElements();484 std::map<int,std::vector<int> >localIndexTmp;485 std::map<int,std::vector<size_t> > globalIndexTmp;486 for (; itGlobalMap != iteGlobalMap; ++itGlobalMap)487 {488 int serverRank = itGlobalMap->first;489 std::vector<size_t>::const_iterator itbVecGlobal = (itGlobalMap->second).begin(),490 iteVecGlobal = (itGlobalMap->second).end();491 for (int i = 0; i < nbGlobalIndex; ++i)492 {493 if (iteVecGlobal != std::find(itbVecGlobal, iteVecGlobal, globalIndexSendToServer(i)))494 {495 globalIndexTmp[serverRank].push_back(globalIndexSendToServer(i));496 localIndexTmp[serverRank].push_back(localIndexSendToServer(i));497 }498 }499 }500 501 502 586 if (!doGridHaveDataDistributed()) 503 587 { 504 588 if (0 == client->clientRank) 505 589 { 590 CArray<size_t, 1> outGlobalIndexOnServer = globalIndexSendToServer; 591 CArray<int,1> outLocalIndexToServer = localIndexSendToServer; 506 592 for (rank = 0; rank < client->serverSize; ++rank) 507 593 { 508 int nb = 0; 509 if (globalIndexTmp.end() != globalIndexTmp.find(rank)) 510 nb = globalIndexTmp[rank].size(); 511 512 CArray<size_t, 1> outGlobalIndexOnServer(nb); 513 CArray<int, 1> outLocalIndexToServer(nb); 514 for (int k = 0; k < nb; ++k) 515 { 516 outGlobalIndexOnServer(k) = globalIndexTmp[rank].at(k); 517 outLocalIndexToServer(k) = localIndexTmp[rank].at(k); 518 } 519 520 storeIndex_toSrv.insert( pair<int,CArray<int,1>* >(rank,new CArray<int,1>(outLocalIndexToServer) )); 594 storeIndex_toSrv.insert( pair<int,CArray<int,1>* >(rank,new CArray<int,1>(outLocalIndexToServer))); 521 595 listOutIndex.push_back(new CArray<size_t,1>(outGlobalIndexOnServer)); 522 596 523 597 list_msg.push_back(shared_ptr<CMessage>(new CMessage)); 524 *list_msg.back()<<getId()<< *listOutIndex.back();598 *list_msg.back()<<getId()<<isDataDistributed_<<*listOutIndex.back(); 525 599 526 600 event.push(rank, 1, *list_msg.back()); … … 533 607 else 534 608 { 609 std::map<int, std::vector<size_t> >::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap; 610 itbGlobalMap = itGlobalMap = globalIndexOnServer.begin(); 611 iteGlobalMap = globalIndexOnServer.end(); 612 613 int nbGlobalIndex = globalIndexSendToServer.numElements(); 614 std::map<int,std::vector<int> >localIndexTmp; 615 std::map<int,std::vector<size_t> > globalIndexTmp; 616 for (; itGlobalMap != iteGlobalMap; ++itGlobalMap) 617 { 618 int serverRank = itGlobalMap->first; 619 std::vector<size_t>::const_iterator itbVecGlobal = (itGlobalMap->second).begin(), 620 iteVecGlobal = (itGlobalMap->second).end(); 621 for (int i = 0; i < nbGlobalIndex; ++i) 622 { 623 if (iteVecGlobal != std::find(itbVecGlobal, iteVecGlobal, globalIndexSendToServer(i))) 624 { 625 globalIndexTmp[serverRank].push_back(globalIndexSendToServer(i)); 626 localIndexTmp[serverRank].push_back(localIndexSendToServer(i)); 627 } 628 } 629 } 630 535 631 for (int ns = 0; ns < connectedServerRank_.size(); ++ns) 536 632 { … … 552 648 553 649 list_msg.push_back(shared_ptr<CMessage>(new CMessage)); 554 *list_msg.back()<<getId()<< *listOutIndex.back();650 *list_msg.back()<<getId()<<isDataDistributed_<<*listOutIndex.back(); 555 651 556 652 event.push(rank, nbSenders[rank], *list_msg.back()); … … 612 708 bool CGrid::doGridHaveDataToWrite() 613 709 { 614 // return (0 != serverDistribution_); 615 return (0 != writtenDataSize_); 710 size_t ssize = 0; 711 for (map<int, CArray<size_t, 1>* >::const_iterator it = outIndexFromClient.begin(); 712 it != outIndexFromClient.end(); ++it) 713 { 714 ssize += (it->second)->numElements(); 715 } 716 return (0 != ssize); 616 717 } 617 718 … … 627 728 } 628 729 629 630 730 const CDistributionServer* CGrid::getDistributionServer() const 631 731 { … … 635 735 bool CGrid::doGridHaveDataDistributed() 636 736 { 637 return clientDistribution_->isDataDistributed(); 737 if (true == scalar_grid.getValue()) return false; 738 else 739 return isDataDistributed_; 638 740 } 639 741 640 742 void CGrid::recvIndex(int rank, CBufferIn& buffer) 641 743 { 744 CContext* context = CContext::getCurrent() ; 745 CContextServer* server=context->server ; 746 buffer>>isDataDistributed_; 747 size_t dataSize = 0; 748 749 if (true == scalar_grid) 750 { 751 writtenDataSize_ = 1; 752 CArray<size_t,1> outIndex; 753 buffer>>outIndex; 754 outIndexFromClient.insert(std::pair<int, CArray<size_t,1>* >(rank, new CArray<size_t,1>(outIndex))); 755 std::vector<int> nZoomBegin(1,0), nZoomSize(1,1), nGlob(1,1), nZoomBeginGlobal(1,0); 756 serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize, 757 nZoomBeginGlobal, nGlob); 758 return; 759 } 760 761 642 762 if (0 == serverDistribution_) 643 763 { 644 CContext* context = CContext::getCurrent() ;645 CContextServer* server=context->server ;646 int idx = 0, numElement = axis_domain_order.numElements();647 764 int ssize = numElement; 648 765 std::vector<int> indexMap(numElement); … … 687 804 } 688 805 } 689 writtenDataSize_= 1;806 dataSize = 1; 690 807 for (int i = 0; i < nZoomSize.size(); ++i) 691 writtenDataSize_*= nZoomSize[i];808 dataSize *= nZoomSize[i]; 692 809 693 810 serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize, … … 697 814 CArray<size_t,1> outIndex; 698 815 buffer>>outIndex; 699 serverDistribution_->computeLocalIndex(outIndex); 816 if (isDataDistributed_) 817 serverDistribution_->computeLocalIndex(outIndex); 818 else 819 { 820 dataSize = outIndex.numElements(); 821 for (int i = 0; i < outIndex.numElements(); ++i) outIndex(i) = i; 822 } 823 writtenDataSize_ += dataSize; 824 700 825 outIndexFromClient.insert(std::pair<int, CArray<size_t,1>* >(rank, new CArray<size_t,1>(outIndex))); 701 826 } … … 1081 1206 axis_domain_order(i) = order[i]; 1082 1207 } 1083 } 1208 scalar_grid = false; 1209 } 1210 else scalar_grid = true; 1084 1211 1085 1212 setDomainList(); -
XIOS/trunk/src/node/grid.hpp
r584 r586 36 36 BEGIN_DECLARE_ATTRIBUTE_MAP(CGrid) 37 37 # include "grid_attribute.conf" 38 DECLARE_ATTRIBUTE(bool, scalar_grid) 38 39 END_DECLARE_ATTRIBUTE_MAP(CGrid) 39 40 … … 134 135 void computeIndexServer(void); 135 136 void computeIndex(void); 137 void computeIndexScalarGrid(); 136 138 137 139 void solveDomainRef(bool checkAtt); … … 154 156 void recvIndex(int rank, CBufferIn& buffer) ; 155 157 void sendIndex(void) ; 158 void sendIndexScalarGrid(); 156 159 157 160 void computeDomConServer(); … … 225 228 std::map<int,size_t> connectedDataSize_; 226 229 std::vector<int> connectedServerRank_; 230 bool isDataDistributed_; 227 231 }; // class CGrid 228 232 -
XIOS/trunk/src/output/nc4_data_output.cpp
r575 r586 118 118 if (server->intraCommSize > 1) 119 119 { 120 120 121 // SuperClassWriter::addDimension(lonid, domain->zoom_ni.getValue()); 121 122 // SuperClassWriter::addDimension(latid, domain->zoom_nj.getValue()); … … 485 486 StdSize zoom_size_srv=axis->zoom_size_srv; 486 487 StdSize zoom_begin_srv=axis->zoom_begin_srv; 488 StdSize zoom_size = (MULTI_FILE == SuperClass::type) ? zoom_size_srv 489 : axis->zoom_size; 490 StdSize zoom_begin = (MULTI_FILE == SuperClass::type) ? zoom_begin_srv 491 : axis->zoom_begin; 487 492 488 493 … … 492 497 try 493 498 { 494 SuperClassWriter::addDimension(axisid, zoom_size _srv);499 SuperClassWriter::addDimension(axisid, zoom_size); 495 500 dims.push_back(axisid); 496 501 … … 527 532 SuperClassWriter::definition_end(); 528 533 529 CArray<double,1> axis_value(zoom_size _srv) ;534 CArray<double,1> axis_value(zoom_size) ; 530 535 for(StdSize i = 0 ; i < zoom_size_srv ; i++) axis_value(i)=axis->value(i+zoom_begin_srv) ; 531 536 SuperClassWriter::writeData(axis_value, axisid, isCollective, 0); … … 1235 1240 } 1236 1241 1237 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep()-1,&start,&count ); 1238 if (wtime) 1239 { 1240 SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep()-1,isRoot ); 1241 SuperClassWriter::writeTimeAxisData(time_counter, string("time_counter"), isCollective, field->getNStep()-1,isRoot ); 1242 SuperClassWriter::writeTimeAxisData(time_counter_bound, timeBoundId, isCollective, field->getNStep()-1, isRoot ); 1243 SuperClassWriter::writeTimeAxisData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep()-1, isRoot); 1244 } 1245 break; 1242 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep()-1,&start,&count ); 1243 if (wtime) 1244 { 1245 SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep()-1,isRoot ); 1246 SuperClassWriter::writeTimeAxisData(time_counter, string("time_counter"), isCollective, field->getNStep()-1,isRoot ); 1247 SuperClassWriter::writeTimeAxisData(time_counter_bound, timeBoundId, isCollective, field->getNStep()-1, isRoot ); 1248 SuperClassWriter::writeTimeAxisData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep()-1, isRoot); 1249 } 1250 1251 break; 1246 1252 } 1247 1253 } -
XIOS/trunk/src/test/test_complete.f90
r565 r586 96 96 CALL xios_set_domain_attr("domain_atm_zoom",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) 97 97 CALL xios_set_domain_attr("domain_atm_zoom",lonvalue=RESHAPE(lon,(/ni*nj/)),latvalue=RESHAPE(lat,(/ni*nj/))) 98 CALL xios_set_domain_attr("domain_atm_zoom",zoom_ibegin= 40, zoom_ni=20, zoom_jbegin=40, zoom_nj=10)98 CALL xios_set_domain_attr("domain_atm_zoom",zoom_ibegin=39, zoom_ni=20, zoom_jbegin=39, zoom_nj=5) 99 99 100 100 !!! Activation du groupe field_definition -
XIOS/trunk/src/test/test_new_features.f90
r569 r586 17 17 INTEGER,PARAMETER :: ni_glo=100 18 18 INTEGER,PARAMETER :: nj_glo=100 19 INTEGER,PARAMETER :: llm= 1020 DOUBLE PRECISION :: lval(llm)=1 19 INTEGER,PARAMETER :: llm=5 20 DOUBLE PRECISION :: lval(llm)=1, tsTemp 21 21 TYPE(xios_field) :: field_hdl 22 22 TYPE(xios_fieldgroup) :: fieldgroup_hdl … … 86 86 CALL xios_set_current_context(ctx_hdl) 87 87 88 !CALL xios_get_calendar_type(calendar_type)89 !PRINT *, "calendar_type = ", calendar_type88 CALL xios_get_calendar_type(calendar_type) 89 PRINT *, "calendar_type = ", calendar_type 90 90 91 91 CALL xios_set_axis_attr("axis_A", size=ni_glo, ibegin=ibegin, ni=ni, value=lval_ni) 92 92 CALL xios_set_axis_attr("axis_B", size=nj_glo, ibegin=jbegin, ni=nj, value=lval_nj) 93 93 CALL xios_set_axis_attr("axis_C", size=llm, value=lval) 94 CALL xios_set_axis_attr("axis_D", size=llm, value=lval)94 CALL xios_set_axis_attr("axis_D", size=llm, ibegin=axisBegin, ni=nAxis, value=lval) 95 95 CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj) 96 96 CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) 97 97 CALL xios_set_domain_attr("domain_A",lonvalue=RESHAPE(lon,(/ni*nj/)),latvalue=RESHAPE(lat,(/ni*nj/))) 98 CALL xios_set_domain_attr("domain_A",zoom_ibegin=40, zoom_ni=20, zoom_jbegin=40, zoom_nj=10) 98 99 CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.) 99 100 … … 106 107 CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_C") 107 108 108 CALL xios_get_handle("output_A xis",file_hdl)109 CALL xios_get_handle("output_All_Axis",file_hdl) 109 110 CALL xios_add_child(file_hdl,field_hdl) 110 111 CALL xios_set_attr(field_hdl,field_ref="field_All_Axis",name="field_C") … … 146 147 CALL xios_update_calendar(ts) 147 148 CALL xios_send_field("field_A",field_A) 148 !CALL xios_send_field("field_Axis",field_Axis)149 CALL xios_send_field("field_Axis",field_Axis) 149 150 CALL xios_send_field("field_All_Axis",field_All_Axis) 151 tsTemp = ts 152 CALL xios_send_field("field_Scalar", tsTemp) 150 153 CALL wait_us(5000) ; 151 154 ENDDO
Note: See TracChangeset
for help on using the changeset viewer.