- Timestamp:
- 01/25/17 16:25:17 (7 years ago)
- Location:
- XIOS/dev/branch_yushan
- Files:
-
- 42 added
- 112 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan/bld.cfg
r1010 r1037 29 29 src::netcdf $PWD/extern/netcdf4 30 30 src::remap $PWD/extern/remap/src 31 src::src_ep_dev $PWD/extern/src_ep_dev 31 32 bld::lib xios 32 bld::target libxios.a33 #bld::target libxios.a 33 34 #bld::target generate_fortran_interface.exe 34 35 bld::target xios_server.exe 35 bld::target test_remap.exe 36 bld::target test_regular.exe 37 bld::target test_new_features.exe test_unstruct_complete.exe 38 bld::target test_client.exe test_complete.exe test_xios2_cmip6.exe 36 #test_remap.exe 37 #bld::target test_new_features.exe test_unstruct_complete.exe 38 bld::target test_client.exe #test_complete.exe 39 39 bld::exe_dep 40 40 -
XIOS/dev/branch_yushan/src/attribute_map.cpp
r996 r1037 28 28 29 29 //--------------------------------------------------------------- 30 31 bool CAttributeMap::hasAttribute(const StdString& key) const 32 { 33 return (this->find(key) != this->end()); 34 } 30 35 31 36 void CAttributeMap::clearAttribute(const StdString& key) -
XIOS/dev/branch_yushan/src/attribute_map.hpp
r996 r1037 20 20 21 21 /// Tests /// 22 bool hasAttribute(const StdString & key) const;22 inline bool hasAttribute(const StdString & key) const; 23 23 24 24 /// Accesseurs /// … … 72 72 }; // class CAttributeMap 73 73 74 inline bool CAttributeMap::hasAttribute(const StdString& key) const75 {76 return (this->find(key) != this->end());77 }78 79 74 } // namespace xios 80 75 -
XIOS/dev/branch_yushan/src/attribute_template_impl.hpp
r1028 r1037 71 71 T CAttributeTemplate<T>::getValue(void) const 72 72 { 73 return CType<T>::get() ;74 /* 75 if (SuperClass::isEmpty())76 {77 ERROR("T CAttributeTemplate<T>::getValue(void) const",78 << "[ id = " << this->getId() << "]"79 << " L'attribut est requis mais n'est pas défini !");80 }81 return (SuperClass::getValue<T>());73 return CType<T>::get() ; 74 /* 75 if (SuperClass::isEmpty()) 76 { 77 ERROR("T CAttributeTemplate<T>::getValue(void) const", 78 << "[ id = " << this->getId() << "]" 79 << " L'attribut est requis mais n'est pas défini !"); 80 } 81 return (SuperClass::getValue<T>()); 82 82 */ 83 83 } -
XIOS/dev/branch_yushan/src/buffer_client.cpp
r917 r1037 7 7 #include "mpi.hpp" 8 8 #include "tracer.hpp" 9 9 10 10 11 namespace xios … … 80 81 traceOn(); 81 82 if (flag == true) pending = false; 83 84 //printf("\ncheckbuffer, flag = %d, pending = %d; request = %p, count = %d\n", flag, pending, &request, count); 82 85 } 83 86 -
XIOS/dev/branch_yushan/src/buffer_client.hpp
r917 r1037 6 6 #include "mpi.hpp" 7 7 #include "cxios.hpp" 8 #ifdef _usingEP 9 #include "ep_declaration.hpp" 10 #endif 8 11 9 12 namespace xios -
XIOS/dev/branch_yushan/src/client.cpp
r1032 r1037 30 30 if (initialized) is_MPI_Initialized=true ; 31 31 else is_MPI_Initialized=false ; 32 33 //return; 32 34 33 35 // don't use OASIS … … 87 89 88 90 MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ; 91 89 92 90 93 if (CXios::usingServer) … … 97 100 MPI_Comm_rank(intraComm,&intraCommRank) ; 98 101 info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize 99 <<" intraCommRank :"<<intraCommRank<<" clientLeader "<< serverLeader<<endl ;102 <<" intraCommRank :"<<intraCommRank<<" serverLeader "<< serverLeader<<endl ; 100 103 MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ; 101 104 } … … 148 151 149 152 MPI_Comm_dup(intraComm,&returnComm) ; 153 150 154 } 151 155 … … 160 164 if (!CXios::isServer) 161 165 { 166 167 168 162 169 int size,rank,globalRank ; 163 170 size_t message_size ; … … 165 172 MPI_Comm contextInterComm ; 166 173 174 167 175 MPI_Comm_size(contextComm,&size) ; 168 176 MPI_Comm_rank(contextComm,&rank) ; … … 173 181 CMessage msg ; 174 182 msg<<idServer<<size<<globalRank ; 175 // msg<<id<<size<<globalRank ; 183 176 184 177 185 int messageSize=msg.size() ; 178 char* buff = new char[messageSize] ;179 CBufferOut buffer( (void*)buff,messageSize) ;186 void * buff = new char[messageSize] ; 187 CBufferOut buffer(buff,messageSize) ; 180 188 buffer<<msg ; 181 182 MPI_Send((void*)buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ; 189 190 191 192 MPI_Send(buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ; 183 193 delete [] buff ; 194 195 printf("====== Client: begin context_init \n"); 196 184 197 185 198 MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ; 186 199 info(10)<<"Register new Context : "<<id<<endl ; 200 201 cout<<"Register new Context : "<<id<<endl ; 202 187 203 188 204 MPI_Comm inter ; 189 205 MPI_Intercomm_merge(contextInterComm,0,&inter) ; 190 206 MPI_Barrier(inter) ; 191 207 208 192 209 context->initClient(contextComm,contextInterComm) ; 210 211 printf("====== Client: context_init OK\n"); 193 212 194 213 contextInterComms.push_back(contextInterComm); … … 220 239 221 240 MPI_Comm_rank(intraComm,&rank) ; 241 242 printf("CClient::finalize called isServer = %d\n", CXios::isServer); 222 243 223 244 if (!CXios::isServer) … … 227 248 { 228 249 MPI_Send(&msg,1,MPI_INT,0,0,interComm) ; 250 printf(" CClient : send finalize sign to server 0\n"); 229 251 } 230 252 } … … 241 263 { 242 264 if (CXios::usingOasis) oasis_finalize(); 243 else MPI_Finalize() ;265 else {MPI_Finalize() ; printf("CClient::finalize called MPI_finalize\n");} 244 266 } 245 267 -
XIOS/dev/branch_yushan/src/client.hpp
r655 r1037 4 4 #include "xios_spl.hpp" 5 5 #include "mpi.hpp" 6 #ifdef _usingEP 7 //#include "ep_declaration.hpp" 8 #endif 9 6 10 7 11 namespace xios -
XIOS/dev/branch_yushan/src/client_client_dht_template_impl.hpp
r892 r1037 10 10 #include "utils.hpp" 11 11 #include "mpi_tag.hpp" 12 #ifdef _usingEP 13 #include "ep_declaration.hpp" 14 #endif 15 12 16 13 17 namespace xios … … 37 41 : H(clientIntraComm), index2InfoMapping_(), indexToInfoMappingLevel_(), nbClient_(0) 38 42 { 43 39 44 MPI_Comm_size(clientIntraComm, &nbClient_); 40 45 this->computeMPICommLevel(); 41 int nbLvl = this->getNbLevel(); 46 int nbLvl = this->getNbLevel(); 42 47 sendRank_.resize(nbLvl); 43 48 recvRank_.resize(nbLvl); 44 49 Index2VectorInfoTypeMap indexToVecInfoMap; 45 indexToVecInfoMap.rehash(std::ceil(indexInfoMap.size()/indexToVecInfoMap.max_load_factor())); 46 typename Index2InfoTypeMap::const_iterator it = indexInfoMap.begin(), ite = indexInfoMap.end(); 47 for (; it != ite; ++it) indexToVecInfoMap[it->first].push_back(it->second); 48 computeDistributedIndex(indexToVecInfoMap, clientIntraComm, nbLvl-1); 50 indexToVecInfoMap.rehash(std::ceil(indexInfoMap.size()/indexToVecInfoMap.max_load_factor())); 51 typename Index2InfoTypeMap::const_iterator it = indexInfoMap.begin(), ite = indexInfoMap.end(); 52 for (; it != ite; ++it) 53 { 54 indexToVecInfoMap[it->first].push_back(it->second); 55 } 56 57 computeDistributedIndex(indexToVecInfoMap, clientIntraComm, nbLvl-1); 49 58 } 50 59 … … 179 188 { 180 189 if (0 != recvNbIndexClientCount[idx]) 190 { 181 191 recvIndexFromClients(recvRankClient[idx], recvIndexBuff+currentIndex, recvNbIndexClientCount[idx], commLevel, request); 192 } 182 193 currentIndex += recvNbIndexClientCount[idx]; 183 194 } … … 189 200 190 201 std::vector<MPI_Status> status(request.size()); 202 203 //printf("1(%d): calling wait all for %lu requests\n", clientRank, request.size()); 204 191 205 MPI_Waitall(request.size(), &request[0], &status[0]); 206 207 208 //printf(" 1(%d): calling wait all for %lu requests OK\n", clientRank, request.size()); 192 209 193 210 CArray<size_t,1>* tmpGlobalIndex; … … 294 311 295 312 std::vector<MPI_Status> statusOnReturn(requestOnReturn.size()); 313 //printf("2(%d): calling wait all for %lu requests\n", clientRank, requestOnReturn.size()); 296 314 MPI_Waitall(requestOnReturn.size(), &requestOnReturn[0], &statusOnReturn[0]); 315 316 //printf(" 2(%d): calling wait all for %lu requests OK\n", clientRank, requestOnReturn.size()); 297 317 298 318 Index2VectorInfoTypeMap indexToInfoMapping; … … 363 383 int level) 364 384 { 385 //printf("in computeDistributedIndex(const Index2VectorInfoTypeMap& indexInfoMap, const MPI_Comm& commLevel, int level)\n"); 365 386 int clientRank; 366 387 MPI_Comm_rank(commLevel,&clientRank); … … 418 439 } 419 440 441 //printf("check 4 OK. clientRank = %d\n", clientRank); 442 420 443 // Calculate from how many clients each client receive message. 421 444 // Calculate size of buffer for receiving message … … 423 446 sendRecvRank(level, sendBuff, sendNbIndexBuff, 424 447 recvRankClient, recvNbIndexClientCount); 448 //printf("sendRecvRank OK\n"); 425 449 426 450 int recvNbIndexCount = 0; … … 435 459 recvInfoBuff = new unsigned char[recvNbIndexCount*ProcessDHTElement<InfoType>::typeSize()]; 436 460 } 461 462 //printf("check 5 OK. clientRank = %d\n", clientRank); 437 463 438 464 // If a client holds information about index and the corresponding which don't belong to it, … … 447 473 { 448 474 recvIndexFromClients(recvRankClient[idx], recvIndexBuff+currentIndex, recvNbIndexClientCount[idx], commLevel, request); 475 449 476 recvInfoFromClients(recvRankClient[idx], 450 477 recvInfoBuff+currentIndex*ProcessDHTElement<InfoType>::typeSize(), 451 478 recvNbIndexClientCount[idx]*ProcessDHTElement<InfoType>::typeSize(), 452 479 commLevel, request); 480 453 481 } 454 482 currentIndex += recvNbIndexClientCount[idx]; 455 483 } 484 485 //printf("check 6 OK. clientRank = %d\n", clientRank); 456 486 457 487 boost::unordered_map<int, size_t* >::iterator itbIndex = client2ClientIndex.begin(), itIndex, 458 488 iteIndex = client2ClientIndex.end(); 459 489 for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex) 490 { 460 491 sendIndexToClients(itIndex->first, itIndex->second, sendNbIndexBuff[itIndex->first-groupRankBegin], commLevel, request); 492 493 } 494 495 //printf("check 7 OK. clientRank = %d\n", clientRank); 496 461 497 boost::unordered_map<int, unsigned char*>::iterator itbInfo = client2ClientInfo.begin(), itInfo, 462 498 iteInfo = client2ClientInfo.end(); 463 499 for (itInfo = itbInfo; itInfo != iteInfo; ++itInfo) 500 { 464 501 sendInfoToClients(itInfo->first, itInfo->second, sendNbInfo[itInfo->first-groupRankBegin], commLevel, request); 465 502 503 } 504 505 //printf("check 8 OK. clientRank = %d\n", clientRank); 466 506 std::vector<MPI_Status> status(request.size()); 507 467 508 MPI_Waitall(request.size(), &request[0], &status[0]); 468 509 … … 480 521 { 481 522 ProcessDHTElement<InfoType>::unpackElement(infoValue, infoBuff, infoIndex); 523 unsigned long pp = *(recvIndexBuff+currentIndex+i); 524 482 525 indexToInfoMapping[*(recvIndexBuff+currentIndex+i)].push_back(infoValue); 483 526 } 484 527 currentIndex += count; 485 528 } 529 530 //printf("check 9 OK. clientRank = %d\n", clientRank); 486 531 487 532 if (0 != recvNbIndexCount) … … 498 543 delete [] it->second; 499 544 545 //printf("check 10 OK. clientRank = %d\n", clientRank); 500 546 // Ok, now do something recursive 501 547 if (0 < level) … … 523 569 MPI_Request request; 524 570 requestSendIndex.push_back(request); 571 525 572 MPI_Isend(indices, indiceSize, MPI_UNSIGNED_LONG, 526 573 clientDestRank, MPI_DHT_INDEX, clientIntraComm, &(requestSendIndex.back())); … … 541 588 MPI_Request request; 542 589 requestRecvIndex.push_back(request); 590 543 591 MPI_Irecv(indices, indiceSize, MPI_UNSIGNED_LONG, 544 592 clientSrcRank, MPI_DHT_INDEX, clientIntraComm, &(requestRecvIndex.back())); … … 560 608 MPI_Request request; 561 609 requestSendInfo.push_back(request); 562 610 //printf("MPI_IsendInfo(info, infoSize, MPI_CHAR,... char count = %d, dest = %d, buf_size = %d\n", infoSize, clientDestRank, sizeof(*info) ); 563 611 MPI_Isend(info, infoSize, MPI_CHAR, 564 612 clientDestRank, MPI_DHT_INFO, clientIntraComm, &(requestSendInfo.back())); … … 668 716 ++nRequest; 669 717 } 670 718 719 int clientRank; 720 MPI_Comm_rank(this->internalComm_,&clientRank); 721 //printf("4(%d): calling wait all for %lu requests\n", clientRank, sendNbRank.size()+recvNbRank.size()); 671 722 MPI_Waitall(sendNbRank.size()+recvNbRank.size(), &request[0], &requestStatus[0]); 723 //printf(" 4(%d): calling wait all for %lu requests OK\n", clientRank, sendNbRank.size()+recvNbRank.size()); 672 724 } 673 725 … … 686 738 std::vector<int>& recvNbRank, std::vector<int>& recvNbElements) 687 739 { 740 int myRank; 741 MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 742 //printf("myRank = %d, in sendRecvRank(int level, const std::vector<int>& sendNbRank, const std::vector<int>& sendNbElements, std::vector<int>& recvNbRank, std::vector<int>& recvNbElements)\n", myRank); 688 743 int groupBegin = this->getGroupBegin()[level]; 689 744 … … 702 757 for (int idx = 0; idx < recvBuffSize; ++idx) 703 758 { 759 //printf("myRank = %d starts irecv with src = %d, tag = %d, idx = %d\n", myRank, recvRank[idx], MPI_DHT_INDEX_0, idx); 704 760 MPI_Irecv(&recvBuff[0]+2*idx, 2, MPI_INT, 705 761 recvRank[idx], MPI_DHT_INDEX_0, this->internalComm_, &request[nRequest]); 762 //printf("myRank = %d MPI_Irecv OK, idx = %d, nRequest = %d\n", myRank, idx, nRequest); 706 763 ++nRequest; 707 764 } 765 766 //printf("myRank = %d, check 1 OK\n", myRank); 708 767 709 768 for (int idx = 0; idx < sendBuffSize; ++idx) … … 716 775 for (int idx = 0; idx < sendBuffSize; ++idx) 717 776 { 777 //printf("myRank = %d starts isend with dest = %d, tag = %d, idx = %d\n", myRank, sendRank[idx], MPI_DHT_INDEX_0, idx); 718 778 MPI_Isend(&sendBuff[idx*2], 2, MPI_INT, 719 779 sendRank[idx], MPI_DHT_INDEX_0, this->internalComm_, &request[nRequest]); 780 //printf("myRank = %d MPI_Isend OK, idx = %d, nRequest = %d\n", myRank, idx, nRequest); 720 781 ++nRequest; 721 782 } 722 783 784 MPI_Barrier(this->internalComm_); 785 786 //printf("myRank = %d, check 2 OK\n", myRank); 787 788 int clientRank; 789 MPI_Comm_rank(this->internalComm_,&clientRank); 790 791 //printf("5(%d): calling wait all for %lu requests\n", myRank, sendBuffSize+recvBuffSize); 723 792 MPI_Waitall(sendBuffSize+recvBuffSize, &request[0], &requestStatus[0]); 793 //printf(" 5(%d): calling wait all for %lu requests OK\n", myRank, sendBuffSize+recvBuffSize); 794 //printf("check 3 OK\n"); 795 724 796 int nbRecvRank = 0, nbRecvElements = 0; 725 797 recvNbRank.clear(); … … 733 805 } 734 806 } 735 } 736 737 } 807 //printf("check 4 OK\n"); 808 } 809 810 } -
XIOS/dev/branch_yushan/src/client_server_mapping.hpp
r843 r1037 14 14 #include "mpi.hpp" 15 15 #include <boost/unordered_map.hpp> 16 #ifdef _usingEP 17 #include "ep_declaration.hpp" 18 #endif 19 16 20 17 21 namespace xios { -
XIOS/dev/branch_yushan/src/config/field_attribute.conf
r998 r1037 11 11 DECLARE_ATTRIBUTE(int, level) 12 12 DECLARE_ATTRIBUTE(int, prec) 13 DECLARE_ATTRIBUTE(StdString, expr)14 13 15 14 DECLARE_ATTRIBUTE(bool, enabled) … … 34 33 DECLARE_ATTRIBUTE(bool, ts_enabled) 35 34 DECLARE_ATTRIBUTE(CDuration, ts_split_freq) 36 37 DECLARE_ATTRIBUTE(StdString, cell_methods)38 DECLARE_ENUM4(cell_methods_mode, overwrite, prefix, suffix, none) -
XIOS/dev/branch_yushan/src/config/interpolate_domain_attribute.conf
r1014 r1037 1 1 /* GLOBAL */ 2 DECLARE_ATTRIBUTE(StdString, file) 2 3 DECLARE_ATTRIBUTE(int, order) 3 4 DECLARE_ATTRIBUTE(bool, renormalize) 4 5 5 6 /* Write interpolation weights into file */ 6 DECLARE_ENUM3(mode,compute,read,read_or_compute) 7 DECLARE_ATTRIBUTE(StdString, weight_filename) 8 DECLARE_ATTRIBUTE(bool, write_weight) 7 DECLARE_ENUM2(mode,write,read) -
XIOS/dev/branch_yushan/src/context_client.cpp
r1033 r1037 50 50 for (int i = 0; i < serverByClient; i++) 51 51 ranksServerLeader.push_back(rankStart + i); 52 53 ranksServerNotLeader.resize(0);54 52 } 55 53 else … … 62 60 if (clientRank % (clientByServer + 1) == 0) 63 61 ranksServerLeader.push_back(clientRank / (clientByServer + 1)); 64 else65 ranksServerNotLeader.push_back(clientRank / (clientByServer + 1));66 62 } 67 63 else … … 70 66 if (rank % clientByServer == 0) 71 67 ranksServerLeader.push_back(remain + rank / clientByServer); 72 else 73 ranksServerNotLeader.push_back(remain + rank / clientByServer); 74 } 68 } 75 69 } 76 70 … … 85 79 { 86 80 list<int> ranks = event.getRanks(); 87 88 81 if (!event.isEmpty()) 89 82 { 90 83 list<int> sizes = event.getSizes(); 91 84 92 // We force the getBuffers call to be non-blocking on the servers 93 list<CBufferOut*> buffList; 94 bool couldBuffer = getBuffers(ranks, sizes, buffList, !CXios::isClient); 95 96 if (couldBuffer) 97 { 98 event.send(timeLine, sizes, buffList); 99 100 checkBuffers(ranks); 101 102 if (isAttachedModeEnabled()) // couldBuffer is always true in attached mode 103 { 104 waitEvent(ranks); 105 CContext::setCurrent(context->getId()); 106 } 107 } 108 else 109 { 110 tmpBufferedEvent.ranks = ranks; 111 tmpBufferedEvent.sizes = sizes; 112 113 for (list<int>::const_iterator it = sizes.begin(); it != sizes.end(); it++) 114 tmpBufferedEvent.buffers.push_back(new CBufferOut(*it)); 115 116 event.send(timeLine, tmpBufferedEvent.sizes, tmpBufferedEvent.buffers); 117 } 85 list<CBufferOut*> buffList = getBuffers(ranks, sizes); 86 87 event.send(timeLine, sizes, buffList); 88 89 checkBuffers(ranks); 90 } 91 92 if (isAttachedModeEnabled()) 93 { 94 waitEvent(ranks); 95 CContext::setCurrent(context->getId()); 118 96 } 119 97 120 98 timeLine++; 121 }122 123 /*!124 * Send the temporarily buffered event (if any).125 *126 * \return true if a temporarily buffered event could be sent, false otherwise127 */128 bool CContextClient::sendTemporarilyBufferedEvent()129 {130 bool couldSendTmpBufferedEvent = false;131 132 if (hasTemporarilyBufferedEvent())133 {134 list<CBufferOut*> buffList;135 if (getBuffers(tmpBufferedEvent.ranks, tmpBufferedEvent.sizes, buffList, true)) // Non-blocking call136 {137 list<CBufferOut*>::iterator it, itBuffer;138 139 for (it = tmpBufferedEvent.buffers.begin(), itBuffer = buffList.begin(); it != tmpBufferedEvent.buffers.end(); it++, itBuffer++)140 (*itBuffer)->put((char*)(*it)->start(), (*it)->count());141 142 checkBuffers(tmpBufferedEvent.ranks);143 144 tmpBufferedEvent.clear();145 146 couldSendTmpBufferedEvent = true;147 }148 }149 150 return couldSendTmpBufferedEvent;151 99 } 152 100 … … 159 107 { 160 108 parentServer->server->setPendingEvent(); 109 size_t pendingmapSize; 161 110 while (checkBuffers(ranks)) 162 111 { 163 parentServer->server->listen(); 164 parentServer->server->checkPendingRequest(); 112 parentServer->server->listen(); 113 parentServer->server->checkPendingRequest(); 165 114 } 166 115 167 116 while (parentServer->server->hasPendingEvent()) 168 117 { 169 parentServer->server->eventLoop(); 118 parentServer->server->eventLoop(); //printf("parentServer->server->eventLoop()\n"); 170 119 } 171 120 } 172 121 173 122 /*! 174 * Get buffers for each connection to the servers. This function blocks until there is enough room in the buffers unless 175 * it is explicitly requested to be non-blocking. 176 * 177 * \param [in] serverList list of rank of connected server 178 * \param [in] sizeList size of message corresponding to each connection 179 * \param [out] retBuffers list of buffers that can be used to store an event 180 * \param [in] nonBlocking whether this function should be non-blocking 181 * \return whether the already allocated buffers could be used 123 Setup buffer for each connection to server and verify their state to put content into them 124 \param [in] serverList list of rank of connected server 125 \param [in] sizeList size of message corresponding to each connection 126 \return List of buffer input which event can be placed 182 127 */ 183 bool CContextClient::getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking /*= false*/)128 list<CBufferOut*> CContextClient::getBuffers(list<int>& serverList, list<int>& sizeList) 184 129 { 185 list<int>:: const_iterator itServer, itSize;130 list<int>::iterator itServer, itSize; 186 131 list<CClientBuffer*> bufferList; 187 map<int,CClientBuffer*>:: const_iterator it;132 map<int,CClientBuffer*>::iterator it; 188 133 list<CClientBuffer*>::iterator itBuffer; 134 list<CBufferOut*> retBuffer; 189 135 bool areBuffersFree; 190 136 … … 212 158 context->server->listen(); 213 159 } 214 } while (!areBuffersFree && !nonBlocking);160 } while (!areBuffersFree); 215 161 CTimer::get("Blocking time").suspend(); 216 162 217 if (areBuffersFree) 218 { 219 for (itBuffer = bufferList.begin(), itSize = sizeList.begin(); itBuffer != bufferList.end(); itBuffer++, itSize++) 220 retBuffers.push_back((*itBuffer)->getBuffer(*itSize)); 221 } 222 223 return areBuffersFree; 163 for (itBuffer = bufferList.begin(), itSize = sizeList.begin(); itBuffer != bufferList.end(); itBuffer++, itSize++) 164 { 165 retBuffer.push_back((*itBuffer)->getBuffer(*itSize)); 166 } 167 return retBuffer; 224 168 } 225 169 … … 291 235 if (ratio < minBufferSizeEventSizeRatio) minBufferSizeEventSizeRatio = ratio; 292 236 } 237 #ifdef _usingMPI 293 238 MPI_Allreduce(MPI_IN_PLACE, &minBufferSizeEventSizeRatio, 1, MPI_DOUBLE, MPI_MIN, intraComm); 294 239 #elif _usingEP 240 MPI_Allreduce(&minBufferSizeEventSizeRatio, &minBufferSizeEventSizeRatio, 1, MPI_DOUBLE, MPI_MIN, intraComm); 241 #endif 242 295 243 if (minBufferSizeEventSizeRatio < 1.0) 296 244 ERROR("void CContextClient::setBufferSize(const std::map<int,StdSize>& mapSize, const std::map<int,StdSize>& maxEventSize)", … … 301 249 + 1; // the other local buffer might contain only one event 302 250 } 303 304 /*!305 Get leading server in the group of connected server306 \return ranks of leading servers307 */308 const std::list<int>& CContextClient::getRanksServerNotLeader(void) const309 {310 return ranksServerNotLeader;311 }312 313 /*!314 Check if client connects to leading server315 \return connected(true), not connected (false)316 */317 bool CContextClient::isServerNotLeader(void) const318 {319 return !ranksServerNotLeader.empty();320 }321 251 322 252 /*! … … 354 284 { 355 285 map<int,CClientBuffer*>::iterator itBuff; 356 bool stop = false; 357 358 CTimer::get("Blocking time").resume(); 359 while (hasTemporarilyBufferedEvent()) 360 { 361 checkBuffers(); 362 sendTemporarilyBufferedEvent(); 363 } 364 CTimer::get("Blocking time").suspend(); 286 bool stop = true; 365 287 366 288 CEventClient event(CContext::GetType(), CContext::EVENT_ID_CONTEXT_FINALIZE); … … 376 298 377 299 CTimer::get("Blocking time").resume(); 378 while ( !stop)300 while (stop) 379 301 { 380 302 checkBuffers(); 381 if (hasTemporarilyBufferedEvent()) 382 sendTemporarilyBufferedEvent(); 383 384 stop = true; 385 for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop &= !itBuff->second->hasPendingRequest(); 303 stop = false; 304 for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop |= itBuff->second->hasPendingRequest(); 386 305 } 387 306 CTimer::get("Blocking time").suspend(); -
XIOS/dev/branch_yushan/src/context_client.hpp
r1033 r1037 10 10 #include "mpi.hpp" 11 11 #include "registry.hpp" 12 #ifdef _usingEP 13 //#include "ep_declaration.hpp" 14 #endif 15 12 16 13 17 namespace xios … … 31 35 // Send event to server 32 36 void sendEvent(CEventClient& event); 33 bool sendTemporarilyBufferedEvent();34 37 void waitEvent(list<int>& ranks); 35 38 36 // Functions to set/get buffers37 bool getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking = false);39 // Functions relates to set/get buffers 40 list<CBufferOut*> getBuffers(list<int>& serverlist, list<int>& sizeList); 38 41 void newBuffer(int rank); 39 42 bool checkBuffers(list<int>& ranks); … … 42 45 43 46 bool isServerLeader(void) const; 44 bool isServerNotLeader(void) const;45 47 const std::list<int>& getRanksServerLeader(void) const; 46 const std::list<int>& getRanksServerNotLeader(void) const;47 48 48 49 bool isAttachedModeEnabled() const; 49 50 bool hasTemporarilyBufferedEvent() const { return !tmpBufferedEvent.isEmpty(); };51 50 52 51 // Close and finalize context client … … 79 78 StdSize maxBufferedEvents; 80 79 81 struct {82 std::list<int> ranks, sizes;83 std::list<CBufferOut*> buffers;84 85 bool isEmpty() const { return ranks.empty(); };86 void clear() {87 ranks.clear();88 sizes.clear();89 90 for (std::list<CBufferOut*>::iterator it = buffers.begin(); it != buffers.end(); it++)91 delete *it;92 93 buffers.clear();94 };95 } tmpBufferedEvent; //! Event temporarily buffered (used only on the server)96 97 80 //! Context for server (Only used in attached mode) 98 81 CContext* parentServer; … … 100 83 //! List of server ranks for which the client is leader 101 84 std::list<int> ranksServerLeader; 102 103 //! List of server ranks for which the client is not leader104 std::list<int> ranksServerNotLeader;105 85 106 86 public: // Some function should be removed in the future -
XIOS/dev/branch_yushan/src/context_server.cpp
r1033 r1037 57 57 } 58 58 59 bool CContextServer::eventLoop( bool enableEventsProcessing /*= true*/)59 bool CContextServer::eventLoop(void) 60 60 { 61 61 listen(); 62 62 checkPendingRequest(); 63 if (enableEventsProcessing) 64 processEvents(); 63 processEvents(); 65 64 return finished; 66 65 } … … 77 76 for(rank=0;rank<commSize;rank++) 78 77 { 78 //printf("in CContextServer::listen, rank = %d, commSize = %d, pendingRequest.find(rank) = %d\n", rank, commSize, pendingRequest.find(rank)); 79 79 if (pendingRequest.find(rank)==pendingRequest.end()) 80 80 { … … 85 85 { 86 86 it=buffers.find(rank); 87 87 88 if (it==buffers.end()) // Receive the buffer size and allocate the buffer 88 89 { … … 91 92 mapBufferSize_.insert(std::make_pair(rank, buffSize)); 92 93 it=(buffers.insert(pair<int,CServerBuffer*>(rank,new CServerBuffer(buffSize)))).first; 94 //printf("find message, is buffer end, receiving, buffSize = %d, rank = %d, commSize = %d\n", buffSize, rank, commSize); 93 95 } 94 96 else 95 97 { 98 96 99 MPI_Get_count(&status,MPI_CHAR,&count); 97 100 if (it->second->isBufferFree(count)) … … 100 103 MPI_Irecv(addr,count,MPI_CHAR,rank,20,interComm,&pendingRequest[rank]); 101 104 bufferRequest[rank]=addr; 105 //printf("find message, i-receiving to buffer %p, rank = %d, commSize = %d\n", addr, rank, commSize); 102 106 } 103 107 } … … 116 120 int count; 117 121 MPI_Status status; 122 123 //printf("enter checkPendingRequest\n"); 118 124 119 125 for(it=pendingRequest.begin();it!=pendingRequest.end();it++) … … 185 191 // The best way to properly solve this problem will be to use the event scheduler also in attached mode 186 192 // for now just set up a MPI barrier 187 if (!CServer::eventScheduler && CXios::isServer) MPI_Barrier(intraComm) ;193 if (!CServer::eventScheduler) MPI_Barrier(intraComm) ; 188 194 189 195 CTimer::get("Process events").resume(); -
XIOS/dev/branch_yushan/src/context_server.hpp
r1033 r1037 15 15 16 16 CContextServer(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ; 17 bool eventLoop( bool enableEventsProcessing = true);17 bool eventLoop(void) ; 18 18 void listen(void) ; 19 19 void checkPendingRequest(void) ; -
XIOS/dev/branch_yushan/src/cxios.cpp
r1029 r1037 30 30 bool CXios::isOptPerformance = true; 31 31 CRegistry* CXios::globalRegistry = 0; 32 double CXios::recvFieldTimeout = 10.0;33 32 34 33 //! Parse configuration file and create some objects from it 35 34 void CXios::initialize() 36 35 { 36 37 37 38 set_new_handler(noMemory); 38 39 parseFile(rootFile); … … 64 65 bufferSizeFactor = getin<double>("buffer_size_factor", defaultBufferSizeFactor); 65 66 minBufferSize = getin<int>("min_buffer_size", 1024 * sizeof(double)); 66 recvFieldTimeout = getin<double>("recv_field_timeout", 10.0); 67 if (recvFieldTimeout < 0.0) 68 ERROR("CXios::parseXiosConfig()", "recv_field_timeout cannot be negative."); 69 70 globalComm=MPI_COMM_WORLD ; 67 68 int num_ep; 69 if(isClient) 70 { 71 num_ep = 1; 72 } 73 74 if(isServer) 75 { 76 num_ep = 1; 77 } 78 79 MPI_Info info; 80 MPI_Comm *ep_comm; 81 MPI_Comm_create_endpoints(MPI_COMM_WORLD, num_ep, info, ep_comm); 82 83 globalComm = ep_comm[0]; 84 85 int tmp_size; 86 MPI_Comm_size(globalComm, &tmp_size); 87 printf("globalcomm size = %d\n", tmp_size); 88 89 71 90 } 72 91 … … 79 98 void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm) 80 99 { 100 isClient = true; 101 81 102 initialize() ; 82 103 83 isClient = true; 84 104 85 105 CClient::initialize(codeId,localComm,returnComm) ; 86 106 if (CClient::getRank()==0) globalRegistry = new CRegistry(returnComm) ; … … 89 109 // and the clients are also servers 90 110 isServer = !usingServer; 91 111 112 92 113 if (printLogs2Files) 93 114 { … … 100 121 CClient::openErrorStream(); 101 122 } 123 124 102 125 } 103 126 … … 123 146 void CXios::initServer() 124 147 { 148 int initialized; 149 MPI_Initialized(&initialized); 150 if (initialized) CServer::is_MPI_Initialized=true ; 151 else CServer::is_MPI_Initialized=false ; 152 153 154 if(!CServer::is_MPI_Initialized) 155 { 156 MPI_Init(NULL, NULL); 157 } 158 125 159 set_new_handler(noMemory); 126 160 std::set<StdString> parseList; … … 133 167 void CXios::initServerSide(void) 134 168 { 135 initServer();169 136 170 isClient = false; 137 171 isServer = true; 138 172 173 initServer(); 174 175 139 176 // Initialize all aspects MPI 140 177 CServer::initialize(); 141 178 if (CServer::getRank()==0) globalRegistry = new CRegistry(CServer::intraComm) ; 142 179 180 143 181 if (printLogs2Files) 144 182 { … … 151 189 CServer::openErrorStream(); 152 190 } 153 191 154 192 // Enter the loop to listen message from Client 155 193 CServer::eventLoop(); 194 195 printf("server eventloop OK\n"); 156 196 157 197 // Finalize … … 162 202 delete globalRegistry ; 163 203 } 204 205 printf("server globalRegistry OK\n"); 206 164 207 CServer::finalize(); 208 209 printf("server finalize OK\n"); 210 165 211 CServer::closeInfoStream(); 166 212 } -
XIOS/dev/branch_yushan/src/cxios.hpp
r1029 r1037 5 5 #include "mpi.hpp" 6 6 #include "registry.hpp" 7 #ifdef _usingEP 8 //#include "ep_declaration.hpp" 9 #endif 10 7 11 8 12 namespace xios … … 45 49 static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible) 46 50 static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers 47 static double recvFieldTimeout; //!< Time to wait for data before issuing an error when receiving a field48 51 49 52 public: -
XIOS/dev/branch_yushan/src/declare_ref_func.hpp
r996 r1037 51 51 SuperClassAttribute::setAttributes(refer_ptr, apply); \ 52 52 } \ 53 if (this->hasAttribute("name") && this->name.isEmpty()) \54 this->name.setValue(this->get##type##OutputName()); \55 53 } \ 56 54 \ … … 104 102 tmp_ptr = refer_ptr; \ 105 103 refer_ptr = tmp_ptr->getDirect##type##Reference(); \ 106 if (refer_ptr->hasAutoGeneratedId() && \ 107 refer_ptr->hasDirect##type##Reference()) \ 104 if (refer_ptr->hasDirect##type##Reference()) \ 108 105 nameRef = refer_ptr->name_##_ref; \ 109 else { \110 nameRef = refer_ptr->getId(); break; \111 } \112 106 if (tmpRefObjects.end() != tmpRefObjects.find(refer_ptr)) \ 113 107 { \ -
XIOS/dev/branch_yushan/src/dht_auto_indexing.cpp
r1002 r1037 79 79 for (itIdx = itbIdx; itIdx != iteIdx; ++itIdx) 80 80 { 81 // (itIdx->second)[0] = beginIndexOnProc_ + idx; 82 (itIdx->second)[1] = beginIndexOnProc_ + idx; 81 (itIdx->second)[0] = beginIndexOnProc_ + idx; 83 82 globalIndex_[idx] = beginIndexOnProc_ + idx; 84 83 ++idx ; -
XIOS/dev/branch_yushan/src/dht_auto_indexing.hpp
r924 r1037 12 12 13 13 #include "client_client_dht_template.hpp" 14 #ifdef _usingEP 15 #include "ep_declaration.hpp" 16 #endif 14 17 15 18 namespace xios -
XIOS/dev/branch_yushan/src/event_scheduler.cpp
r591 r1037 2 2 #include "xios_spl.hpp" 3 3 #include "mpi.hpp" 4 4 5 5 6 namespace xios -
XIOS/dev/branch_yushan/src/event_scheduler.hpp
r591 r1037 4 4 #include "xios_spl.hpp" 5 5 #include "mpi.hpp" 6 #ifdef _usingEP 7 #include "ep_declaration.hpp" 8 #endif 9 6 10 7 11 namespace xios -
XIOS/dev/branch_yushan/src/filter/file_writer_filter.cpp
r1018 r1037 2 2 #include "exception.hpp" 3 3 #include "field.hpp" 4 #include "utils.hpp"5 4 6 5 namespace xios … … 17 16 void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 18 17 { 19 bool ignoreMissingValue = (!field->detect_missing_value.isEmpty() &&20 !field->default_value.isEmpty() &&21 field->detect_missing_value == true);22 if (ignoreMissingValue)23 {24 double missingValue = field->default_value;25 size_t nbData = data[0]->data.numElements();26 for (size_t idx = 0; idx < nbData; ++idx)27 {28 if (NumTraits<double>::isnan(data[0]->data(idx)))29 data[0]->data(idx) = missingValue;30 }31 }32 33 18 field->sendUpdateData(data[0]->data); 34 19 } -
XIOS/dev/branch_yushan/src/filter/filter.cpp
r1006 r1037 5 5 CFilter::CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine) 6 6 : CInputPin(gc, inputSlotsCount) 7 , COutputPin( gc)7 , COutputPin() 8 8 , engine(engine) 9 9 , inputSlotCount(inputSlotCount) … … 14 14 CDataPacketPtr outputPacket = engine->apply(data); 15 15 if (outputPacket) 16 onOutputReady(outputPacket); 17 } 18 19 void CFilter::setInputTrigger(size_t inputSlot, COutputPin* trigger) 20 { 21 // Was the filter already triggerable? If not, we need to inform 22 // all downstream filters. 23 bool wasTriggerable = canBeTriggered(); 24 25 CInputPin::setInputTrigger(inputSlot, trigger); 26 27 if (!wasTriggerable) 28 setOutputTriggers(); 29 } 30 31 void CFilter::trigger(Time timestamp) 32 { 33 CInputPin::trigger(timestamp); 34 35 COutputPin::trigger(timestamp); 36 } 37 38 bool CFilter::canBeTriggered() const 39 { 40 return (CInputPin::canBeTriggered() || COutputPin::canBeTriggered()); 16 deliverOuput(outputPacket); 41 17 } 42 18 } // namespace xios -
XIOS/dev/branch_yushan/src/filter/filter.hpp
r1006 r1037 26 26 CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine); 27 27 28 /*!29 * Sets the trigger for a specific input slot.30 *31 * \param inputSlot the input slot number32 * \param trigger the corresponding trigger33 */34 void virtual setInputTrigger(size_t inputSlot, COutputPin* trigger);35 36 /*!37 * Triggers the filter for the specified timestamp.38 *39 * \param timestamp the timestamp for which we are triggering the filter40 */41 void virtual trigger(Time timestamp);42 43 /*!44 * Tests if the filter can be triggered.45 *46 * \return true if the filter can be triggered47 */48 bool virtual canBeTriggered() const;49 50 28 protected: 51 29 IFilterEngine* engine; //!< The filter engine, might be the filter itself -
XIOS/dev/branch_yushan/src/filter/garbage_collector.cpp
r1006 r1037 3 3 namespace xios 4 4 { 5 void CGarbageCollector::register Object(InvalidableObject* Object, Time timestamp)5 void CGarbageCollector::registerFilter(CInputPin* inputPin, Time timestamp) 6 6 { 7 registered Objects[timestamp].insert(Object);7 registeredFilters[timestamp].insert(inputPin); 8 8 } 9 9 10 void CGarbageCollector::unregister Object(InvalidableObject* Object, Time timestamp)10 void CGarbageCollector::unregisterFilter(CInputPin* inputPin, Time timestamp) 11 11 { 12 std::map<Time, std::set< InvalidableObject*> >::iterator it = registeredObjects.find(timestamp);13 if (it != registered Objects.end())14 it->second.erase( Object);12 std::map<Time, std::set<CInputPin*> >::iterator it = registeredFilters.find(timestamp); 13 if (it != registeredFilters.end()) 14 it->second.erase(inputPin); 15 15 } 16 16 17 17 void CGarbageCollector::invalidate(Time timestamp) 18 18 { 19 std::map<Time, std::set< InvalidableObject*> >::iterator it = registeredObjects.begin(),20 itEnd = registeredObjects.lower_bound(timestamp);19 std::map<Time, std::set<CInputPin*> >::iterator it = registeredFilters.begin(), 20 itEnd = registeredFilters.lower_bound(timestamp); 21 21 for (; it != itEnd; ++it) 22 22 { 23 std::set< InvalidableObject*>::iterator itObject= it->second.begin(),24 itObjectEnd = it->second.end();25 for (; it Object != itObjectEnd; ++itObject)26 (*it Object)->invalidate(timestamp);23 std::set<CInputPin*>::iterator itFilter = it->second.begin(), 24 itFilterEnd = it->second.end(); 25 for (; itFilter != itFilterEnd; ++itFilter) 26 (*itFilter)->invalidate(timestamp); 27 27 } 28 registered Objects.erase(registeredObjects.begin(), itEnd);28 registeredFilters.erase(registeredFilters.begin(), itEnd); 29 29 } 30 30 } // namespace xios -
XIOS/dev/branch_yushan/src/filter/garbage_collector.hpp
r1006 r1037 5 5 #include <set> 6 6 7 #include " date.hpp"7 #include "input_pin.hpp" 8 8 9 9 namespace xios 10 10 { 11 /*!12 * Interface shared by all objects that might need to invalidate packets.13 */14 struct InvalidableObject15 {16 /*!17 * Removes all pending packets which are older than the specified timestamp.18 *19 * \param timestamp the timestamp used for invalidation20 */21 void virtual invalidate(Time timestamp) = 0;22 }; // struct InvalidableObject23 24 11 /*! 25 12 * A basic garbage collector which ensures no old packets linger in the filter graph. … … 35 22 36 23 /*! 37 * Registers a n objectfor a specified timestamp.24 * Registers a filter for a specified timestamp. 38 25 * 39 * \param object the objectto register40 * \param timestamp the timestamp for which the objectis registered26 * \param inputPin the input pin of the filter to register 27 * \param timestamp the timestamp for which the filter is registered 41 28 */ 42 void register Object(InvalidableObject* object, Time timestamp);29 void registerFilter(CInputPin* inputPin, Time timestamp); 43 30 44 31 /*! 45 * Removes a objectpreviously registered for a specified timestamp.32 * Removes a filter previously registered for a specified timestamp. 46 33 * 47 * \param object the objectto unregister48 * \param timestamp the timestamp for which the objectis unregistered34 * \param inputPin the input pin of the filter to unregister 35 * \param timestamp the timestamp for which the filter is unregistered 49 36 */ 50 void unregister Object(InvalidableObject* object, Time timestamp);37 void unregisterFilter(CInputPin* inputPin, Time timestamp); 51 38 52 39 /*! 53 * Ensures all registered objects invalidate packets older than the specified timestamp.40 * Ensures all registered filters invalidate packets older than the specified timestamp. 54 41 * 55 42 * \param timestamp the timestamp used for invalidation … … 61 48 CGarbageCollector& operator=(const CGarbageCollector&); 62 49 63 std::map<Time, std::set< InvalidableObject*> > registeredObjects; //!< Currently registered objects50 std::map<Time, std::set<CInputPin*> > registeredFilters; //!< Currently registered filters 64 51 }; // class CGarbageCollector 65 52 } // namespace xios -
XIOS/dev/branch_yushan/src/filter/input_pin.cpp
r1006 r1037 1 1 #include "input_pin.hpp" 2 #include "output_pin.hpp"3 2 #include "garbage_collector.hpp" 4 3 #include "exception.hpp" … … 9 8 : gc(gc) 10 9 , slotsCount(slotsCount) 11 , triggers(slotsCount)12 , hasTriggers(false)13 10 { /* Nothing to do */ } 14 11 … … 26 23 { 27 24 it = inputs.insert(std::make_pair(packet->timestamp, InputBuffer(slotsCount))).first; 28 gc.register Object(this, packet->timestamp);25 gc.registerFilter(this, packet->timestamp); 29 26 } 27 30 28 it->second.slotsFilled++; 31 29 it->second.packets[inputSlot] = packet; … … 34 32 { 35 33 // Unregister before calling onInputReady in case the filter registers again 36 gc.unregister Object(this, packet->timestamp);34 gc.unregisterFilter(this, packet->timestamp); 37 35 onInputReady(it->second.packets); 38 36 inputs.erase(it); 39 37 } 40 }41 42 void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger)43 {44 if (inputSlot >= slotsCount)45 ERROR("void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger)",46 "The input slot " << inputSlot << " does not exist.");47 if (triggers[inputSlot])48 ERROR("void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger)",49 "The trigger for input slot " << inputSlot << " has already been set.");50 51 triggers[inputSlot] = trigger;52 hasTriggers = true;53 }54 55 void CInputPin::trigger(Time timestamp)56 {57 if (hasTriggers) // Don't use canBeTriggered here, this function is virtual and can be overriden58 {59 std::map<Time, InputBuffer>::iterator it = inputs.find(timestamp);60 bool nothingReceived = (it == inputs.end());61 62 for (size_t s = 0; s < slotsCount; s++)63 {64 if (triggers[s] && (nothingReceived || !it->second.packets[s]))65 triggers[s]->trigger(timestamp);66 }67 }68 }69 70 bool CInputPin::canBeTriggered() const71 {72 return hasTriggers;73 38 } 74 39 -
XIOS/dev/branch_yushan/src/filter/input_pin.hpp
r1006 r1037 5 5 #include <map> 6 6 7 #include "garbage_collector.hpp"8 7 #include "data_packet.hpp" 9 8 10 9 namespace xios 11 10 { 12 class C OutputPin;11 class CGarbageCollector; 13 12 14 13 /*! 15 14 * An input pin handles the data packets received by a filter. 16 15 */ 17 class CInputPin : public InvalidableObject16 class CInputPin 18 17 { 19 18 public: … … 28 27 29 28 /*! 30 * Sets the trigger for a specific input slot.31 *32 * \param inputSlot the input slot number33 * \param trigger the corresponding trigger34 */35 void virtual setInputTrigger(size_t inputSlot, COutputPin* trigger);36 37 /*!38 29 * Receives a data packet from an upstream filter on 39 30 * the specified input slot. … … 46 37 47 38 /*! 48 * Triggers the input of any buffered packet for the specified timestamp.49 *50 * \param timestamp the timestamp for which we are triggering the input51 */52 void virtual trigger(Time timestamp);53 54 /*!55 * Tests if the pin can be triggered.56 *57 * \return true if the pin can be triggered58 */59 bool virtual canBeTriggered() const;60 61 /*!62 39 * Removes all pending packets which are older than the specified timestamp. 63 40 * … … 67 44 68 45 protected: 46 CGarbageCollector& gc; //!< The garbage collector associated to the input pin 47 69 48 /*! 70 49 * Function triggered when all slots have been filled for a specific timestamp. … … 96 75 }; 97 76 98 CGarbageCollector& gc; //!< The garbage collector associated to the input pin99 100 77 size_t slotsCount; //!< The number of slots 101 78 102 79 //! Input buffer, store the packets until all slots are full for a timestep 103 80 std::map<Time, InputBuffer> inputs; 104 105 //! Store the triggers corresponding to the input slots106 std::vector<COutputPin*> triggers;107 108 //! Whether some triggers have been set109 bool hasTriggers;110 81 }; // class CInputPin 111 82 } // namespace xios -
XIOS/dev/branch_yushan/src/filter/output_pin.cpp
r1006 r1037 4 4 namespace xios 5 5 { 6 COutputPin::COutputPin(CGarbageCollector& gc, bool manualTrigger /*= false*/)7 : gc(gc)8 , manualTrigger(manualTrigger)9 { /* Nothing to do */ }10 11 6 void COutputPin::connectOutput(boost::shared_ptr<CInputPin> inputPin, size_t inputSlot) 12 7 { … … 16 11 17 12 outputs.push_back(std::make_pair(inputPin, inputSlot)); 18 19 if (canBeTriggered())20 inputPin->setInputTrigger(inputSlot, this);21 }22 23 void COutputPin::onOutputReady(CDataPacketPtr packet)24 {25 if (!packet)26 ERROR("void COutputPin::onOutputReady(CDataPacketPtr packet)",27 "The packet cannot be null.");28 29 if (manualTrigger) // Don't use canBeTriggered here, this function is virtual and can be overriden30 {31 outputPackets[packet->timestamp] = packet;32 gc.registerObject(this, packet->timestamp);33 }34 else35 deliverOuput(packet);36 13 } 37 14 … … 44 21 std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd; 45 22 for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it) 23 { 46 24 it->first->setInput(it->second, packet); 47 }48 49 void COutputPin::trigger(Time timestamp)50 {51 if (manualTrigger) // Don't use canBeTriggered here, this function is virtual and can be overriden52 {53 std::map<Time, CDataPacketPtr>::iterator it = outputPackets.find(timestamp);54 if (it != outputPackets.end())55 {56 gc.unregisterObject(this, timestamp);57 deliverOuput(it->second);58 outputPackets.erase(it);59 }60 25 } 61 26 } 62 63 bool COutputPin::canBeTriggered() const64 {65 return manualTrigger;66 }67 68 void COutputPin::setOutputTriggers()69 {70 std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd;71 for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it)72 it->first->setInputTrigger(it->second, this);73 }74 75 void COutputPin::invalidate(Time timestamp)76 {77 outputPackets.erase(outputPackets.begin(), outputPackets.lower_bound(timestamp));78 }79 27 } // namespace xios -
XIOS/dev/branch_yushan/src/filter/output_pin.hpp
r1006 r1037 2 2 #define __XIOS_COutputPin__ 3 3 4 #include "garbage_collector.hpp"5 4 #include "input_pin.hpp" 6 5 … … 10 9 * An output pin handles the connections with downstream filters. 11 10 */ 12 class COutputPin : public InvalidableObject11 class COutputPin 13 12 { 14 13 public: 15 /*!16 * Constructs an ouput pin with manual or automatic trigger17 * and an associated garbage collector.18 *19 * \param gc the garbage collector associated with this ouput pin20 * \param slotsCount the number of slots21 */22 COutputPin(CGarbageCollector& gc, bool manualTrigger = false);23 24 14 /*! 25 15 * Connects to a specific slot of the input pin of a downstream filter. … … 31 21 void connectOutput(boost::shared_ptr<CInputPin> inputPin, size_t inputSlot); 32 22 33 /*!34 * Triggers the output of any buffered packet for the specified timestamp.35 *36 * \param timestamp the timestamp for which we are triggering the output37 */38 void virtual trigger(Time timestamp);39 40 /*!41 * Tests if the pin can be triggered.42 *43 * \return true if the pin can be triggered44 */45 bool virtual canBeTriggered() const;46 47 /*!48 * Removes all pending packets which are older than the specified timestamp.49 *50 * \param timestamp the timestamp used for invalidation51 */52 void virtual invalidate(Time timestamp);53 54 23 protected: 55 /*!56 * Function triggered when a packet is ready to be delivered.57 *58 * \param packet the packet ready for output59 */60 void onOutputReady(CDataPacketPtr packet);61 62 /*!63 * Informs the downstream pins that this output pin should be triggered.64 */65 void setOutputTriggers();66 67 private:68 24 /*! 69 25 * Delivers an output packet to the downstreams filter. … … 73 29 void deliverOuput(CDataPacketPtr packet); 74 30 75 CGarbageCollector& gc; //!< The garbage collector associated to the output pin 76 77 //!< Whether the ouput should be triggered manually 78 bool manualTrigger; 79 31 private: 80 32 //!< The list of connected filters and the corresponding slot numbers 81 33 std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> > outputs; 82 83 //! Output buffer, store the packets until the output is triggered84 std::map<Time, CDataPacketPtr> outputPackets;85 34 }; // class COutputPin 86 35 } // namespace xios -
XIOS/dev/branch_yushan/src/filter/source_filter.cpp
r1018 r1037 3 3 #include "exception.hpp" 4 4 #include "calendar_util.hpp" 5 #include <limits>6 5 7 6 namespace xios 8 7 { 9 CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, 10 const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/, 11 bool hasMissingValue /*= false*/, 12 double defaultValue /*= 0.0*/) 13 : COutputPin(gc, manualTrigger) 14 , grid(grid) 8 CSourceFilter::CSourceFilter(CGrid* grid, const CDuration offset /*= NoneDu*/) 9 : grid(grid) 15 10 , offset(offset) 16 , hasMissingValue(hasMissingValue), defaultValue(defaultValue)17 11 { 18 12 if (!grid) … … 32 26 33 27 packet->data.resize(grid->storeIndex_client.numElements()); 28 34 29 grid->inputField(data, packet->data); 35 30 36 // Convert missing values to NaN 37 if (hasMissingValue) 38 { 39 double nanValue = std::numeric_limits<double>::quiet_NaN(); 40 size_t nbData = packet->data.numElements(); 41 for (size_t idx = 0; idx < nbData; ++idx) 42 { 43 if (defaultValue == packet->data(idx)) 44 packet->data(idx) = nanValue; 45 } 46 } 47 48 onOutputReady(packet); 31 deliverOuput(packet); 49 32 } 50 33 … … 66 49 packet->status = CDataPacket::NO_ERROR; 67 50 68 // if (data.size() != grid->storeIndex_toSrv.size()) 69 if (data.size() != grid->storeIndex_fromSrv.size()) 51 if (data.size() != grid->storeIndex_toSrv.size()) 70 52 ERROR("CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data)", 71 53 << "Incoherent data received from servers," 72 << " expected " << grid->storeIndex_ fromSrv.size() << " chunks but " << data.size() << " were given.");54 << " expected " << grid->storeIndex_toSrv.size() << " chunks but " << data.size() << " were given."); 73 55 74 56 packet->data.resize(grid->storeIndex_client.numElements()); … … 76 58 for (it = data.begin(); it != itEnd; it++) 77 59 { 78 //CArray<int,1>& index = grid->storeIndex_toSrv[it->first];79 CArray<int,1>& index = grid->storeIndex_fromSrv[it->first]; 60 CArray<int,1>& index = grid->storeIndex_toSrv[it->first]; 61 80 62 for (int n = 0; n < index.numElements(); n++) 81 63 packet->data(index(n)) = it->second(n); 82 64 } 83 65 84 onOutputReady(packet);66 deliverOuput(packet); 85 67 } 86 68 … … 91 73 packet->timestamp = date; 92 74 packet->status = CDataPacket::END_OF_STREAM; 93 onOutputReady(packet);75 deliverOuput(packet); 94 76 } 95 77 } // namespace xios -
XIOS/dev/branch_yushan/src/filter/source_filter.hpp
r1018 r1037 19 19 * Constructs a source filter accepting data attached to the specified grid. 20 20 * 21 * \param gc the garbage collector associated with this filter22 21 * \param grid the grid to which the data is attached 23 22 * \param offset the offset applied to the timestamp of all packets 24 * \param manualTrigger whether the output should be triggered manually25 * \param hasMissingValue whether data has missing value26 * \param defaultValue missing value to detect27 23 */ 28 CSourceFilter(CGarbageCollector& gc, CGrid* grid, 29 const CDuration offset = NoneDu, bool manualTrigger = false, 30 bool hasMissingValue = false, 31 double defaultValue = 0.0); 24 CSourceFilter(CGrid* grid, const CDuration offset = NoneDu); 32 25 33 26 /*! … … 62 55 CGrid* grid; //!< The grid attached to the data the filter can accept 63 56 const CDuration offset; //!< The offset applied to the timestamp of all packets 64 bool hasMissingValue;65 double defaultValue;66 57 }; // class CSourceFilter 67 58 } // namespace xios -
XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.cpp
r1018 r1037 11 11 12 12 std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> > 13 CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue)13 CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue) 14 14 { 15 15 if (!srcGrid || !destGrid) … … 26 26 const std::vector<StdString>& auxInputs = gridTransformation->getAuxInputs(); 27 27 size_t inputCount = 1 + (auxInputs.empty() ? 0 : auxInputs.size()); 28 double defaultValue = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : missingValue;29 28 boost::shared_ptr<CSpatialTransformFilter> filter(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount)); 30 29 … … 54 53 CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue); 55 54 if (outputPacket) 56 onOutputReady(outputPacket);55 deliverOuput(outputPacket); 57 56 } 58 57 … … 104 103 } 105 104 packet->data.resize(gridTransformation->getGridDestination()->storeIndex_client.numElements()); 106 if (0 != packet->data.numElements()) 107 (packet->data)(0) = defaultValue; 105 packet->data = defaultValue; 108 106 apply(data[0]->data, packet->data); 109 107 } … … 220 218 if (dataCurrentDest.numElements() != dataDest.numElements()) 221 219 ERROR("CSpatialTransformFilterEngine::apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest)", 222 "Incoherent between the received size and expected size . " << std::endl223 << "Expected size: " << dataDest.numElements() << std::endl224 <<"Received size: " << dataCurrentDest.numElements());220 "Incoherent between the received size and expected size" << 221 "Expected size: " << dataDest.numElements() << 222 "Received size: " << dataCurrentDest.numElements()); 225 223 226 224 dataDest = dataCurrentDest; -
XIOS/dev/branch_yushan/src/filter/spatial_transform_filter.hpp
r1018 r1037 32 32 * \param srcGrid the source grid 33 33 * \param destGrid the destination grid 34 * \param hasMissingValue whether field source has missing value35 * \param defaultValue default value36 34 * \return the first and the last filters of the filter graph 37 35 */ 38 36 static std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> > 39 buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue,double defaultValue);37 buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue); 40 38 41 39 protected: -
XIOS/dev/branch_yushan/src/filter/store_filter.cpp
r1029 r1037 8 8 CStoreFilter::CStoreFilter(CGarbageCollector& gc, CContext* context, CGrid* grid) 9 9 : CInputPin(gc, 1) 10 , gc(gc)11 10 , context(context) 12 11 , grid(grid) … … 24 23 CTimer timer("CStoreFilter::getPacket"); 25 24 CConstDataPacketPtr packet; 26 const double timeout = CXios::recvFieldTimeout;25 const double timeout = 10; // 10 seconds timeout 27 26 28 27 do 29 28 { 30 if (canBeTriggered())31 trigger(timestamp);32 33 29 timer.resume(); 34 30 … … 43 39 44 40 if (!packet) 45 {46 std::map<Time, CDataPacketPtr>::const_iterator it ;47 info(0)<<"Impossible to get the packet with timestamp = " << timestamp<<std::endl<<"Available timestamp are : "<<std::endl ;48 for(it=packets.begin();it!=packets.end();++it) info(0)<<it->first<<" ";49 info(0)<<std::endl ;50 41 ERROR("CConstDataPacketPtr CStoreFilter::getPacket(Time timestamp) const", 51 42 << "Impossible to get the packet with timestamp = " << timestamp); 52 } 43 53 44 return packet; 54 45 } … … 78 69 // The packet is always destroyed by the garbage collector 79 70 // so we register but never unregister 80 gc.register Object(this, data[0]->timestamp);71 gc.registerFilter(this, data[0]->timestamp); 81 72 } 82 73 -
XIOS/dev/branch_yushan/src/filter/store_filter.hpp
r1006 r1037 65 65 66 66 private: 67 CGarbageCollector& gc; //!< The garbage collector associated to the filter68 67 CContext* context; //!< The context to which the data belongs 69 68 CGrid* grid; //!< The grid attached to the data the filter can accept -
XIOS/dev/branch_yushan/src/filter/temporal_filter.cpp
r1018 r1037 15 15 , isFirstOperation(true) 16 16 { 17 double defaultValue = ignoreMissingValue ? std::numeric_limits<double>::quiet_NaN() : missingValue;18 19 17 #define DECLARE_FUNCTOR(MType, mtype) \ 20 18 if (opId.compare(#mtype) == 0) \ … … 22 20 if (ignoreMissingValue) \ 23 21 { \ 24 functor.reset(new func::C##MType(tmpData, defaultValue)); \22 functor.reset(new func::C##MType(tmpData, missingValue)); \ 25 23 } \ 26 24 else \ -
XIOS/dev/branch_yushan/src/functor/accumulate.cpp
r1018 r1037 1 1 #include "accumulate.hpp" 2 2 #include "array_new.hpp" 3 #include "utils.hpp"4 3 5 4 namespace xios … … 34 33 double* out=_doutput.dataFirst(); 35 34 for (i=0; i<n; ++i,++in,++out) 36 if ( !NumTraits<double>::isnan(*in))35 if (*in!=missingValue) 37 36 { 38 if( !NumTraits<double>::isnan(*out)) *out += *in;37 if(*out!=missingValue) *out += *in; 39 38 else *out=*in ; 40 39 } -
XIOS/dev/branch_yushan/src/functor/average.cpp
r1018 r1037 1 1 #include "average.hpp" 2 2 #include "array_new.hpp" 3 #include "utils.hpp"4 3 5 4 namespace xios … … 43 42 int* nc=nbcalls.dataFirst() ; 44 43 for (i=0; i<n; ++i,++nc,++in) 45 if ( !NumTraits<double>::isnan(*in)) (*nc) ++;44 if (*in!=missingValue) (*nc) ++; 46 45 } 47 46 } … … 55 54 int* nc=nbcalls.dataFirst() ; 56 55 for (i=0; i<n; ++i,++in,++out,++nc) 57 if ( !NumTraits<double>::isnan(*in))56 if (*in!=missingValue) 58 57 { 59 58 if (*nc != 0) (*out) += *in; -
XIOS/dev/branch_yushan/src/functor/maximum.cpp
r1018 r1037 1 1 #include "maximum.hpp" 2 2 #include "array_new.hpp" 3 #include "utils.hpp" 3 4 4 5 5 6 namespace xios … … 34 35 { 35 36 for (; it1 != end1; it1++, it++) 36 if ( !NumTraits<double>::isnan(*it1))37 if (*it1 != missingValue) 37 38 { 38 if ( !NumTraits<double>::isnan(*it)) *it = std::max(*it1, *it);39 if ( *it != missingValue) *it = std::max(*it1, *it); 39 40 else *it=*it1 ; 40 41 } -
XIOS/dev/branch_yushan/src/functor/minimum.cpp
r1018 r1037 2 2 #include "array_new.hpp" 3 3 #include <algorithm> 4 #include "utils.hpp"5 4 6 5 namespace xios … … 27 26 { 28 27 const double * it1 = _dinput.dataFirst(), 29 * end1 = _dinput.dataFirst() + _dinput.numElements();28 * end1 = _dinput.dataFirst() + _dinput.numElements(); 30 29 double * it = _doutput.dataFirst(); 31 30 … … 36 35 { 37 36 for (; it1 != end1; it1++, it++) 38 if ( !NumTraits<double>::isnan(*it1))37 if (*it1!=missingValue) 39 38 { 40 if ( !NumTraits<double>::isnan(*it)) *it = std::min(*it1, *it);39 if (*it != missingValue) *it = std::min(*it1, *it); 41 40 else *it=*it1 ; 42 41 } -
XIOS/dev/branch_yushan/src/interface/c/icdata.cpp
r961 r1037 11 11 12 12 #include "xios.hpp" 13 #include "oasis_cinterface.hpp"13 //#include "oasis_cinterface.hpp" 14 14 15 15 #include "attribute_template.hpp" … … 27 27 #include "array_new.hpp" 28 28 29 30 29 extern "C" 31 30 { … … 57 56 MPI_Comm local_comm; 58 57 MPI_Comm return_comm; 58 59 fc_comm_map.clear(); 59 60 60 61 if (!cstr2string(client_id, len_client_id, str)) return; … … 63 64 MPI_Initialized(&initialized); 64 65 if (initialized) local_comm=MPI_Comm_f2c(*f_local_comm); 65 else local_comm=MPI_COMM_NULL; 66 else local_comm = MPI_COMM_NULL; 67 68 69 66 70 CXios::initClientSide(str, local_comm, return_comm); 67 *f_return_comm=MPI_Comm_c2f(return_comm); 71 *f_return_comm = MPI_Comm_c2f(return_comm); 72 73 printf("in icdata.cpp, f_return_comm = %d\n", *f_return_comm); 74 68 75 CTimer::get("XIOS init").suspend(); 69 76 CTimer::get("XIOS").suspend(); … … 79 86 CTimer::get("XIOS init context").resume(); 80 87 comm=MPI_Comm_f2c(*f_comm); 88 81 89 CClient::registerContext(str, comm); 90 91 //printf("client register context OK\n"); 92 82 93 CTimer::get("XIOS init context").suspend(); 83 94 CTimer::get("XIOS").suspend(); … … 100 111 CTimer::get("XIOS close definition").resume(); 101 112 CContext* context = CContext::getCurrent(); 113 102 114 context->closeDefinition(); 115 103 116 CTimer::get("XIOS close definition").suspend(); 104 117 CTimer::get("XIOS").suspend(); … … 109 122 CTimer::get("XIOS").resume(); 110 123 CTimer::get("XIOS context finalize").resume(); 124 125 126 111 127 CContext* context = CContext::getCurrent(); 128 //printf("CContext* context = CContext::getCurrent();\n"); 112 129 context->finalize(); 130 131 //printf("client context_finalize OK\n"); 132 113 133 CTimer::get("XIOS context finalize").suspend(); 114 134 CTimer::get("XIOS").suspend(); … … 429 449 CContext* context = CContext::getCurrent(); 430 450 if (!context->hasServer && !context->client->isAttachedModeEnabled()) 431 context->checkBuffersAndListen(); 451 { 452 context->checkBuffersAndListen(); 453 } 432 454 433 455 CArray<double, 3>data(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData); -
XIOS/dev/branch_yushan/src/interface/c/oasis_cinterface.cpp
r501 r1037 1 1 #include "oasis_cinterface.hpp" 2 2 #include <string> 3 #include "mpi.hpp"3 //#include "mpi_std.hpp" 4 4 5 5 namespace xios -
XIOS/dev/branch_yushan/src/interface/c_attr/icfield_attr.cpp
r1005 r1037 67 67 68 68 69 void cxios_set_field_cell_methods(field_Ptr field_hdl, const char * cell_methods, int cell_methods_size)70 {71 std::string cell_methods_str;72 if (!cstr2string(cell_methods, cell_methods_size, cell_methods_str)) return;73 CTimer::get("XIOS").resume();74 field_hdl->cell_methods.setValue(cell_methods_str);75 CTimer::get("XIOS").suspend();76 }77 78 void cxios_get_field_cell_methods(field_Ptr field_hdl, char * cell_methods, int cell_methods_size)79 {80 CTimer::get("XIOS").resume();81 if (!string_copy(field_hdl->cell_methods.getInheritedValue(), cell_methods, cell_methods_size))82 ERROR("void cxios_get_field_cell_methods(field_Ptr field_hdl, char * cell_methods, int cell_methods_size)", << "Input string is too short");83 CTimer::get("XIOS").suspend();84 }85 86 bool cxios_is_defined_field_cell_methods(field_Ptr field_hdl)87 {88 CTimer::get("XIOS").resume();89 bool isDefined = field_hdl->cell_methods.hasInheritedValue();90 CTimer::get("XIOS").suspend();91 return isDefined;92 }93 94 95 void cxios_set_field_cell_methods_mode(field_Ptr field_hdl, const char * cell_methods_mode, int cell_methods_mode_size)96 {97 std::string cell_methods_mode_str;98 if (!cstr2string(cell_methods_mode, cell_methods_mode_size, cell_methods_mode_str)) return;99 CTimer::get("XIOS").resume();100 field_hdl->cell_methods_mode.fromString(cell_methods_mode_str);101 CTimer::get("XIOS").suspend();102 }103 104 void cxios_get_field_cell_methods_mode(field_Ptr field_hdl, char * cell_methods_mode, int cell_methods_mode_size)105 {106 CTimer::get("XIOS").resume();107 if (!string_copy(field_hdl->cell_methods_mode.getInheritedStringValue(), cell_methods_mode, cell_methods_mode_size))108 ERROR("void cxios_get_field_cell_methods_mode(field_Ptr field_hdl, char * cell_methods_mode, int cell_methods_mode_size)", << "Input string is too short");109 CTimer::get("XIOS").suspend();110 }111 112 bool cxios_is_defined_field_cell_methods_mode(field_Ptr field_hdl)113 {114 CTimer::get("XIOS").resume();115 bool isDefined = field_hdl->cell_methods_mode.hasInheritedValue();116 CTimer::get("XIOS").suspend();117 return isDefined;118 }119 120 121 69 void cxios_set_field_compression_level(field_Ptr field_hdl, int compression_level) 122 70 { … … 232 180 CTimer::get("XIOS").resume(); 233 181 bool isDefined = field_hdl->enabled.hasInheritedValue(); 234 CTimer::get("XIOS").suspend();235 return isDefined;236 }237 238 239 void cxios_set_field_expr(field_Ptr field_hdl, const char * expr, int expr_size)240 {241 std::string expr_str;242 if (!cstr2string(expr, expr_size, expr_str)) return;243 CTimer::get("XIOS").resume();244 field_hdl->expr.setValue(expr_str);245 CTimer::get("XIOS").suspend();246 }247 248 void cxios_get_field_expr(field_Ptr field_hdl, char * expr, int expr_size)249 {250 CTimer::get("XIOS").resume();251 if (!string_copy(field_hdl->expr.getInheritedValue(), expr, expr_size))252 ERROR("void cxios_get_field_expr(field_Ptr field_hdl, char * expr, int expr_size)", << "Input string is too short");253 CTimer::get("XIOS").suspend();254 }255 256 bool cxios_is_defined_field_expr(field_Ptr field_hdl)257 {258 CTimer::get("XIOS").resume();259 bool isDefined = field_hdl->expr.hasInheritedValue();260 182 CTimer::get("XIOS").suspend(); 261 183 return isDefined; -
XIOS/dev/branch_yushan/src/interface/c_attr/icfieldgroup_attr.cpp
r1005 r1037 67 67 68 68 69 void cxios_set_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, const char * cell_methods, int cell_methods_size)70 {71 std::string cell_methods_str;72 if (!cstr2string(cell_methods, cell_methods_size, cell_methods_str)) return;73 CTimer::get("XIOS").resume();74 fieldgroup_hdl->cell_methods.setValue(cell_methods_str);75 CTimer::get("XIOS").suspend();76 }77 78 void cxios_get_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods, int cell_methods_size)79 {80 CTimer::get("XIOS").resume();81 if (!string_copy(fieldgroup_hdl->cell_methods.getInheritedValue(), cell_methods, cell_methods_size))82 ERROR("void cxios_get_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods, int cell_methods_size)", << "Input string is too short");83 CTimer::get("XIOS").suspend();84 }85 86 bool cxios_is_defined_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl)87 {88 CTimer::get("XIOS").resume();89 bool isDefined = fieldgroup_hdl->cell_methods.hasInheritedValue();90 CTimer::get("XIOS").suspend();91 return isDefined;92 }93 94 95 void cxios_set_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl, const char * cell_methods_mode, int cell_methods_mode_size)96 {97 std::string cell_methods_mode_str;98 if (!cstr2string(cell_methods_mode, cell_methods_mode_size, cell_methods_mode_str)) return;99 CTimer::get("XIOS").resume();100 fieldgroup_hdl->cell_methods_mode.fromString(cell_methods_mode_str);101 CTimer::get("XIOS").suspend();102 }103 104 void cxios_get_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods_mode, int cell_methods_mode_size)105 {106 CTimer::get("XIOS").resume();107 if (!string_copy(fieldgroup_hdl->cell_methods_mode.getInheritedStringValue(), cell_methods_mode, cell_methods_mode_size))108 ERROR("void cxios_get_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods_mode, int cell_methods_mode_size)", << "Input string is too short");109 CTimer::get("XIOS").suspend();110 }111 112 bool cxios_is_defined_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl)113 {114 CTimer::get("XIOS").resume();115 bool isDefined = fieldgroup_hdl->cell_methods_mode.hasInheritedValue();116 CTimer::get("XIOS").suspend();117 return isDefined;118 }119 120 121 69 void cxios_set_fieldgroup_compression_level(fieldgroup_Ptr fieldgroup_hdl, int compression_level) 122 70 { … … 232 180 CTimer::get("XIOS").resume(); 233 181 bool isDefined = fieldgroup_hdl->enabled.hasInheritedValue(); 234 CTimer::get("XIOS").suspend();235 return isDefined;236 }237 238 239 void cxios_set_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, const char * expr, int expr_size)240 {241 std::string expr_str;242 if (!cstr2string(expr, expr_size, expr_str)) return;243 CTimer::get("XIOS").resume();244 fieldgroup_hdl->expr.setValue(expr_str);245 CTimer::get("XIOS").suspend();246 }247 248 void cxios_get_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, char * expr, int expr_size)249 {250 CTimer::get("XIOS").resume();251 if (!string_copy(fieldgroup_hdl->expr.getInheritedValue(), expr, expr_size))252 ERROR("void cxios_get_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, char * expr, int expr_size)", << "Input string is too short");253 CTimer::get("XIOS").suspend();254 }255 256 bool cxios_is_defined_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl)257 {258 CTimer::get("XIOS").resume();259 bool isDefined = fieldgroup_hdl->expr.hasInheritedValue();260 182 CTimer::get("XIOS").suspend(); 261 183 return isDefined; -
XIOS/dev/branch_yushan/src/interface/c_attr/icinterpolate_domain_attr.cpp
r1014 r1037 18 18 typedef xios::CInterpolateDomain* interpolate_domain_Ptr; 19 19 20 void cxios_set_interpolate_domain_ mode(interpolate_domain_Ptr interpolate_domain_hdl, const char * mode, int mode_size)20 void cxios_set_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, const char * file, int file_size) 21 21 { 22 std::string mode_str;23 if (!cstr2string( mode, mode_size, mode_str)) return;22 std::string file_str; 23 if (!cstr2string(file, file_size, file_str)) return; 24 24 CTimer::get("XIOS").resume(); 25 interpolate_domain_hdl-> mode.fromString(mode_str);25 interpolate_domain_hdl->file.setValue(file_str); 26 26 CTimer::get("XIOS").suspend(); 27 27 } 28 28 29 void cxios_get_interpolate_domain_ mode(interpolate_domain_Ptr interpolate_domain_hdl, char * mode, int mode_size)29 void cxios_get_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, char * file, int file_size) 30 30 { 31 31 CTimer::get("XIOS").resume(); 32 if (!string_copy(interpolate_domain_hdl-> mode.getInheritedStringValue(), mode, mode_size))33 ERROR("void cxios_get_interpolate_domain_ mode(interpolate_domain_Ptr interpolate_domain_hdl, char * mode, int mode_size)", << "Input string is too short");32 if (!string_copy(interpolate_domain_hdl->file.getInheritedValue(), file, file_size)) 33 ERROR("void cxios_get_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, char * file, int file_size)", << "Input string is too short"); 34 34 CTimer::get("XIOS").suspend(); 35 35 } 36 36 37 bool cxios_is_defined_interpolate_domain_ mode(interpolate_domain_Ptr interpolate_domain_hdl)37 bool cxios_is_defined_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl) 38 38 { 39 39 CTimer::get("XIOS").resume(); 40 bool isDefined = interpolate_domain_hdl-> mode.hasInheritedValue();40 bool isDefined = interpolate_domain_hdl->file.hasInheritedValue(); 41 41 CTimer::get("XIOS").suspend(); 42 42 return isDefined; … … 88 88 return isDefined; 89 89 } 90 91 92 void cxios_set_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl, const char * weight_filename, int weight_filename_size)93 {94 std::string weight_filename_str;95 if (!cstr2string(weight_filename, weight_filename_size, weight_filename_str)) return;96 CTimer::get("XIOS").resume();97 interpolate_domain_hdl->weight_filename.setValue(weight_filename_str);98 CTimer::get("XIOS").suspend();99 }100 101 void cxios_get_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl, char * weight_filename, int weight_filename_size)102 {103 CTimer::get("XIOS").resume();104 if (!string_copy(interpolate_domain_hdl->weight_filename.getInheritedValue(), weight_filename, weight_filename_size))105 ERROR("void cxios_get_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl, char * weight_filename, int weight_filename_size)", << "Input string is too short");106 CTimer::get("XIOS").suspend();107 }108 109 bool cxios_is_defined_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl)110 {111 CTimer::get("XIOS").resume();112 bool isDefined = interpolate_domain_hdl->weight_filename.hasInheritedValue();113 CTimer::get("XIOS").suspend();114 return isDefined;115 }116 117 118 void cxios_set_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl, bool write_weight)119 {120 CTimer::get("XIOS").resume();121 interpolate_domain_hdl->write_weight.setValue(write_weight);122 CTimer::get("XIOS").suspend();123 }124 125 void cxios_get_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl, bool* write_weight)126 {127 CTimer::get("XIOS").resume();128 *write_weight = interpolate_domain_hdl->write_weight.getInheritedValue();129 CTimer::get("XIOS").suspend();130 }131 132 bool cxios_is_defined_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl)133 {134 CTimer::get("XIOS").resume();135 bool isDefined = interpolate_domain_hdl->write_weight.hasInheritedValue();136 CTimer::get("XIOS").suspend();137 return isDefined;138 }139 90 } -
XIOS/dev/branch_yushan/src/interface/fortran/idata.F90
r965 r1037 465 465 INTEGER :: f_return_comm 466 466 467 467 468 IF (PRESENT(local_comm)) THEN 468 469 f_local_comm=local_comm … … 472 473 473 474 CALL cxios_init_client(client_id,LEN(client_id),f_local_comm,f_return_comm) 475 476 477 !print*, "in fortran, world_f = ", MPI_COMM_WORLD 478 print*, "in fortran, f_return_comm = ", f_return_comm 474 479 475 480 IF (PRESENT(return_comm)) return_comm=f_return_comm -
XIOS/dev/branch_yushan/src/interface/fortran_attr/field_interface_attr.F90
r1005 r1037 50 50 51 51 52 SUBROUTINE cxios_set_field_cell_methods(field_hdl, cell_methods, cell_methods_size) BIND(C)53 USE ISO_C_BINDING54 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl55 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: cell_methods56 INTEGER (kind = C_INT) , VALUE :: cell_methods_size57 END SUBROUTINE cxios_set_field_cell_methods58 59 SUBROUTINE cxios_get_field_cell_methods(field_hdl, cell_methods, cell_methods_size) BIND(C)60 USE ISO_C_BINDING61 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl62 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: cell_methods63 INTEGER (kind = C_INT) , VALUE :: cell_methods_size64 END SUBROUTINE cxios_get_field_cell_methods65 66 FUNCTION cxios_is_defined_field_cell_methods(field_hdl) BIND(C)67 USE ISO_C_BINDING68 LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_cell_methods69 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl70 END FUNCTION cxios_is_defined_field_cell_methods71 72 73 SUBROUTINE cxios_set_field_cell_methods_mode(field_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)74 USE ISO_C_BINDING75 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl76 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: cell_methods_mode77 INTEGER (kind = C_INT) , VALUE :: cell_methods_mode_size78 END SUBROUTINE cxios_set_field_cell_methods_mode79 80 SUBROUTINE cxios_get_field_cell_methods_mode(field_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)81 USE ISO_C_BINDING82 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl83 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: cell_methods_mode84 INTEGER (kind = C_INT) , VALUE :: cell_methods_mode_size85 END SUBROUTINE cxios_get_field_cell_methods_mode86 87 FUNCTION cxios_is_defined_field_cell_methods_mode(field_hdl) BIND(C)88 USE ISO_C_BINDING89 LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_cell_methods_mode90 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl91 END FUNCTION cxios_is_defined_field_cell_methods_mode92 93 94 52 SUBROUTINE cxios_set_field_compression_level(field_hdl, compression_level) BIND(C) 95 53 USE ISO_C_BINDING … … 189 147 190 148 191 SUBROUTINE cxios_set_field_expr(field_hdl, expr, expr_size) BIND(C)192 USE ISO_C_BINDING193 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl194 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: expr195 INTEGER (kind = C_INT) , VALUE :: expr_size196 END SUBROUTINE cxios_set_field_expr197 198 SUBROUTINE cxios_get_field_expr(field_hdl, expr, expr_size) BIND(C)199 USE ISO_C_BINDING200 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl201 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: expr202 INTEGER (kind = C_INT) , VALUE :: expr_size203 END SUBROUTINE cxios_get_field_expr204 205 FUNCTION cxios_is_defined_field_expr(field_hdl) BIND(C)206 USE ISO_C_BINDING207 LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_expr208 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl209 END FUNCTION cxios_is_defined_field_expr210 211 212 149 SUBROUTINE cxios_set_field_field_ref(field_hdl, field_ref, field_ref_size) BIND(C) 213 150 USE ISO_C_BINDING -
XIOS/dev/branch_yushan/src/interface/fortran_attr/fieldgroup_interface_attr.F90
r1005 r1037 50 50 51 51 52 SUBROUTINE cxios_set_fieldgroup_cell_methods(fieldgroup_hdl, cell_methods, cell_methods_size) BIND(C)53 USE ISO_C_BINDING54 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl55 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: cell_methods56 INTEGER (kind = C_INT) , VALUE :: cell_methods_size57 END SUBROUTINE cxios_set_fieldgroup_cell_methods58 59 SUBROUTINE cxios_get_fieldgroup_cell_methods(fieldgroup_hdl, cell_methods, cell_methods_size) BIND(C)60 USE ISO_C_BINDING61 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl62 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: cell_methods63 INTEGER (kind = C_INT) , VALUE :: cell_methods_size64 END SUBROUTINE cxios_get_fieldgroup_cell_methods65 66 FUNCTION cxios_is_defined_fieldgroup_cell_methods(fieldgroup_hdl) BIND(C)67 USE ISO_C_BINDING68 LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_cell_methods69 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl70 END FUNCTION cxios_is_defined_fieldgroup_cell_methods71 72 73 SUBROUTINE cxios_set_fieldgroup_cell_methods_mode(fieldgroup_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)74 USE ISO_C_BINDING75 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl76 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: cell_methods_mode77 INTEGER (kind = C_INT) , VALUE :: cell_methods_mode_size78 END SUBROUTINE cxios_set_fieldgroup_cell_methods_mode79 80 SUBROUTINE cxios_get_fieldgroup_cell_methods_mode(fieldgroup_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)81 USE ISO_C_BINDING82 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl83 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: cell_methods_mode84 INTEGER (kind = C_INT) , VALUE :: cell_methods_mode_size85 END SUBROUTINE cxios_get_fieldgroup_cell_methods_mode86 87 FUNCTION cxios_is_defined_fieldgroup_cell_methods_mode(fieldgroup_hdl) BIND(C)88 USE ISO_C_BINDING89 LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_cell_methods_mode90 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl91 END FUNCTION cxios_is_defined_fieldgroup_cell_methods_mode92 93 94 52 SUBROUTINE cxios_set_fieldgroup_compression_level(fieldgroup_hdl, compression_level) BIND(C) 95 53 USE ISO_C_BINDING … … 189 147 190 148 191 SUBROUTINE cxios_set_fieldgroup_expr(fieldgroup_hdl, expr, expr_size) BIND(C)192 USE ISO_C_BINDING193 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl194 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: expr195 INTEGER (kind = C_INT) , VALUE :: expr_size196 END SUBROUTINE cxios_set_fieldgroup_expr197 198 SUBROUTINE cxios_get_fieldgroup_expr(fieldgroup_hdl, expr, expr_size) BIND(C)199 USE ISO_C_BINDING200 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl201 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: expr202 INTEGER (kind = C_INT) , VALUE :: expr_size203 END SUBROUTINE cxios_get_fieldgroup_expr204 205 FUNCTION cxios_is_defined_fieldgroup_expr(fieldgroup_hdl) BIND(C)206 USE ISO_C_BINDING207 LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_expr208 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl209 END FUNCTION cxios_is_defined_fieldgroup_expr210 211 212 149 SUBROUTINE cxios_set_fieldgroup_field_ref(fieldgroup_hdl, field_ref, field_ref_size) BIND(C) 213 150 USE ISO_C_BINDING -
XIOS/dev/branch_yushan/src/interface/fortran_attr/ifield_attr.F90
r1005 r1037 12 12 13 13 SUBROUTINE xios(set_field_attr) & 14 ( field_id, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&15 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&16 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&17 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )14 ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 15 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 16 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 17 , unit, valid_max, valid_min ) 18 18 19 19 IMPLICIT NONE … … 22 22 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset 23 23 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 24 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods25 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode26 24 INTEGER , OPTIONAL, INTENT(IN) :: compression_level 27 25 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value … … 31 29 LOGICAL , OPTIONAL, INTENT(IN) :: enabled 32 30 LOGICAL (KIND=C_BOOL) :: enabled_tmp 33 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr34 31 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref 35 32 TYPE(txios(duration)) , OPTIONAL, INTENT(IN) :: freq_offset … … 59 56 (field_id,field_hdl) 60 57 CALL xios(set_field_attr_hdl_) & 61 ( field_hdl, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&62 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&63 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&64 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )58 ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 59 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 60 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 61 , unit, valid_max, valid_min ) 65 62 66 63 END SUBROUTINE xios(set_field_attr) 67 64 68 65 SUBROUTINE xios(set_field_attr_hdl) & 69 ( field_hdl, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&70 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&71 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&72 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )66 ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 67 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 68 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 69 , unit, valid_max, valid_min ) 73 70 74 71 IMPLICIT NONE … … 76 73 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset 77 74 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 78 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods79 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode80 75 INTEGER , OPTIONAL, INTENT(IN) :: compression_level 81 76 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value … … 85 80 LOGICAL , OPTIONAL, INTENT(IN) :: enabled 86 81 LOGICAL (KIND=C_BOOL) :: enabled_tmp 87 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr88 82 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref 89 83 TYPE(txios(duration)) , OPTIONAL, INTENT(IN) :: freq_offset … … 111 105 112 106 CALL xios(set_field_attr_hdl_) & 113 ( field_hdl, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&114 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&115 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&116 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )107 ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 108 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 109 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 110 , unit, valid_max, valid_min ) 117 111 118 112 END SUBROUTINE xios(set_field_attr_hdl) 119 113 120 114 SUBROUTINE xios(set_field_attr_hdl_) & 121 ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_ & 122 , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_ & 123 , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_ & 124 , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ & 125 ) 115 ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_ & 116 , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_ & 117 , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_ & 118 , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 126 119 127 120 IMPLICIT NONE … … 129 122 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset_ 130 123 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_ 131 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_132 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode_133 124 INTEGER , OPTIONAL, INTENT(IN) :: compression_level_ 134 125 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_ … … 138 129 LOGICAL , OPTIONAL, INTENT(IN) :: enabled_ 139 130 LOGICAL (KIND=C_BOOL) :: enabled__tmp 140 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr_141 131 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref_ 142 132 TYPE(txios(duration)) , OPTIONAL, INTENT(IN) :: freq_offset_ … … 173 163 ENDIF 174 164 175 IF (PRESENT(cell_methods_)) THEN176 CALL cxios_set_field_cell_methods &177 (field_hdl%daddr, cell_methods_, len(cell_methods_))178 ENDIF179 180 IF (PRESENT(cell_methods_mode_)) THEN181 CALL cxios_set_field_cell_methods_mode &182 (field_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))183 ENDIF184 185 165 IF (PRESENT(compression_level_)) THEN 186 166 CALL cxios_set_field_compression_level & … … 210 190 ENDIF 211 191 212 IF (PRESENT(expr_)) THEN213 CALL cxios_set_field_expr &214 (field_hdl%daddr, expr_, len(expr_))215 ENDIF216 217 192 IF (PRESENT(field_ref_)) THEN 218 193 CALL cxios_set_field_field_ref & … … 321 296 322 297 SUBROUTINE xios(get_field_attr) & 323 ( field_id, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&324 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&325 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&326 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )298 ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 299 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 300 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 301 , unit, valid_max, valid_min ) 327 302 328 303 IMPLICIT NONE … … 331 306 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset 332 307 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 333 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods334 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode335 308 INTEGER , OPTIONAL, INTENT(OUT) :: compression_level 336 309 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value … … 340 313 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled 341 314 LOGICAL (KIND=C_BOOL) :: enabled_tmp 342 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr343 315 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref 344 316 TYPE(txios(duration)) , OPTIONAL, INTENT(OUT) :: freq_offset … … 368 340 (field_id,field_hdl) 369 341 CALL xios(get_field_attr_hdl_) & 370 ( field_hdl, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&371 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&372 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&373 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )342 ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 343 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 344 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 345 , unit, valid_max, valid_min ) 374 346 375 347 END SUBROUTINE xios(get_field_attr) 376 348 377 349 SUBROUTINE xios(get_field_attr_hdl) & 378 ( field_hdl, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&379 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&380 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&381 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )350 ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 351 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 352 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 353 , unit, valid_max, valid_min ) 382 354 383 355 IMPLICIT NONE … … 385 357 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset 386 358 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 387 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods388 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode389 359 INTEGER , OPTIONAL, INTENT(OUT) :: compression_level 390 360 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value … … 394 364 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled 395 365 LOGICAL (KIND=C_BOOL) :: enabled_tmp 396 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr397 366 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref 398 367 TYPE(txios(duration)) , OPTIONAL, INTENT(OUT) :: freq_offset … … 420 389 421 390 CALL xios(get_field_attr_hdl_) & 422 ( field_hdl, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&423 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&424 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&425 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )391 ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 392 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 393 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 394 , unit, valid_max, valid_min ) 426 395 427 396 END SUBROUTINE xios(get_field_attr_hdl) 428 397 429 398 SUBROUTINE xios(get_field_attr_hdl_) & 430 ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_ & 431 , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_ & 432 , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_ & 433 , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ & 434 ) 399 ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_ & 400 , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_ & 401 , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_ & 402 , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 435 403 436 404 IMPLICIT NONE … … 438 406 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset_ 439 407 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_ 440 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_441 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode_442 408 INTEGER , OPTIONAL, INTENT(OUT) :: compression_level_ 443 409 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_ … … 447 413 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled_ 448 414 LOGICAL (KIND=C_BOOL) :: enabled__tmp 449 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr_450 415 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref_ 451 416 TYPE(txios(duration)) , OPTIONAL, INTENT(OUT) :: freq_offset_ … … 482 447 ENDIF 483 448 484 IF (PRESENT(cell_methods_)) THEN485 CALL cxios_get_field_cell_methods &486 (field_hdl%daddr, cell_methods_, len(cell_methods_))487 ENDIF488 489 IF (PRESENT(cell_methods_mode_)) THEN490 CALL cxios_get_field_cell_methods_mode &491 (field_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))492 ENDIF493 494 449 IF (PRESENT(compression_level_)) THEN 495 450 CALL cxios_get_field_compression_level & … … 519 474 ENDIF 520 475 521 IF (PRESENT(expr_)) THEN522 CALL cxios_get_field_expr &523 (field_hdl%daddr, expr_, len(expr_))524 ENDIF525 526 476 IF (PRESENT(field_ref_)) THEN 527 477 CALL cxios_get_field_field_ref & … … 630 580 631 581 SUBROUTINE xios(is_defined_field_attr) & 632 ( field_id, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&633 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&634 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&635 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )582 ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 583 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 584 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 585 , unit, valid_max, valid_min ) 636 586 637 587 IMPLICIT NONE … … 642 592 LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref 643 593 LOGICAL(KIND=C_BOOL) :: axis_ref_tmp 644 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods645 LOGICAL(KIND=C_BOOL) :: cell_methods_tmp646 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode647 LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp648 594 LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 649 595 LOGICAL(KIND=C_BOOL) :: compression_level_tmp … … 656 602 LOGICAL, OPTIONAL, INTENT(OUT) :: enabled 657 603 LOGICAL(KIND=C_BOOL) :: enabled_tmp 658 LOGICAL, OPTIONAL, INTENT(OUT) :: expr659 LOGICAL(KIND=C_BOOL) :: expr_tmp660 604 LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref 661 605 LOGICAL(KIND=C_BOOL) :: field_ref_tmp … … 702 646 (field_id,field_hdl) 703 647 CALL xios(is_defined_field_attr_hdl_) & 704 ( field_hdl, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&705 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&706 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&707 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )648 ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 649 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 650 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 651 , unit, valid_max, valid_min ) 708 652 709 653 END SUBROUTINE xios(is_defined_field_attr) 710 654 711 655 SUBROUTINE xios(is_defined_field_attr_hdl) & 712 ( field_hdl, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&713 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&714 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&715 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )656 ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 657 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 658 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 659 , unit, valid_max, valid_min ) 716 660 717 661 IMPLICIT NONE … … 721 665 LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref 722 666 LOGICAL(KIND=C_BOOL) :: axis_ref_tmp 723 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods724 LOGICAL(KIND=C_BOOL) :: cell_methods_tmp725 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode726 LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp727 667 LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 728 668 LOGICAL(KIND=C_BOOL) :: compression_level_tmp … … 735 675 LOGICAL, OPTIONAL, INTENT(OUT) :: enabled 736 676 LOGICAL(KIND=C_BOOL) :: enabled_tmp 737 LOGICAL, OPTIONAL, INTENT(OUT) :: expr738 LOGICAL(KIND=C_BOOL) :: expr_tmp739 677 LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref 740 678 LOGICAL(KIND=C_BOOL) :: field_ref_tmp … … 779 717 780 718 CALL xios(is_defined_field_attr_hdl_) & 781 ( field_hdl, add_offset, axis_ref, c ell_methods, cell_methods_mode, compression_level, default_value&782 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path&783 , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref&784 , scale_factor, standard_name, ts_enabled, ts_split_freq,unit, valid_max, valid_min )719 ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref & 720 , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name & 721 , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq & 722 , unit, valid_max, valid_min ) 785 723 786 724 END SUBROUTINE xios(is_defined_field_attr_hdl) 787 725 788 726 SUBROUTINE xios(is_defined_field_attr_hdl_) & 789 ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_ & 790 , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_ & 791 , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_ & 792 , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ & 793 ) 727 ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_ & 728 , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_ & 729 , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_ & 730 , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 794 731 795 732 IMPLICIT NONE … … 799 736 LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref_ 800 737 LOGICAL(KIND=C_BOOL) :: axis_ref__tmp 801 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_802 LOGICAL(KIND=C_BOOL) :: cell_methods__tmp803 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode_804 LOGICAL(KIND=C_BOOL) :: cell_methods_mode__tmp805 738 LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_ 806 739 LOGICAL(KIND=C_BOOL) :: compression_level__tmp … … 813 746 LOGICAL, OPTIONAL, INTENT(OUT) :: enabled_ 814 747 LOGICAL(KIND=C_BOOL) :: enabled__tmp 815 LOGICAL, OPTIONAL, INTENT(OUT) :: expr_816 LOGICAL(KIND=C_BOOL) :: expr__tmp817 748 LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref_ 818 749 LOGICAL(KIND=C_BOOL) :: field_ref__tmp … … 868 799 ENDIF 869 800 870 IF (PRESENT(cell_methods_)) THEN871 cell_methods__tmp = cxios_is_defined_field_cell_methods &872 (field_hdl%daddr)873 cell_methods_ = cell_methods__tmp874 ENDIF875 876 IF (PRESENT(cell_methods_mode_)) THEN877 cell_methods_mode__tmp = cxios_is_defined_field_cell_methods_mode &878 (field_hdl%daddr)879 cell_methods_mode_ = cell_methods_mode__tmp880 ENDIF881 882 801 IF (PRESENT(compression_level_)) THEN 883 802 compression_level__tmp = cxios_is_defined_field_compression_level & … … 910 829 ENDIF 911 830 912 IF (PRESENT(expr_)) THEN913 expr__tmp = cxios_is_defined_field_expr &914 (field_hdl%daddr)915 expr_ = expr__tmp916 ENDIF917 918 831 IF (PRESENT(field_ref_)) THEN 919 832 field_ref__tmp = cxios_is_defined_field_field_ref & -
XIOS/dev/branch_yushan/src/interface/fortran_attr/ifieldgroup_attr.F90
r1005 r1037 12 12 13 13 SUBROUTINE xios(set_fieldgroup_attr) & 14 ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 15 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 16 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 17 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 18 ) 14 ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 15 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 16 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 17 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 19 18 20 19 IMPLICIT NONE … … 23 22 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset 24 23 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 25 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods26 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode27 24 INTEGER , OPTIONAL, INTENT(IN) :: compression_level 28 25 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value … … 32 29 LOGICAL , OPTIONAL, INTENT(IN) :: enabled 33 30 LOGICAL (KIND=C_BOOL) :: enabled_tmp 34 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr35 31 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref 36 32 TYPE(txios(duration)) , OPTIONAL, INTENT(IN) :: freq_offset … … 61 57 (fieldgroup_id,fieldgroup_hdl) 62 58 CALL xios(set_fieldgroup_attr_hdl_) & 63 ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 64 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 65 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 66 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 67 ) 59 ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 60 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 61 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 62 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 68 63 69 64 END SUBROUTINE xios(set_fieldgroup_attr) 70 65 71 66 SUBROUTINE xios(set_fieldgroup_attr_hdl) & 72 ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 73 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 74 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 75 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 76 ) 67 ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 68 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 69 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 70 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 77 71 78 72 IMPLICIT NONE … … 80 74 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset 81 75 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 82 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods83 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode84 76 INTEGER , OPTIONAL, INTENT(IN) :: compression_level 85 77 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value … … 89 81 LOGICAL , OPTIONAL, INTENT(IN) :: enabled 90 82 LOGICAL (KIND=C_BOOL) :: enabled_tmp 91 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr92 83 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref 93 84 TYPE(txios(duration)) , OPTIONAL, INTENT(IN) :: freq_offset … … 116 107 117 108 CALL xios(set_fieldgroup_attr_hdl_) & 118 ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 119 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 120 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 121 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 122 ) 109 ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 110 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 111 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 112 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 123 113 124 114 END SUBROUTINE xios(set_fieldgroup_attr_hdl) 125 115 126 116 SUBROUTINE xios(set_fieldgroup_attr_hdl_) & 127 ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_ & 128 , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_ & 129 , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_ & 130 , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_ & 131 , unit_, valid_max_, valid_min_ ) 117 ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_ & 118 , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_ & 119 , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_ & 120 , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 132 121 133 122 IMPLICIT NONE … … 135 124 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset_ 136 125 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_ 137 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_138 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode_139 126 INTEGER , OPTIONAL, INTENT(IN) :: compression_level_ 140 127 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_ … … 144 131 LOGICAL , OPTIONAL, INTENT(IN) :: enabled_ 145 132 LOGICAL (KIND=C_BOOL) :: enabled__tmp 146 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr_147 133 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref_ 148 134 TYPE(txios(duration)) , OPTIONAL, INTENT(IN) :: freq_offset_ … … 180 166 ENDIF 181 167 182 IF (PRESENT(cell_methods_)) THEN183 CALL cxios_set_fieldgroup_cell_methods &184 (fieldgroup_hdl%daddr, cell_methods_, len(cell_methods_))185 ENDIF186 187 IF (PRESENT(cell_methods_mode_)) THEN188 CALL cxios_set_fieldgroup_cell_methods_mode &189 (fieldgroup_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))190 ENDIF191 192 168 IF (PRESENT(compression_level_)) THEN 193 169 CALL cxios_set_fieldgroup_compression_level & … … 217 193 ENDIF 218 194 219 IF (PRESENT(expr_)) THEN220 CALL cxios_set_fieldgroup_expr &221 (fieldgroup_hdl%daddr, expr_, len(expr_))222 ENDIF223 224 195 IF (PRESENT(field_ref_)) THEN 225 196 CALL cxios_set_fieldgroup_field_ref & … … 333 304 334 305 SUBROUTINE xios(get_fieldgroup_attr) & 335 ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 336 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 337 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 338 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 339 ) 306 ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 307 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 308 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 309 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 340 310 341 311 IMPLICIT NONE … … 344 314 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset 345 315 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 346 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods347 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode348 316 INTEGER , OPTIONAL, INTENT(OUT) :: compression_level 349 317 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value … … 353 321 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled 354 322 LOGICAL (KIND=C_BOOL) :: enabled_tmp 355 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr356 323 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref 357 324 TYPE(txios(duration)) , OPTIONAL, INTENT(OUT) :: freq_offset … … 382 349 (fieldgroup_id,fieldgroup_hdl) 383 350 CALL xios(get_fieldgroup_attr_hdl_) & 384 ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 385 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 386 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 387 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 388 ) 351 ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 352 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 353 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 354 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 389 355 390 356 END SUBROUTINE xios(get_fieldgroup_attr) 391 357 392 358 SUBROUTINE xios(get_fieldgroup_attr_hdl) & 393 ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 394 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 395 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 396 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 397 ) 359 ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 360 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 361 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 362 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 398 363 399 364 IMPLICIT NONE … … 401 366 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset 402 367 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 403 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods404 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode405 368 INTEGER , OPTIONAL, INTENT(OUT) :: compression_level 406 369 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value … … 410 373 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled 411 374 LOGICAL (KIND=C_BOOL) :: enabled_tmp 412 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr413 375 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref 414 376 TYPE(txios(duration)) , OPTIONAL, INTENT(OUT) :: freq_offset … … 437 399 438 400 CALL xios(get_fieldgroup_attr_hdl_) & 439 ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 440 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 441 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 442 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 443 ) 401 ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 402 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 403 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 404 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 444 405 445 406 END SUBROUTINE xios(get_fieldgroup_attr_hdl) 446 407 447 408 SUBROUTINE xios(get_fieldgroup_attr_hdl_) & 448 ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_ & 449 , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_ & 450 , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_ & 451 , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_ & 452 , unit_, valid_max_, valid_min_ ) 409 ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_ & 410 , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_ & 411 , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_ & 412 , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 453 413 454 414 IMPLICIT NONE … … 456 416 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset_ 457 417 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_ 458 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_459 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode_460 418 INTEGER , OPTIONAL, INTENT(OUT) :: compression_level_ 461 419 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_ … … 465 423 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled_ 466 424 LOGICAL (KIND=C_BOOL) :: enabled__tmp 467 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr_468 425 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref_ 469 426 TYPE(txios(duration)) , OPTIONAL, INTENT(OUT) :: freq_offset_ … … 501 458 ENDIF 502 459 503 IF (PRESENT(cell_methods_)) THEN504 CALL cxios_get_fieldgroup_cell_methods &505 (fieldgroup_hdl%daddr, cell_methods_, len(cell_methods_))506 ENDIF507 508 IF (PRESENT(cell_methods_mode_)) THEN509 CALL cxios_get_fieldgroup_cell_methods_mode &510 (fieldgroup_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))511 ENDIF512 513 460 IF (PRESENT(compression_level_)) THEN 514 461 CALL cxios_get_fieldgroup_compression_level & … … 538 485 ENDIF 539 486 540 IF (PRESENT(expr_)) THEN541 CALL cxios_get_fieldgroup_expr &542 (fieldgroup_hdl%daddr, expr_, len(expr_))543 ENDIF544 545 487 IF (PRESENT(field_ref_)) THEN 546 488 CALL cxios_get_fieldgroup_field_ref & … … 654 596 655 597 SUBROUTINE xios(is_defined_fieldgroup_attr) & 656 ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 657 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 658 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 659 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 660 ) 598 ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 599 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 600 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 601 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 661 602 662 603 IMPLICIT NONE … … 667 608 LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref 668 609 LOGICAL(KIND=C_BOOL) :: axis_ref_tmp 669 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods670 LOGICAL(KIND=C_BOOL) :: cell_methods_tmp671 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode672 LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp673 610 LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 674 611 LOGICAL(KIND=C_BOOL) :: compression_level_tmp … … 681 618 LOGICAL, OPTIONAL, INTENT(OUT) :: enabled 682 619 LOGICAL(KIND=C_BOOL) :: enabled_tmp 683 LOGICAL, OPTIONAL, INTENT(OUT) :: expr684 LOGICAL(KIND=C_BOOL) :: expr_tmp685 620 LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref 686 621 LOGICAL(KIND=C_BOOL) :: field_ref_tmp … … 729 664 (fieldgroup_id,fieldgroup_hdl) 730 665 CALL xios(is_defined_fieldgroup_attr_hdl_) & 731 ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 732 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 733 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 734 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 735 ) 666 ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 667 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 668 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 669 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 736 670 737 671 END SUBROUTINE xios(is_defined_fieldgroup_attr) 738 672 739 673 SUBROUTINE xios(is_defined_fieldgroup_attr_hdl) & 740 ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 741 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 742 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 743 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 744 ) 674 ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 675 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 676 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 677 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 745 678 746 679 IMPLICIT NONE … … 750 683 LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref 751 684 LOGICAL(KIND=C_BOOL) :: axis_ref_tmp 752 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods753 LOGICAL(KIND=C_BOOL) :: cell_methods_tmp754 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode755 LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp756 685 LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level 757 686 LOGICAL(KIND=C_BOOL) :: compression_level_tmp … … 764 693 LOGICAL, OPTIONAL, INTENT(OUT) :: enabled 765 694 LOGICAL(KIND=C_BOOL) :: enabled_tmp 766 LOGICAL, OPTIONAL, INTENT(OUT) :: expr767 LOGICAL(KIND=C_BOOL) :: expr_tmp768 695 LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref 769 696 LOGICAL(KIND=C_BOOL) :: field_ref_tmp … … 810 737 811 738 CALL xios(is_defined_fieldgroup_attr_hdl_) & 812 ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value & 813 , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path & 814 , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access & 815 , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min & 816 ) 739 ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value & 740 , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output & 741 , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name & 742 , ts_enabled, ts_split_freq, unit, valid_max, valid_min ) 817 743 818 744 END SUBROUTINE xios(is_defined_fieldgroup_attr_hdl) 819 745 820 746 SUBROUTINE xios(is_defined_fieldgroup_attr_hdl_) & 821 ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_ & 822 , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_ & 823 , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_ & 824 , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_ & 825 , unit_, valid_max_, valid_min_ ) 747 ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_ & 748 , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_ & 749 , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_ & 750 , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 826 751 827 752 IMPLICIT NONE … … 831 756 LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref_ 832 757 LOGICAL(KIND=C_BOOL) :: axis_ref__tmp 833 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_834 LOGICAL(KIND=C_BOOL) :: cell_methods__tmp835 LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode_836 LOGICAL(KIND=C_BOOL) :: cell_methods_mode__tmp837 758 LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_ 838 759 LOGICAL(KIND=C_BOOL) :: compression_level__tmp … … 845 766 LOGICAL, OPTIONAL, INTENT(OUT) :: enabled_ 846 767 LOGICAL(KIND=C_BOOL) :: enabled__tmp 847 LOGICAL, OPTIONAL, INTENT(OUT) :: expr_848 LOGICAL(KIND=C_BOOL) :: expr__tmp849 768 LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref_ 850 769 LOGICAL(KIND=C_BOOL) :: field_ref__tmp … … 902 821 ENDIF 903 822 904 IF (PRESENT(cell_methods_)) THEN905 cell_methods__tmp = cxios_is_defined_fieldgroup_cell_methods &906 (fieldgroup_hdl%daddr)907 cell_methods_ = cell_methods__tmp908 ENDIF909 910 IF (PRESENT(cell_methods_mode_)) THEN911 cell_methods_mode__tmp = cxios_is_defined_fieldgroup_cell_methods_mode &912 (fieldgroup_hdl%daddr)913 cell_methods_mode_ = cell_methods_mode__tmp914 ENDIF915 916 823 IF (PRESENT(compression_level_)) THEN 917 824 compression_level__tmp = cxios_is_defined_fieldgroup_compression_level & … … 944 851 ENDIF 945 852 946 IF (PRESENT(expr_)) THEN947 expr__tmp = cxios_is_defined_fieldgroup_expr &948 (fieldgroup_hdl%daddr)949 expr_ = expr__tmp950 ENDIF951 952 853 IF (PRESENT(field_ref_)) THEN 953 854 field_ref__tmp = cxios_is_defined_fieldgroup_field_ref & -
XIOS/dev/branch_yushan/src/interface/fortran_attr/iinterpolate_domain_attr.F90
r1005 r1037 12 12 13 13 SUBROUTINE xios(set_interpolate_domain_attr) & 14 ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight)14 ( interpolate_domain_id, file, order, renormalize ) 15 15 16 16 IMPLICIT NONE … … 18 18 CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id 19 19 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file 20 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode21 20 INTEGER , OPTIONAL, INTENT(IN) :: order 22 21 LOGICAL , OPTIONAL, INTENT(IN) :: renormalize 23 22 LOGICAL (KIND=C_BOOL) :: renormalize_tmp 24 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename25 LOGICAL , OPTIONAL, INTENT(IN) :: write_weight26 LOGICAL (KIND=C_BOOL) :: write_weight_tmp27 23 28 24 CALL xios(get_interpolate_domain_handle) & 29 25 (interpolate_domain_id,interpolate_domain_hdl) 30 26 CALL xios(set_interpolate_domain_attr_hdl_) & 31 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight)27 ( interpolate_domain_hdl, file, order, renormalize ) 32 28 33 29 END SUBROUTINE xios(set_interpolate_domain_attr) 34 30 35 31 SUBROUTINE xios(set_interpolate_domain_attr_hdl) & 36 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight)32 ( interpolate_domain_hdl, file, order, renormalize ) 37 33 38 34 IMPLICIT NONE 39 35 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 40 36 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file 41 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode42 37 INTEGER , OPTIONAL, INTENT(IN) :: order 43 38 LOGICAL , OPTIONAL, INTENT(IN) :: renormalize 44 39 LOGICAL (KIND=C_BOOL) :: renormalize_tmp 45 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename46 LOGICAL , OPTIONAL, INTENT(IN) :: write_weight47 LOGICAL (KIND=C_BOOL) :: write_weight_tmp48 40 49 41 CALL xios(set_interpolate_domain_attr_hdl_) & 50 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight)42 ( interpolate_domain_hdl, file, order, renormalize ) 51 43 52 44 END SUBROUTINE xios(set_interpolate_domain_attr_hdl) 53 45 54 46 SUBROUTINE xios(set_interpolate_domain_attr_hdl_) & 55 ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_ & 56 ) 47 ( interpolate_domain_hdl, file_, order_, renormalize_ ) 57 48 58 49 IMPLICIT NONE 59 50 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 60 51 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file_ 61 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode_62 52 INTEGER , OPTIONAL, INTENT(IN) :: order_ 63 53 LOGICAL , OPTIONAL, INTENT(IN) :: renormalize_ 64 54 LOGICAL (KIND=C_BOOL) :: renormalize__tmp 65 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename_66 LOGICAL , OPTIONAL, INTENT(IN) :: write_weight_67 LOGICAL (KIND=C_BOOL) :: write_weight__tmp68 55 69 56 IF (PRESENT(file_)) THEN 70 57 CALL cxios_set_interpolate_domain_file & 71 58 (interpolate_domain_hdl%daddr, file_, len(file_)) 72 ENDIF73 74 IF (PRESENT(mode_)) THEN75 CALL cxios_set_interpolate_domain_mode &76 (interpolate_domain_hdl%daddr, mode_, len(mode_))77 59 ENDIF 78 60 … … 88 70 ENDIF 89 71 90 IF (PRESENT(weight_filename_)) THEN91 CALL cxios_set_interpolate_domain_weight_filename &92 (interpolate_domain_hdl%daddr, weight_filename_, len(weight_filename_))93 ENDIF94 95 IF (PRESENT(write_weight_)) THEN96 write_weight__tmp = write_weight_97 CALL cxios_set_interpolate_domain_write_weight &98 (interpolate_domain_hdl%daddr, write_weight__tmp)99 ENDIF100 101 72 END SUBROUTINE xios(set_interpolate_domain_attr_hdl_) 102 73 103 74 SUBROUTINE xios(get_interpolate_domain_attr) & 104 ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight)75 ( interpolate_domain_id, file, order, renormalize ) 105 76 106 77 IMPLICIT NONE … … 108 79 CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id 109 80 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file 110 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode111 81 INTEGER , OPTIONAL, INTENT(OUT) :: order 112 82 LOGICAL , OPTIONAL, INTENT(OUT) :: renormalize 113 83 LOGICAL (KIND=C_BOOL) :: renormalize_tmp 114 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename115 LOGICAL , OPTIONAL, INTENT(OUT) :: write_weight116 LOGICAL (KIND=C_BOOL) :: write_weight_tmp117 84 118 85 CALL xios(get_interpolate_domain_handle) & 119 86 (interpolate_domain_id,interpolate_domain_hdl) 120 87 CALL xios(get_interpolate_domain_attr_hdl_) & 121 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight)88 ( interpolate_domain_hdl, file, order, renormalize ) 122 89 123 90 END SUBROUTINE xios(get_interpolate_domain_attr) 124 91 125 92 SUBROUTINE xios(get_interpolate_domain_attr_hdl) & 126 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight)93 ( interpolate_domain_hdl, file, order, renormalize ) 127 94 128 95 IMPLICIT NONE 129 96 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 130 97 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file 131 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode132 98 INTEGER , OPTIONAL, INTENT(OUT) :: order 133 99 LOGICAL , OPTIONAL, INTENT(OUT) :: renormalize 134 100 LOGICAL (KIND=C_BOOL) :: renormalize_tmp 135 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename136 LOGICAL , OPTIONAL, INTENT(OUT) :: write_weight137 LOGICAL (KIND=C_BOOL) :: write_weight_tmp138 101 139 102 CALL xios(get_interpolate_domain_attr_hdl_) & 140 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight)103 ( interpolate_domain_hdl, file, order, renormalize ) 141 104 142 105 END SUBROUTINE xios(get_interpolate_domain_attr_hdl) 143 106 144 107 SUBROUTINE xios(get_interpolate_domain_attr_hdl_) & 145 ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_ & 146 ) 108 ( interpolate_domain_hdl, file_, order_, renormalize_ ) 147 109 148 110 IMPLICIT NONE 149 111 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 150 112 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file_ 151 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode_152 113 INTEGER , OPTIONAL, INTENT(OUT) :: order_ 153 114 LOGICAL , OPTIONAL, INTENT(OUT) :: renormalize_ 154 115 LOGICAL (KIND=C_BOOL) :: renormalize__tmp 155 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename_156 LOGICAL , OPTIONAL, INTENT(OUT) :: write_weight_157 LOGICAL (KIND=C_BOOL) :: write_weight__tmp158 116 159 117 IF (PRESENT(file_)) THEN 160 118 CALL cxios_get_interpolate_domain_file & 161 119 (interpolate_domain_hdl%daddr, file_, len(file_)) 162 ENDIF163 164 IF (PRESENT(mode_)) THEN165 CALL cxios_get_interpolate_domain_mode &166 (interpolate_domain_hdl%daddr, mode_, len(mode_))167 120 ENDIF 168 121 … … 178 131 ENDIF 179 132 180 IF (PRESENT(weight_filename_)) THEN181 CALL cxios_get_interpolate_domain_weight_filename &182 (interpolate_domain_hdl%daddr, weight_filename_, len(weight_filename_))183 ENDIF184 185 IF (PRESENT(write_weight_)) THEN186 CALL cxios_get_interpolate_domain_write_weight &187 (interpolate_domain_hdl%daddr, write_weight__tmp)188 write_weight_ = write_weight__tmp189 ENDIF190 191 133 END SUBROUTINE xios(get_interpolate_domain_attr_hdl_) 192 134 193 135 SUBROUTINE xios(is_defined_interpolate_domain_attr) & 194 ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight)136 ( interpolate_domain_id, file, order, renormalize ) 195 137 196 138 IMPLICIT NONE … … 199 141 LOGICAL, OPTIONAL, INTENT(OUT) :: file 200 142 LOGICAL(KIND=C_BOOL) :: file_tmp 201 LOGICAL, OPTIONAL, INTENT(OUT) :: mode202 LOGICAL(KIND=C_BOOL) :: mode_tmp203 143 LOGICAL, OPTIONAL, INTENT(OUT) :: order 204 144 LOGICAL(KIND=C_BOOL) :: order_tmp 205 145 LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize 206 146 LOGICAL(KIND=C_BOOL) :: renormalize_tmp 207 LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename208 LOGICAL(KIND=C_BOOL) :: weight_filename_tmp209 LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight210 LOGICAL(KIND=C_BOOL) :: write_weight_tmp211 147 212 148 CALL xios(get_interpolate_domain_handle) & 213 149 (interpolate_domain_id,interpolate_domain_hdl) 214 150 CALL xios(is_defined_interpolate_domain_attr_hdl_) & 215 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight)151 ( interpolate_domain_hdl, file, order, renormalize ) 216 152 217 153 END SUBROUTINE xios(is_defined_interpolate_domain_attr) 218 154 219 155 SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl) & 220 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight)156 ( interpolate_domain_hdl, file, order, renormalize ) 221 157 222 158 IMPLICIT NONE … … 224 160 LOGICAL, OPTIONAL, INTENT(OUT) :: file 225 161 LOGICAL(KIND=C_BOOL) :: file_tmp 226 LOGICAL, OPTIONAL, INTENT(OUT) :: mode227 LOGICAL(KIND=C_BOOL) :: mode_tmp228 162 LOGICAL, OPTIONAL, INTENT(OUT) :: order 229 163 LOGICAL(KIND=C_BOOL) :: order_tmp 230 164 LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize 231 165 LOGICAL(KIND=C_BOOL) :: renormalize_tmp 232 LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename233 LOGICAL(KIND=C_BOOL) :: weight_filename_tmp234 LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight235 LOGICAL(KIND=C_BOOL) :: write_weight_tmp236 166 237 167 CALL xios(is_defined_interpolate_domain_attr_hdl_) & 238 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight)168 ( interpolate_domain_hdl, file, order, renormalize ) 239 169 240 170 END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl) 241 171 242 172 SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_) & 243 ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_ & 244 ) 173 ( interpolate_domain_hdl, file_, order_, renormalize_ ) 245 174 246 175 IMPLICIT NONE … … 248 177 LOGICAL, OPTIONAL, INTENT(OUT) :: file_ 249 178 LOGICAL(KIND=C_BOOL) :: file__tmp 250 LOGICAL, OPTIONAL, INTENT(OUT) :: mode_251 LOGICAL(KIND=C_BOOL) :: mode__tmp252 179 LOGICAL, OPTIONAL, INTENT(OUT) :: order_ 253 180 LOGICAL(KIND=C_BOOL) :: order__tmp 254 181 LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize_ 255 182 LOGICAL(KIND=C_BOOL) :: renormalize__tmp 256 LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename_257 LOGICAL(KIND=C_BOOL) :: weight_filename__tmp258 LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight_259 LOGICAL(KIND=C_BOOL) :: write_weight__tmp260 183 261 184 IF (PRESENT(file_)) THEN … … 265 188 ENDIF 266 189 267 IF (PRESENT(mode_)) THEN268 mode__tmp = cxios_is_defined_interpolate_domain_mode &269 (interpolate_domain_hdl%daddr)270 mode_ = mode__tmp271 ENDIF272 273 190 IF (PRESENT(order_)) THEN 274 191 order__tmp = cxios_is_defined_interpolate_domain_order & … … 283 200 ENDIF 284 201 285 IF (PRESENT(weight_filename_)) THEN286 weight_filename__tmp = cxios_is_defined_interpolate_domain_weight_filename &287 (interpolate_domain_hdl%daddr)288 weight_filename_ = weight_filename__tmp289 ENDIF290 291 IF (PRESENT(write_weight_)) THEN292 write_weight__tmp = cxios_is_defined_interpolate_domain_write_weight &293 (interpolate_domain_hdl%daddr)294 write_weight_ = write_weight__tmp295 ENDIF296 297 202 END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_) 298 203 -
XIOS/dev/branch_yushan/src/interface/fortran_attr/interpolate_domain_interface_attr.F90
r1005 r1037 29 29 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl 30 30 END FUNCTION cxios_is_defined_interpolate_domain_file 31 32 33 SUBROUTINE cxios_set_interpolate_domain_mode(interpolate_domain_hdl, mode, mode_size) BIND(C)34 USE ISO_C_BINDING35 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl36 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: mode37 INTEGER (kind = C_INT) , VALUE :: mode_size38 END SUBROUTINE cxios_set_interpolate_domain_mode39 40 SUBROUTINE cxios_get_interpolate_domain_mode(interpolate_domain_hdl, mode, mode_size) BIND(C)41 USE ISO_C_BINDING42 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl43 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: mode44 INTEGER (kind = C_INT) , VALUE :: mode_size45 END SUBROUTINE cxios_get_interpolate_domain_mode46 47 FUNCTION cxios_is_defined_interpolate_domain_mode(interpolate_domain_hdl) BIND(C)48 USE ISO_C_BINDING49 LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_mode50 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl51 END FUNCTION cxios_is_defined_interpolate_domain_mode52 31 53 32 … … 89 68 END FUNCTION cxios_is_defined_interpolate_domain_renormalize 90 69 91 92 SUBROUTINE cxios_set_interpolate_domain_weight_filename(interpolate_domain_hdl, weight_filename, weight_filename_size) BIND(C)93 USE ISO_C_BINDING94 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl95 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: weight_filename96 INTEGER (kind = C_INT) , VALUE :: weight_filename_size97 END SUBROUTINE cxios_set_interpolate_domain_weight_filename98 99 SUBROUTINE cxios_get_interpolate_domain_weight_filename(interpolate_domain_hdl, weight_filename, weight_filename_size) BIND(C)100 USE ISO_C_BINDING101 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl102 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: weight_filename103 INTEGER (kind = C_INT) , VALUE :: weight_filename_size104 END SUBROUTINE cxios_get_interpolate_domain_weight_filename105 106 FUNCTION cxios_is_defined_interpolate_domain_weight_filename(interpolate_domain_hdl) BIND(C)107 USE ISO_C_BINDING108 LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_weight_filename109 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl110 END FUNCTION cxios_is_defined_interpolate_domain_weight_filename111 112 113 SUBROUTINE cxios_set_interpolate_domain_write_weight(interpolate_domain_hdl, write_weight) BIND(C)114 USE ISO_C_BINDING115 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl116 LOGICAL (KIND=C_BOOL) , VALUE :: write_weight117 END SUBROUTINE cxios_set_interpolate_domain_write_weight118 119 SUBROUTINE cxios_get_interpolate_domain_write_weight(interpolate_domain_hdl, write_weight) BIND(C)120 USE ISO_C_BINDING121 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl122 LOGICAL (KIND=C_BOOL) :: write_weight123 END SUBROUTINE cxios_get_interpolate_domain_write_weight124 125 FUNCTION cxios_is_defined_interpolate_domain_write_weight(interpolate_domain_hdl) BIND(C)126 USE ISO_C_BINDING127 LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_write_weight128 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl129 END FUNCTION cxios_is_defined_interpolate_domain_write_weight130 131 70 END INTERFACE 132 71 -
XIOS/dev/branch_yushan/src/io/nc4_data_output.cpp
r1012 r1037 21 21 , filename(filename) 22 22 { 23 23 SuperClass::type = MULTI_FILE; 24 24 } 25 25 … … 33 33 , isCollective(isCollective) 34 34 { 35 35 SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE; 36 36 } 37 37 … … 1458 1458 void CNc4DataOutput::writeField_(CField* field) 1459 1459 { 1460 CContext* context = CContext::getCurrent() ;1461 CContextServer* server=context->server ;1462 1463 std::vector<StdString> dims, coodinates;1464 CGrid* grid = field->grid;1465 if (!grid->doGridHaveDataToWrite())1460 CContext* context = CContext::getCurrent() ; 1461 CContextServer* server=context->server ; 1462 1463 std::vector<StdString> dims, coodinates; 1464 CGrid* grid = field->grid; 1465 if (!grid->doGridHaveDataToWrite()) 1466 1466 if (SuperClass::type==MULTI_FILE) return ; 1467 1467 1468 CArray<int,1> axisDomainOrder = grid->axis_domain_order; 1469 int numElement = axisDomainOrder.numElements(), idxDomain = 0, idxAxis = 0, idxScalar = 0; 1470 std::vector<StdString> domainList = grid->getDomainList(); 1471 std::vector<StdString> axisList = grid->getAxisList(); 1472 std::vector<StdString> scalarList = grid->getScalarList(); 1473 1474 StdString timeid = getTimeCounterName(); 1475 StdString dimXid,dimYid; 1476 std::deque<StdString> dimIdList, dimCoordList; 1477 bool hasArea = false; 1478 StdString cellMeasures = "area:"; 1479 bool compressedOutput = !field->indexed_output.isEmpty() && field->indexed_output; 1480 1481 for (int i = 0; i < numElement; ++i) 1482 { 1483 if (2 == axisDomainOrder(i)) 1484 { 1485 CDomain* domain = CDomain::get(domainList[idxDomain]); 1486 StdString domId = domain->getDomainOutputName(); 1487 StdString appendDomId = singleDomain ? "" : "_" + domId ; 1488 1489 if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured) 1468 CArray<int,1> axisDomainOrder = grid->axis_domain_order; 1469 int numElement = axisDomainOrder.numElements(), idxDomain = 0, idxAxis = 0, idxScalar = 0; 1470 std::vector<StdString> domainList = grid->getDomainList(); 1471 std::vector<StdString> axisList = grid->getAxisList(); 1472 std::vector<StdString> scalarList = grid->getScalarList(); 1473 1474 StdString timeid = getTimeCounterName(); 1475 StdString dimXid,dimYid; 1476 std::deque<StdString> dimIdList, dimCoordList; 1477 bool hasArea = false; 1478 StdString cellMeasures = "area:"; 1479 bool compressedOutput = !field->indexed_output.isEmpty() && field->indexed_output; 1480 1481 for (int i = 0; i < numElement; ++i) 1482 { 1483 if (2 == axisDomainOrder(i)) 1484 { 1485 CDomain* domain = CDomain::get(domainList[idxDomain]); 1486 StdString domId = domain->getDomainOutputName(); 1487 StdString appendDomId = singleDomain ? "" : "_" + domId ; 1488 1489 if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured) 1490 { 1491 dimIdList.push_back(domId + "_points"); 1492 field->setUseCompressedOutput(); 1493 } 1494 1495 switch (domain->type) 1496 { 1497 case CDomain::type_attr::curvilinear: 1498 if (!compressedOutput || !domain->isCompressible()) 1499 { 1500 dimXid = StdString("x").append(appendDomId); 1501 dimIdList.push_back(dimXid); 1502 dimYid = StdString("y").append(appendDomId); 1503 dimIdList.push_back(dimYid); 1504 } 1505 dimCoordList.push_back(StdString("nav_lon").append(appendDomId)); 1506 dimCoordList.push_back(StdString("nav_lat").append(appendDomId)); 1507 break ; 1508 case CDomain::type_attr::rectilinear: 1509 if (!compressedOutput || !domain->isCompressible()) 1510 { 1511 dimXid = StdString("lon").append(appendDomId); 1512 dimIdList.push_back(dimXid); 1513 dimYid = StdString("lat").append(appendDomId); 1514 dimIdList.push_back(dimYid); 1515 } 1516 break ; 1517 case CDomain::type_attr::unstructured: 1518 { 1519 if (SuperClassWriter::useCFConvention) 1520 { 1521 dimXid = StdString("cell").append(appendDomId); 1522 dimIdList.push_back(dimXid); 1523 dimCoordList.push_back(StdString("lon").append(appendDomId)); 1524 dimCoordList.push_back(StdString("lat").append(appendDomId)); 1525 } 1526 else 1527 { 1528 StdString domainName = domain->name; 1529 if (domain->nvertex == 1) 1490 1530 { 1491 dimIdList.push_back(domId + "_points"); 1492 field->setUseCompressedOutput(); 1531 dimXid = "n" + domainName + "_node"; 1532 dimIdList.push_back(dimXid); 1533 dimCoordList.push_back(StdString(domainName + "_node_x")); 1534 dimCoordList.push_back(StdString(domainName + "_node_y")); 1493 1535 } 1494 1495 switch (domain->type) 1536 else if (domain->nvertex == 2) 1496 1537 { 1497 case CDomain::type_attr::curvilinear: 1498 if (!compressedOutput || !domain->isCompressible()) 1499 { 1500 dimXid = StdString("x").append(appendDomId); 1501 dimIdList.push_back(dimXid); 1502 dimYid = StdString("y").append(appendDomId); 1503 dimIdList.push_back(dimYid); 1504 } 1505 dimCoordList.push_back(StdString("nav_lon").append(appendDomId)); 1506 dimCoordList.push_back(StdString("nav_lat").append(appendDomId)); 1507 break ; 1508 case CDomain::type_attr::rectilinear: 1509 if (!compressedOutput || !domain->isCompressible()) 1510 { 1511 dimXid = StdString("lon").append(appendDomId); 1512 dimIdList.push_back(dimXid); 1513 dimYid = StdString("lat").append(appendDomId); 1514 dimIdList.push_back(dimYid); 1515 } 1516 break ; 1517 case CDomain::type_attr::unstructured: 1518 { 1519 if (SuperClassWriter::useCFConvention) 1520 { 1521 dimXid = StdString("cell").append(appendDomId); 1522 dimIdList.push_back(dimXid); 1523 dimCoordList.push_back(StdString("lon").append(appendDomId)); 1524 dimCoordList.push_back(StdString("lat").append(appendDomId)); 1525 } 1526 else 1527 { 1528 StdString domainName = domain->name; 1529 if (domain->nvertex == 1) 1530 { 1531 dimXid = "n" + domainName + "_node"; 1532 dimIdList.push_back(dimXid); 1533 dimCoordList.push_back(StdString(domainName + "_node_x")); 1534 dimCoordList.push_back(StdString(domainName + "_node_y")); 1535 } 1536 else if (domain->nvertex == 2) 1537 { 1538 dimXid = "n" + domainName + "_edge"; 1539 dimIdList.push_back(dimXid); 1540 dimCoordList.push_back(StdString(domainName + "_edge_x")); 1541 dimCoordList.push_back(StdString(domainName + "_edge_y")); 1542 } 1543 else 1544 { 1545 dimXid = "n" + domainName + "_face"; 1546 dimIdList.push_back(dimXid); 1547 dimCoordList.push_back(StdString(domainName + "_face_x")); 1548 dimCoordList.push_back(StdString(domainName + "_face_y")); 1549 } 1550 } // ugrid convention 1551 } // case unstructured domain 1552 } 1553 1554 if (domain->hasArea) 1555 { 1556 hasArea = true; 1557 cellMeasures += " area" + appendDomId; 1558 } 1559 ++idxDomain; 1560 } 1561 else if (1 == axisDomainOrder(i)) 1562 { 1563 CAxis* axis = CAxis::get(axisList[idxAxis]); 1564 StdString axisId = axis->getAxisOutputName(); 1565 1566 if (compressedOutput && axis->isCompressible()) 1567 { 1568 dimIdList.push_back(axisId + "_points"); 1569 field->setUseCompressedOutput(); 1538 dimXid = "n" + domainName + "_edge"; 1539 dimIdList.push_back(dimXid); 1540 dimCoordList.push_back(StdString(domainName + "_edge_x")); 1541 dimCoordList.push_back(StdString(domainName + "_edge_y")); 1570 1542 } 1571 1543 else 1572 dimIdList.push_back(axisId); 1573 1574 dimCoordList.push_back(axisId); 1575 ++idxAxis; 1576 } 1577 else // scalar 1578 { 1544 { 1545 dimXid = "n" + domainName + "_face"; 1546 dimIdList.push_back(dimXid); 1547 dimCoordList.push_back(StdString(domainName + "_face_x")); 1548 dimCoordList.push_back(StdString(domainName + "_face_y")); 1549 } 1550 } // ugrid convention 1551 } // case unstructured domain 1552 } 1553 1554 if (domain->hasArea) 1555 { 1556 hasArea = true; 1557 cellMeasures += " area" + appendDomId; 1558 } 1559 ++idxDomain; 1560 } 1561 else if (1 == axisDomainOrder(i)) 1562 { 1563 CAxis* axis = CAxis::get(axisList[idxAxis]); 1564 StdString axisId = axis->getAxisOutputName(); 1565 1566 if (compressedOutput && axis->isCompressible()) 1567 { 1568 dimIdList.push_back(axisId + "_points"); 1569 field->setUseCompressedOutput(); 1570 } 1571 else 1572 dimIdList.push_back(axisId); 1573 1574 dimCoordList.push_back(axisId); 1575 ++idxAxis; 1576 } 1577 else // scalar 1578 { 1579 1579 /* Do nothing here */ 1580 }1581 }1580 } 1581 } 1582 1582 1583 1583 /* … … 1589 1589 : latid; 1590 1590 */ 1591 StdString fieldid = field->getFieldOutputName();1592 1593 nc_type type ;1594 if (field->prec.isEmpty()) type = NC_FLOAT ;1595 else1596 {1597 if (field->prec==2) type = NC_SHORT ;1598 else if (field->prec==4) type = NC_FLOAT ;1599 else if (field->prec==8) type = NC_DOUBLE ;1600 }1601 1602 bool wtime = !(!field->operation.isEmpty() && field->getOperationTimeType() == func::CFunctor::once);1603 1604 if (wtime)1605 {1606 1607 //StdOStringStream oss;1608 // oss << "time_" << field->operation.getValue()1609 // << "_" << field->getRelFile()->output_freq.getValue();1591 StdString fieldid = field->getFieldOutputName(); 1592 1593 nc_type type ; 1594 if (field->prec.isEmpty()) type = NC_FLOAT ; 1595 else 1596 { 1597 if (field->prec==2) type = NC_SHORT ; 1598 else if (field->prec==4) type = NC_FLOAT ; 1599 else if (field->prec==8) type = NC_DOUBLE ; 1600 } 1601 1602 bool wtime = !(!field->operation.isEmpty() && field->getOperationTimeType() == func::CFunctor::once); 1603 1604 if (wtime) 1605 { 1606 1607 //StdOStringStream oss; 1608 // oss << "time_" << field->operation.getValue() 1609 // << "_" << field->getRelFile()->output_freq.getValue(); 1610 1610 //oss 1611 if (field->getOperationTimeType() == func::CFunctor::instant) coodinates.push_back(string("time_instant"));1612 else if (field->getOperationTimeType() == func::CFunctor::centered) coodinates.push_back(string("time_centered"));1613 dims.push_back(timeid);1614 }1615 1616 if (compressedOutput && grid->isCompressible())1617 {1618 dims.push_back(grid->getId() + "_points");1619 field->setUseCompressedOutput();1620 }1621 else1622 {1623 while (!dimIdList.empty())1624 {1625 dims.push_back(dimIdList.back());1626 dimIdList.pop_back();1627 }1628 }1629 1630 while (!dimCoordList.empty())1631 {1632 coodinates.push_back(dimCoordList.back());1633 dimCoordList.pop_back();1634 }1635 1636 try1637 {1611 if (field->getOperationTimeType() == func::CFunctor::instant) coodinates.push_back(string("time_instant")); 1612 else if (field->getOperationTimeType() == func::CFunctor::centered) coodinates.push_back(string("time_centered")); 1613 dims.push_back(timeid); 1614 } 1615 1616 if (compressedOutput && grid->isCompressible()) 1617 { 1618 dims.push_back(grid->getId() + "_points"); 1619 field->setUseCompressedOutput(); 1620 } 1621 else 1622 { 1623 while (!dimIdList.empty()) 1624 { 1625 dims.push_back(dimIdList.back()); 1626 dimIdList.pop_back(); 1627 } 1628 } 1629 1630 while (!dimCoordList.empty()) 1631 { 1632 coodinates.push_back(dimCoordList.back()); 1633 dimCoordList.pop_back(); 1634 } 1635 1636 try 1637 { 1638 1638 SuperClassWriter::addVariable(fieldid, type, dims); 1639 1639 … … 1650 1650 ("units", field->unit.getValue(), &fieldid); 1651 1651 1652 // Ugrid field attributes "mesh" and "location" 1653 if (!SuperClassWriter::useCFConvention) 1654 { 1655 if (!domainList.empty()) 1656 { 1657 CDomain* domain = CDomain::get(domainList[0]); // Suppose that we have only domain 1658 StdString mesh = domain->name; 1659 SuperClassWriter::addAttribute("mesh", mesh, &fieldid); 1660 StdString location; 1661 if (domain->nvertex == 1) 1662 location = "node"; 1663 else if (domain->nvertex == 2) 1664 location = "edge"; 1665 else if (domain->nvertex > 2) 1666 location = "face"; 1667 SuperClassWriter::addAttribute("location", location, &fieldid); 1668 } 1669 1670 } 1671 1672 if (!field->valid_min.isEmpty()) 1652 if (!field->valid_min.isEmpty()) 1673 1653 SuperClassWriter::addAttribute 1674 1654 ("valid_min", field->valid_min.getValue(), &fieldid); … … 1694 1674 vector<CVariable*> listVars = field->getAllVariables() ; 1695 1675 for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) writeAttribute_(*it, fieldid) ; 1696 1697 bool alreadyAddCellMethod = false;1698 StdString cellMethodsPrefix(""), cellMethodsSuffix("");1699 if (!field->cell_methods.isEmpty())1700 {1701 StdString cellMethodString = field->cell_methods;1702 if (field->cell_methods_mode.isEmpty() ||1703 (CField::cell_methods_mode_attr::overwrite == field->cell_methods_mode))1704 {1705 SuperClassWriter::addAttribute("cell_methods", cellMethodString, &fieldid);1706 alreadyAddCellMethod = true;1707 }1708 else1709 {1710 switch (field->cell_methods_mode)1711 {1712 case (CField::cell_methods_mode_attr::prefix):1713 cellMethodsPrefix = cellMethodString;1714 cellMethodsPrefix += " ";1715 break;1716 case (CField::cell_methods_mode_attr::suffix):1717 cellMethodsSuffix = " ";1718 cellMethodsSuffix += cellMethodString;1719 break;1720 case (CField::cell_methods_mode_attr::none):1721 break;1722 default:1723 break;1724 }1725 }1726 }1727 1676 1728 1677 … … 1738 1687 SuperClassWriter::addAttribute("interval_write", freqOut.toStringUDUnits(), &fieldid); 1739 1688 1740 StdString cellMethods (cellMethodsPrefix + "time: ");1689 StdString cellMethods = "time: "; 1741 1690 if (field->operation.getValue() == "instant") cellMethods += "point"; 1742 1691 else if (field->operation.getValue() == "average") cellMethods += "mean"; … … 1745 1694 if (freqOp.resolve(*context->calendar) != freqOut.resolve(*context->calendar)) 1746 1695 cellMethods += " (interval: " + freqOpStr + ")"; 1747 cellMethods += cellMethodsSuffix; 1748 if (!alreadyAddCellMethod) 1749 SuperClassWriter::addAttribute("cell_methods", cellMethods, &fieldid); 1696 SuperClassWriter::addAttribute("cell_methods", cellMethods, &fieldid); 1750 1697 } 1751 1698 … … 1813 1760 if (SuperClassWriter::useCFConvention) 1814 1761 this->writeFileAttributes(filename, description, 1815 StdString("CF-1. 6"),1762 StdString("CF-1.5"), 1816 1763 StdString("An IPSL model"), 1817 1764 this->getTimeStamp()); … … 1981 1928 if (!field->wasWritten()) 1982 1929 { 1983 if (appendMode && field->file->record_offset.isEmpty() && 1984 field->getOperationTimeType() != func::CFunctor::once) 1930 if (appendMode && field->file->record_offset.isEmpty()) 1985 1931 { 1986 1932 field->resetNStep(getRecordFromTime(field->last_Write_srv) + 1); … … 2015 1961 time_data_bound(1) = lastWrite; 2016 1962 } 2017 2018 if (field->file->time_counter.isEmpty()) 2019 if (field->hasTimeInstant && !field->hasTimeCentered) 2020 time_counter(0) = lastWrite; 2021 else 2022 time_counter(0) = (lastWrite + lastLastWrite) / 2; 2023 2024 else if (field->file->time_counter == CFile::time_counter_attr::instant) 1963 1964 if (field->file->time_counter == CFile::time_counter_attr::instant) 2025 1965 time_counter(0) = lastWrite; 2026 1966 else if (field->file->time_counter == CFile::time_counter_attr::centered) … … 2030 1970 2031 1971 2032 if (field->file->time_counter.isEmpty()) 2033 if (field->hasTimeInstant && !field->hasTimeCentered) 2034 time_counter_bound(0) = time_counter_bound(1) = lastWrite; 2035 else 2036 { 2037 time_counter_bound(0) = lastLastWrite; 2038 time_counter_bound(1) = lastWrite; 2039 } 2040 else if (field->file->time_counter == CFile::time_counter_attr::instant) 1972 if (field->file->time_counter == CFile::time_counter_attr::instant) 2041 1973 time_counter_bound(0) = time_counter_bound(1) = lastWrite; 2042 1974 else if (field->file->time_counter == CFile::time_counter_attr::centered) … … 2087 2019 SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2088 2020 SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2089 if (field->file->time_counter.isEmpty() || 2090 (field->file->time_counter != CFile::time_counter_attr::none)) 2021 if (field->file->time_counter != CFile::time_counter_attr::none) 2091 2022 { 2092 2023 SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2093 if (field->file->time_counter.isEmpty() || 2094 (field->file->time_counter != CFile::time_counter_attr::record)) 2024 if (field->file->time_counter != CFile::time_counter_attr::record) 2095 2025 SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2096 2026 } … … 2225 2155 SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 2226 2156 SuperClassWriter::writeTimeAxisData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 2227 if (field->file->time_counter.isEmpty() || 2228 (field->file->time_counter != CFile::time_counter_attr::none)) 2157 if (field->file->time_counter != CFile::time_counter_attr::none) 2229 2158 { 2230 2159 SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1, isRoot); 2231 if (field->file->time_counter.isEmpty() || 2232 (field->file->time_counter != CFile::time_counter_attr::record)) 2160 if (field->file->time_counter != CFile::time_counter_attr::record) 2233 2161 SuperClassWriter::writeTimeAxisData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 2234 2162 } … … 2271 2199 StdString timeid(getTimeCounterName()); 2272 2200 StdString timeBoundId("axis_nbounds"); 2273 2201 2274 2202 if (field->getOperationTimeType() == func::CFunctor::instant) 2275 2203 { 2276 2204 axisid = "time_instant"; 2277 2205 axisBoundId = "time_instant_bounds"; 2278 field->hasTimeInstant = true; 2279 } 2280 2281 if (field->getOperationTimeType() == func::CFunctor::centered) 2282 { 2283 field->hasTimeCentered = true; 2284 } 2206 } 2285 2207 2286 2208 try … … 2314 2236 } 2315 2237 2316 if (field->file->time_counter.isEmpty() || 2317 (field->file->time_counter != CFile::time_counter_attr::none)) 2238 if (field->file->time_counter != CFile::time_counter_attr::none) 2318 2239 { 2319 2240 // Adding time_counter … … 2327 2248 SuperClassWriter::addAttribute("axis", string("T"), &axisid); 2328 2249 2329 if (field->file->time_counter.isEmpty() || 2330 (field->file->time_counter != CFile::time_counter_attr::record)) 2250 if (field->file->time_counter != CFile::time_counter_attr::record) 2331 2251 { 2332 2252 CDate timeOrigin = cal->getTimeOrigin(); … … 2340 2260 2341 2261 // Adding time_counter_bound dimension 2342 if (field->file->time_counter.isEmpty() || 2343 (field->file->time_counter != CFile::time_counter_attr::record)) 2262 if (field->file->time_counter != CFile::time_counter_attr::record) 2344 2263 { 2345 2264 if (!SuperClassWriter::varExist(axisBoundId)) … … 2516 2435 SuperClassWriter::addAttribute("title" , description); 2517 2436 SuperClassWriter::addAttribute("Conventions", conventions); 2518 //SuperClassWriter::addAttribute("production" , production);2437 SuperClassWriter::addAttribute("production" , production); 2519 2438 SuperClassWriter::addAttribute("timeStamp" , timeStamp); 2520 2439 } -
XIOS/dev/branch_yushan/src/io/netCdfInterface.hpp
r811 r1037 17 17 18 18 #include "mpi.hpp" 19 //#include <mpi.h> 19 20 #include "netcdf.hpp" 20 21 -
XIOS/dev/branch_yushan/src/io/onetcdf4.cpp
r878 r1037 3 3 #include "onetcdf4.hpp" 4 4 #include "group_template.hpp" 5 #include "mpi.hpp"5 //#include "mpi_std.hpp" 6 6 #include "netcdf.hpp" 7 7 #include "netCdfInterface.hpp" … … 48 48 } 49 49 wmpi = comm && !multifile; 50 51 MPI_Info info_null; 50 52 51 53 if (wmpi) … … 56 58 { 57 59 if (wmpi) 58 CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp);60 CNetCdfInterface::createPar(filename, mode, *comm, info_null, this->ncidp); 59 61 else 60 62 CNetCdfInterface::create(filename, mode, this->ncidp); … … 66 68 mode |= NC_WRITE; 67 69 if (wmpi) 68 CNetCdfInterface::openPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp);70 CNetCdfInterface::openPar(filename, mode, *comm, info_null, this->ncidp); 69 71 else 70 72 CNetCdfInterface::open(filename, mode, this->ncidp); -
XIOS/dev/branch_yushan/src/io/onetcdf4.hpp
r878 r1037 8 8 #include "array_new.hpp" 9 9 #include "mpi.hpp" 10 //#include <mpi.h> 10 11 #include "netcdf.hpp" 11 12 -
XIOS/dev/branch_yushan/src/mpi.hpp
r501 r1037 11 11 #define OMPI_SKIP_MPICXX 12 12 13 #include <mpi.h> 13 #ifdef _usingEP 14 #include "../extern/src_ep/ep_lib.hpp" 15 using namespace ep_lib; 16 #elif _usingMPI 17 #include <mpi.h> 18 #endif 19 14 20 15 21 #endif -
XIOS/dev/branch_yushan/src/node/axis.cpp
r995 r1037 264 264 isDistributed_ = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) || 265 265 (!this->n.isEmpty() && (this->n != this->n_glo)); 266 267 // A same stupid condition to make sure that if there is only one client, axis268 // should be considered to be distributed. This should be a temporary solution269 isDistributed_ |= (1 == CContext::getCurrent()->client->clientSize);270 266 } 271 267 -
XIOS/dev/branch_yushan/src/node/context.cpp
r1033 r1037 339 339 } 340 340 341 //! Server side: Put server into a loop in order to listen message from client 342 bool CContext::eventLoop(void) 343 { 344 return server->eventLoop(); 345 } 346 341 347 //! Try to send the buffers and receive possible answers 342 348 bool CContext::checkBuffersAndListen(void) 343 349 { 344 350 client->checkBuffers(); 345 346 bool hasTmpBufferedEvent = client->hasTemporarilyBufferedEvent(); 347 if (hasTmpBufferedEvent) 348 hasTmpBufferedEvent = !client->sendTemporarilyBufferedEvent(); 349 350 // Don't process events if there is a temporarily buffered event 351 return server->eventLoop(!hasTmpBufferedEvent); 351 return server->eventLoop(); 352 352 } 353 353 … … 389 389 void CContext::closeDefinition(void) 390 390 { 391 int myRank; 392 MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 393 394 //printf("myRank = %d, hasClient = %d, hasServer = %d\n", myRank, hasClient, hasServer); 395 391 396 // There is nothing client need to send to server 392 397 if (hasClient) 393 398 { 394 399 // After xml is parsed, there are some more works with post processing 395 postProcessing(); 396 } 397 setClientServerBuffer(); 400 postProcessing(); 401 //printf("myRank = %d, postProcessing OK\n", myRank); 402 } 403 setClientServerBuffer(); //printf("myRank = %d, setClientServerBuffer OK\n", myRank); 398 404 399 405 if (hasClient && !hasServer) 400 406 { 401 407 // Send all attributes of current context to server 402 this->sendAllAttributesToServer(); 408 this->sendAllAttributesToServer(); //printf("myRank = %d, this->sendAllAttributesToServer OK\n", myRank); 403 409 404 410 // Send all attributes of current calendar 405 411 CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer(); 412 //printf("myRank = %d, CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer OK\n", myRank); 406 413 407 414 // We have enough information to send to server 408 415 // First of all, send all enabled files 409 sendEnabledFiles(); 416 sendEnabledFiles(); //printf("myRank = %d, sendEnabledFiles OK\n", myRank); 410 417 411 418 // Then, send all enabled fields 412 sendEnabledFields(); 419 sendEnabledFields(); //printf("myRank = %d, sendEnabledFields OK\n", myRank); 413 420 414 421 // At last, we have all info of domain and axis, then send them 415 sendRefDomainsAxis(); 422 sendRefDomainsAxis(); //printf("myRank = %d, sendRefDomainsAxis OK\n", myRank); 416 423 417 424 // After that, send all grid (if any) 418 sendRefGrid(); 425 sendRefGrid(); //printf("myRank = %d, sendRefGrid OK\n", myRank); 419 426 } 420 427 421 428 // We have a xml tree on the server side and now, it should be also processed 422 if (hasClient && !hasServer) sendPostProcessing(); 429 if (hasClient && !hasServer) sendPostProcessing(); 423 430 424 431 // There are some processings that should be done after all of above. For example: check mask or index 425 432 if (hasClient) 426 433 { 427 this->buildFilterGraphOfEnabledFields(); 428 buildFilterGraphOfFieldsWithReadAccess(); 429 this->solveAllRefOfEnabledFields(true); 434 this->buildFilterGraphOfEnabledFields(); //printf("myRank = %d, buildFilterGraphOfEnabledFields OK\n", myRank); 435 buildFilterGraphOfFieldsWithReadAccess(); //printf("myRank = %d, buildFilterGraphOfFieldsWithReadAccess OK\n", myRank); 436 this->solveAllRefOfEnabledFields(true); //printf("myRank = %d, solveAllRefOfEnabledFields OK\n", myRank); 430 437 } 431 438 … … 434 441 435 442 // Nettoyage de l'arborescence 436 if (hasClient && !hasServer) CleanTree(); // Only on client side??443 if (hasClient && !hasServer) CleanTree(); 437 444 438 445 if (hasClient) 439 446 { 440 sendCreateFileHeader(); 441 442 startPrefetchingOfEnabledReadModeFiles(); 447 sendCreateFileHeader(); //printf("myRank = %d, sendCreateFileHeader OK\n", myRank); 448 449 startPrefetchingOfEnabledReadModeFiles(); //printf("myRank = %d, startPrefetchingOfEnabledReadModeFiles OK\n", myRank); 443 450 } 444 451 } … … 479 486 { 480 487 int size = this->enabledFiles.size(); 488 481 489 for (int i = 0; i < size; ++i) 482 490 { … … 566 574 { 567 575 const std::vector<CFile*> allFiles = CFile::getAll(); 568 const CDate& initDate = calendar->getInitDate();569 576 570 577 for (unsigned int i = 0; i < allFiles.size(); i++) … … 572 579 { 573 580 if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixé à vrai. 574 {575 if ((initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep()))576 {577 error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl578 << "Output frequency in file \""<<allFiles[i]->getFileOutputName()579 <<"\" is less than the time step. File will not be written."<<endl;580 }581 else582 581 enabledFiles.push_back(allFiles[i]); 583 }584 582 } 585 else 586 { 587 if ( (initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 588 { 589 error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl 590 << "Output frequency in file \""<<allFiles[i]->getFileOutputName() 591 <<"\" is less than the time step. File will not be written."<<endl; 592 } 593 else 594 enabledFiles.push_back(allFiles[i]); // otherwise true by default 595 } 583 else enabledFiles.push_back(allFiles[i]); // otherwise true by default 584 596 585 597 586 if (enabledFiles.size() == 0) … … 812 801 void CContext::postProcessing() 813 802 { 803 int myRank; 804 MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 805 806 //printf("myRank = %d, in postProcessing, isPostProcessed = %d\n", myRank, isPostProcessed); 814 807 if (isPostProcessed) return; 815 808 … … 820 813 ERROR("CContext::postProcessing()", << "A timestep must be defined for the context \"" << getId() << "!\"") 821 814 // Calendar first update to set the current date equals to the start date 822 calendar->update(0); 815 calendar->update(0); //printf("myRank = %d, calendar->update(0) OK\n", myRank); 823 816 824 817 // Find all inheritance in xml structure 825 this->solveAllInheritance(); 818 this->solveAllInheritance(); //printf("myRank = %d, this->solveAllInheritance OK\n", myRank); 826 819 827 820 // Check if some axis, domains or grids are eligible to for compressed indexed output. 828 821 // Warning: This must be done after solving the inheritance and before the rest of post-processing 829 checkAxisDomainsGridsEligibilityForCompressedOutput(); 822 checkAxisDomainsGridsEligibilityForCompressedOutput(); //printf("myRank = %d, checkAxisDomainsGridsEligibilityForCompressedOutput OK\n", myRank); 830 823 831 824 // Check if some automatic time series should be generated 832 825 // Warning: This must be done after solving the inheritance and before the rest of post-processing 833 prepareTimeseries(); 826 prepareTimeseries(); //printf("myRank = %d, prepareTimeseries OK\n", myRank); 834 827 835 828 //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers à sortir. 836 this->findEnabledFiles(); 837 this->findEnabledReadModeFiles(); 829 this->findEnabledFiles(); //printf("myRank = %d, this->findEnabledFiles OK\n", myRank); 830 this->findEnabledReadModeFiles(); //printf("myRank = %d, this->findEnabledReadModeFiles OK\n", myRank); 838 831 839 832 // Find all enabled fields of each file 840 this->findAllEnabledFields(); 841 this->findAllEnabledFieldsInReadModeFiles(); 833 this->findAllEnabledFields(); //printf("myRank = %d, this->findAllEnabledFields OK\n", myRank); 834 this->findAllEnabledFieldsInReadModeFiles(); //printf("myRank = %d, this->findAllEnabledFieldsInReadModeFiles OK\n", myRank); 842 835 843 836 if (hasClient && !hasServer) 844 837 { 845 838 // Try to read attributes of fields in file then fill in corresponding grid (or domain, axis) 846 this->readAttributesOfEnabledFieldsInReadModeFiles(); 839 this->readAttributesOfEnabledFieldsInReadModeFiles(); //printf("myRank = %d, this->readAttributesOfEnabledFieldsInReadModeFiles OK\n", myRank); 847 840 } 848 841 849 842 // Only search and rebuild all reference objects of enable fields, don't transform 850 this->solveOnlyRefOfEnabledFields(false); 843 this->solveOnlyRefOfEnabledFields(false); //printf("myRank = %d, this->solveOnlyRefOfEnabledFields(false) OK\n", myRank); 851 844 852 845 // Search and rebuild all reference object of enabled fields 853 this->solveAllRefOfEnabledFields(false); 846 this->solveAllRefOfEnabledFields(false); //printf("myRank = %d, this->solveAllRefOfEnabledFields(false) OK\n", myRank); 854 847 855 848 // Find all fields with read access from the public API 856 findFieldsWithReadAccess(); 849 findFieldsWithReadAccess(); //printf("myRank = %d, findFieldsWithReadAccess OK\n", myRank); 857 850 // and solve the all reference for them 858 solveAllRefOfFieldsWithReadAccess(); 851 solveAllRefOfFieldsWithReadAccess(); //printf("myRank = %d, solveAllRefOfFieldsWithReadAccess OK\n", myRank); 859 852 860 853 isPostProcessed = true; … … 1240 1233 event.push(*itRank,1,msg); 1241 1234 client->sendEvent(event); 1242 1243 1235 } 1236 else client->sendEvent(event); 1244 1237 } 1245 1238 -
XIOS/dev/branch_yushan/src/node/context.hpp
r1033 r1037 93 93 94 94 // Put sever or client into loop state 95 bool eventLoop(void); 96 95 97 bool checkBuffersAndListen(void); 96 98 -
XIOS/dev/branch_yushan/src/node/domain.cpp
r995 r1037 698 698 computeNGlobDomain(); 699 699 checkZoom(); 700 700 701 701 isDistributed_ = !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) || 702 702 (!i_index.isEmpty() && i_index.numElements() == ni_glo*nj_glo)); 703 704 // A stupid condition to make sure that if there is only one client, domain705 // should be considered to be distributed. This should be a temporary solution706 isDistributed_ |= (1 == CContext::getCurrent()->client->clientSize);707 703 } 708 704 … … 1307 1303 void CDomain::checkAttributesOnClientAfterTransformation() 1308 1304 { 1309 CContext* context=CContext::getCurrent() ; 1310 1305 int myRank; 1306 MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 1307 1308 CContext* context=CContext::getCurrent() ; //printf("myRank = %d, CContext::getCurrent OK\n", myRank); 1309 1310 //printf("myRank = %d, this->isClientAfterTransformationChecked = %d\n", myRank, this->isClientAfterTransformationChecked); 1311 1311 if (this->isClientAfterTransformationChecked) return; 1312 //printf("myRank = %d, context->hasClient = %d\n", myRank, context->hasClient); 1312 1313 if (context->hasClient) 1313 1314 { 1314 this->checkMask(); 1315 if (hasLonLat || hasArea || isCompressible_) this->computeConnectedServer(); 1316 if (hasLonLat) this->completeLonLatClient(); 1315 this->checkMask(); //printf("myRank = %d, this->checkMask OK\n", myRank); 1316 //printf("myRank = %d, hasLonLat = %d, hasArea = %d, isCompressible_ = %d\n", myRank, hasLonLat, hasArea, isCompressible_); 1317 if (hasLonLat || hasArea || isCompressible_) 1318 { 1319 //printf("myRank = %d, start this->computeConnectedServer\n", myRank); 1320 this->computeConnectedServer(); 1321 //printf("myRank = %d, this->computeConnectedServer OK\n", myRank); 1322 } 1323 //printf("myRank = %d, hasLonLat = %d\n", myRank, hasLonLat); 1324 if (hasLonLat) 1325 { 1326 this->completeLonLatClient(); 1327 //printf("myRank = %d, this->completeLonLatClient OK\n", myRank); 1328 } 1317 1329 } 1318 1330 … … 1448 1460 void CDomain::computeConnectedServer(void) 1449 1461 { 1462 int myRank; 1463 MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 1464 1450 1465 CContext* context=CContext::getCurrent() ; 1451 1466 CContextClient* client=context->client ; … … 1534 1549 } 1535 1550 } 1551 1536 1552 1537 1553 size_t globalSizeIndex = 1, indexBegin, indexEnd; … … 1555 1571 indexEnd = indexBegin + range - 1; 1556 1572 } 1557 1573 1558 1574 CServerDistributionDescription serverDescription(nGlobDomain_, nbServer); 1559 1575 if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0); 1560 1576 else serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1); 1561 1577 1578 //printf("myRank = %d, check 7 OK\n", myRank); 1579 1562 1580 CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), 1563 1581 client->intraComm); 1564 clientServerMap->computeServerIndexMapping(globalIndexDomain); 1582 //printf("myRank = %d new OK\n", myRank); 1583 1584 clientServerMap->computeServerIndexMapping(globalIndexDomain); 1585 //printf("myRank = %d, clientServerMap->computeServerIndexMapping(globalIndexDomain) OK\n", myRank); 1586 1565 1587 const CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer(); 1588 //printf("myRank = %d, clientServerMap->getGlobalIndexOnServer OK\n", myRank); 1589 1590 //printf("myRank = %d, check 8 OK\n", myRank); 1566 1591 1567 1592 CClientServerMapping::GlobalIndexMap::const_iterator it = globalIndexDomainOnServer.begin(), … … 1597 1622 } 1598 1623 1624 //printf("myRank = %d, check 9 OK\n", myRank); 1625 1599 1626 connectedServerRank_.clear(); 1600 1627 for (it = globalIndexDomainOnServer.begin(); it != ite; ++it) { … … 1605 1632 1606 1633 delete clientServerMap; 1634 //printf("myRank = %d, check 10 OK\n", myRank); 1607 1635 } 1608 1636 -
XIOS/dev/branch_yushan/src/node/field.cpp
r1018 r1037 36 36 , domAxisScalarIds_(vector<StdString>(3,"")), areAllReferenceSolved(false), isReferenceSolved(false) 37 37 , useCompressedOutput(false) 38 , hasTimeInstant(false) 39 , hasTimeCentered(false) 40 , wasDataAlreadyReceivedFromServer(false) 41 , isEOF(false) 38 , isReadDataRequestPending(false) 42 39 { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } 43 40 … … 50 47 , domAxisScalarIds_(vector<StdString>(3,"")), areAllReferenceSolved(false), isReferenceSolved(false) 51 48 , useCompressedOutput(false) 52 , hasTimeInstant(false) 53 , hasTimeCentered(false) 54 , wasDataAlreadyReceivedFromServer(false) 55 , isEOF(false) 49 , isReadDataRequestPending(false) 56 50 { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } 57 51 … … 253 247 } 254 248 255 bool CField::sendReadDataRequest(const CDate& tsDataRequested)249 void CField::sendReadDataRequest(void) 256 250 { 257 251 CContext* context = CContext::getCurrent(); 258 252 CContextClient* client = context->client; 259 253 260 lastDataRequestedFromServer = tsDataRequested; 261 262 if (!isEOF) // No need to send the request if we already know we are at EOF 263 { 264 CEventClient event(getType(), EVENT_ID_READ_DATA); 265 if (client->isServerLeader()) 266 { 267 CMessage msg; 268 msg << getId(); 269 const std::list<int>& ranks = client->getRanksServerLeader(); 270 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 271 event.push(*itRank, 1, msg); 272 client->sendEvent(event); 273 } 274 else client->sendEvent(event); 275 } 276 else 277 serverSourceFilter->signalEndOfStream(tsDataRequested); 278 279 return !isEOF; 254 lastDataRequestedFromServer = context->getCalendar()->getCurrentDate(); 255 isReadDataRequestPending = true; 256 257 CEventClient event(getType(), EVENT_ID_READ_DATA); 258 if (client->isServerLeader()) 259 { 260 CMessage msg; 261 msg << getId(); 262 const std::list<int>& ranks = client->getRanksServerLeader(); 263 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 264 event.push(*itRank, 1, msg); 265 client->sendEvent(event); 266 } 267 else client->sendEvent(event); 280 268 } 281 269 … … 288 276 const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate(); 289 277 290 bool dataRequested = false;291 292 while (currentDate >= lastDataRequestedFromServer)293 { 294 info(20) << "currentDate : " << currentDate <<endl ;295 info(20) << "lastDataRequestedFromServer : " << lastDataRequestedFromServer <<endl ;296 info(20) << "file->output_freq.getValue() : " << file->output_freq.getValue() <<endl ;297 info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq <<endl ;298 299 dataRequested |= sendReadDataRequest(lastDataRequestedFromServer + file->output_freq);300 } 301 302 return dataRequested;278 bool requestData = (currentDate >= lastDataRequestedFromServer + file->output_freq.getValue()); 279 280 if (requestData) 281 { 282 cout<<"currentDate : "<<currentDate<<endl ; 283 cout<<"lastDataRequestedFromServer : "<<lastDataRequestedFromServer<<endl ; 284 cout<<"file->output_freq.getValue() : "<<file->output_freq.getValue()<<endl ; 285 cout<<"lastDataRequestedFromServer + file->output_freq.getValue() : "<<lastDataRequestedFromServer + file->output_freq.getValue()<<endl ; 286 287 sendReadDataRequest(); 288 } 289 290 return requestData; 303 291 } 304 292 … … 322 310 323 311 map<int, CArray<double,1> >::iterator it; 324 if (!grid->doGridHaveDataDistributed()) 325 { 326 if (client->isServerLeader()) 327 { 328 if (!data_srv.empty()) 329 { 330 it = data_srv.begin(); 331 const std::list<int>& ranks = client->getRanksServerLeader(); 332 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 333 { 334 msgs.push_back(CMessage()); 335 CMessage& msg = msgs.back(); 336 msg << getId(); 337 if (hasData) 338 msg << getNStep() - 1 << it->second; 339 else 340 msg << int(-1); 341 event.push(*itRank, 1, msg); 342 } 343 } 344 client->sendEvent(event); 345 } 346 else 347 { 348 // if (!data_srv.empty()) 349 // { 350 // it = data_srv.begin(); 351 // const std::list<int>& ranks = client->getRanksServerNotLeader(); 352 // for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 353 // { 354 // msgs.push_back(CMessage()); 355 // CMessage& msg = msgs.back(); 356 // msg << getId(); 357 // if (hasData) 358 // msg << getNStep() - 1 << it->second; 359 // else 360 // msg << int(-1); 361 // event.push(*itRank, 1, msg); 362 // } 363 // } 364 client->sendEvent(event); 365 } 366 } 367 else 368 { 369 for (it = data_srv.begin(); it != data_srv.end(); it++) 370 { 371 msgs.push_back(CMessage()); 372 CMessage& msg = msgs.back(); 373 msg << getId(); 374 if (hasData) 375 msg << getNStep() - 1 << it->second; 376 else 377 msg << int(-1); 378 event.push(it->first, grid->nbSenders[it->first], msg); 379 } 380 client->sendEvent(event); 381 } 312 for (it = data_srv.begin(); it != data_srv.end(); it++) 313 { 314 msgs.push_back(CMessage()); 315 CMessage& msg = msgs.back(); 316 msg << getId(); 317 if (hasData) 318 msg << getNStep() - 1 << it->second; 319 else 320 msg << int(-1); 321 event.push(it->first, grid->nbSenders[it->first], msg); 322 } 323 client->sendEvent(event); 382 324 } 383 325 … … 402 344 this->incrementNStep(); 403 345 346 347 404 348 if (getNStep() > nstepMax && (getRelFile()->cyclic.isEmpty() || !getRelFile()->cyclic) ) 405 349 return false; … … 435 379 std::map<int, CArray<double,1> > data; 436 380 381 bool isEOF = false; 382 437 383 for (int i = 0; i < ranks.size(); i++) 438 384 { … … 447 393 } 448 394 449 if ( wasDataAlreadyReceivedFromServer)450 lastDataReceivedFromServer = lastDataReceivedFromServer + file->output_freq;395 if (isEOF) 396 serverSourceFilter->signalEndOfStream(lastDataRequestedFromServer); 451 397 else 452 { 453 lastDataReceivedFromServer = context->getCalendar()->getInitDate(); 454 wasDataAlreadyReceivedFromServer = true; 455 } 456 457 if (isEOF) 458 serverSourceFilter->signalEndOfStream(lastDataReceivedFromServer); 459 else 460 serverSourceFilter->streamDataFromServer(lastDataReceivedFromServer, data); 398 serverSourceFilter->streamDataFromServer(lastDataRequestedFromServer, data); 399 400 isReadDataRequestPending = false; 461 401 } 462 402 … … 681 621 void CField::solveAllReferenceEnabledField(bool doSending2Server) 682 622 { 683 CContext* context = CContext::getCurrent(); 684 solveOnlyReferenceEnabledField(doSending2Server); 623 int myRank; 624 MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 625 626 CContext* context = CContext::getCurrent(); //printf("my_Rank = %d, CContext* context = CContext::getCurrent OK\n", myRank); 627 solveOnlyReferenceEnabledField(doSending2Server); //printf("my_Rank = %d, solveOnlyReferenceEnabledField(doSending2Server) OK\n", myRank); 685 628 686 629 if (!areAllReferenceSolved) … … 690 633 if (context->hasClient) 691 634 { 692 solveRefInheritance(true); 693 if (hasDirectFieldReference()) getDirectFieldReference()->solveAllReferenceEnabledField(false); 635 solveRefInheritance(true); //printf("my_Rank = %d, solveRefInheritance(true) OK\n", myRank); 636 if (hasDirectFieldReference()) 637 { 638 getDirectFieldReference()->solveAllReferenceEnabledField(false); 639 //printf("my_Rank = %d, getDirectFieldReference()->solveAllReferenceEnabledField(false) OK\n", myRank); 640 } 694 641 } 695 642 else if (context->hasServer) 643 { 696 644 solveServerOperation(); 697 698 solveGridReference(); 699 } 700 701 solveGridDomainAxisRef(doSending2Server); 645 //printf("my_Rank = %d, solveServerOperation OK\n", myRank); 646 } 647 648 solveGridReference(); //printf("my_Rank = %d, solveGridReference OK\n", myRank); 649 } 650 651 solveGridDomainAxisRef(doSending2Server); //printf("my_Rank = %d, solveGridDomainAxisRef(doSending2Server) OK\n", myRank); 702 652 703 653 if (context->hasClient) 704 654 { 705 solveTransformedGrid(); 706 } 707 708 solveCheckMaskIndex(doSending2Server); 655 solveTransformedGrid(); //printf("my_Rank = %d, solveTransformedGrid OK\n", myRank); 656 } 657 658 solveCheckMaskIndex(doSending2Server); //printf("FIELD.CPP: my_Rank = %d, solveCheckMaskIndex(doSending2Server) OK\n", myRank); 709 659 } 710 660 … … 783 733 { 784 734 // Check if we have an expression to parse 785 if (hasExpression()) 786 { 787 boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0')); 788 boost::shared_ptr<COutputPin> filter = expr->reduce(gc, *this); 789 790 // Check if a spatial transformation is needed 791 if (!field_ref.isEmpty()) 792 { 793 CGrid* gridRef = CField::get(field_ref)->grid; 794 795 if (grid && grid != gridRef && grid->hasTransform()) 796 { 797 bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 798 double defaultValue = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 799 std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, hasMissingValue, defaultValue); 800 801 filter->connectOutput(filters.first, 0); 802 filter = filters.second; 803 } 804 } 805 806 instantDataFilter = filter; 735 if (!content.empty()) 736 { 737 boost::scoped_ptr<IFilterExprNode> expr(parseExpr(content + '\0')); 738 instantDataFilter = expr->reduce(gc, *this); 807 739 } 808 740 // Check if we have a reference on another field … … 811 743 // Check if the data is to be read from a file 812 744 else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 813 instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 814 freq_offset.isEmpty() ? NoneDu : freq_offset, 815 true)); 745 instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid, 746 freq_offset.isEmpty() ? NoneDu : freq_offset)); 816 747 else // The data might be passed from the model 817 { 818 bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 819 double defaultValue = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 820 instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 821 ignoreMissingValue, defaultValue)); } 748 instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid)); 822 749 } 823 750 … … 858 785 // Check if a spatial transformation is needed 859 786 if (grid && grid != fieldRef->grid && grid->hasTransform()) 860 { 861 bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 862 double defaultValue = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 863 filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue); 864 } 787 { 788 double defaultValue = 0.0; 789 if (!default_value.isEmpty()) defaultValue = this->default_value; 790 filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, defaultValue); 791 } 792 865 793 else 866 794 filters.first = filters.second = boost::shared_ptr<CFilter>(new CPassThroughFilter(gc)); … … 882 810 boost::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc) 883 811 { 884 if (instantDataFilter || !hasExpression())812 if (instantDataFilter || content.empty()) 885 813 ERROR("COutputPin* CField::getSelfReference(CGarbageCollector& gc)", 886 814 "Impossible to add a self reference to a field which has already been parsed or which does not have an expression."); … … 891 819 { 892 820 if (!serverSourceFilter) 893 serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 894 freq_offset.isEmpty() ? NoneDu : freq_offset, 895 true)); 821 serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid, 822 freq_offset.isEmpty() ? NoneDu : freq_offset)); 896 823 897 824 selfReferenceFilter = serverSourceFilter; 898 825 } 899 826 else if (!field_ref.isEmpty()) 900 { 901 CField* fieldRef = CField::get(field_ref); 902 fieldRef->buildFilterGraph(gc, false); 903 selfReferenceFilter = fieldRef->getInstantDataFilter(); 904 } 827 selfReferenceFilter = getFieldReference(gc); 905 828 else 906 829 { 907 830 if (!clientSourceFilter) 908 { 909 bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 910 double defaultValue = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 911 clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 912 ignoreMissingValue, defaultValue)); 913 } 831 clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid)); 914 832 915 833 selfReferenceFilter = clientSourceFilter; … … 945 863 946 864 const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 947 865 948 866 boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 949 867 CContext::getCurrent()->getCalendar()->getInitDate(), … … 957 875 return it->second; 958 876 } 959 960 /*!961 * Returns the temporal filter corresponding to the field's temporal operation962 * for the specified operation frequency.963 *964 * \param gc the garbage collector to use965 * \param outFreq the operation frequency, i.e. the frequency at which the output data will be computed966 * \return the output pin corresponding to the requested temporal filter967 */968 969 boost::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)970 {971 if (instantDataFilter || !hasExpression())972 ERROR("COutputPin* CField::getSelfTemporalDataFilter(CGarbageCollector& gc)",973 "Impossible to add a self reference to a field which has already been parsed or which does not have an expression.");974 975 if (!selfReferenceFilter) getSelfReference(gc) ;976 977 if (serverSourceFilter || clientSourceFilter)978 {979 if (operation.isEmpty())980 ERROR("void CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)",981 << "An operation must be defined for field \"" << getId() << "\".");982 983 if (freq_op.isEmpty()) freq_op.setValue(TimeStep);984 if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu);985 986 const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);987 988 boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation,989 CContext::getCurrent()->getCalendar()->getInitDate(),990 freq_op, freq_offset, outFreq,991 ignoreMissingValue, ignoreMissingValue ? default_value : 0.0));992 selfReferenceFilter->connectOutput(temporalFilter, 0);993 return temporalFilter ;994 }995 else if (!field_ref.isEmpty())996 {997 CField* fieldRef = CField::get(field_ref);998 fieldRef->buildFilterGraph(gc, false);999 return fieldRef->getTemporalDataFilter(gc, outFreq) ;1000 }1001 }1002 877 1003 878 //---------------------------------------------------------------- … … 1153 1028 else if (grid && grid->hasTransform() && !grid->isTransformed()) 1154 1029 { 1155 // Temporarily deactivate the self-transformation of grid 1156 //grid->transformGrid(grid); 1030 grid->transformGrid(grid); 1157 1031 } 1158 1032 } … … 1430 1304 } 1431 1305 1432 /*!1433 * Returns string arithmetic expression associated to the field.1434 * \return if content is defined return content string, otherwise, if "expr" attribute is defined, return expr string.1435 */1436 const string& CField::getExpression(void)1437 {1438 if (!expr.isEmpty() && content.empty())1439 {1440 content = expr;1441 expr.reset();1442 }1443 1444 return content;1445 }1446 1447 bool CField::hasExpression(void) const1448 {1449 return (!expr.isEmpty() || !content.empty());1450 }1451 1452 1306 DEFINE_REF_FUNC(Field,field) 1453 1307 } // namespace xios -
XIOS/dev/branch_yushan/src/node/field.hpp
r1017 r1037 124 124 boost::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc); 125 125 boost::shared_ptr<COutputPin> getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq); 126 boost::shared_ptr<COutputPin> getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq);127 126 128 127 // virtual void fromBinary(StdIStream& is); … … 143 142 void recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers); 144 143 void writeField(void); 145 bool sendReadDataRequest(const CDate& tsDataRequested);144 void sendReadDataRequest(void); 146 145 bool sendReadDataRequestIfNeeded(void); 147 146 static void recvReadDataRequest(CEventServer& event); … … 179 178 const std::vector<StdString>& getRefDomainAxisIds(); 180 179 181 const string& getExpression(void);182 bool hasExpression(void) const;183 184 180 public: 185 181 /// Propriétés privées /// … … 195 191 bool isEOF; 196 192 CDate lastlast_Write_srv, last_Write_srv, last_operation_srv; 197 CDate lastDataRequestedFromServer, lastDataReceivedFromServer; 198 bool wasDataAlreadyReceivedFromServer; 193 CDate lastDataRequestedFromServer; 199 194 200 195 map<int,boost::shared_ptr<func::CFunctor> > foperation_srv; … … 206 201 bool isReferenceSolved; 207 202 std::vector<StdString> domAxisScalarIds_; 203 bool isReadDataRequestPending; 208 204 bool useCompressedOutput; 209 210 // Two variable to identify the time_counter meta data written in file, which has no time_counter211 bool hasTimeInstant;212 bool hasTimeCentered;213 205 214 206 DECLARE_REF_FUNC(Field,field) -
XIOS/dev/branch_yushan/src/node/field_impl.hpp
r1007 r1037 19 19 { 20 20 if (clientSourceFilter) 21 { 21 22 clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data); 22 else if (instantDataFilter) 23 } 24 else if (!field_ref.isEmpty() || !content.empty()) 23 25 ERROR("void CField::setData(const CArray<double, N>& _data)", 24 26 << "Impossible to receive data from the model for a field [ id = " << getId() << " ] with a reference or an arithmetic operation."); -
XIOS/dev/branch_yushan/src/node/file.cpp
r1013 r1037 17 17 #include "mpi.hpp" 18 18 19 19 20 namespace xios { 20 21 … … 29 30 setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); 30 31 } 32 33 31 34 32 35 CFile::CFile(const StdString & id) … … 38 41 setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); 39 42 } 43 40 44 41 45 CFile::~CFile(void) … … 235 239 const int recordOffset = record_offset.isEmpty() ? 0 : record_offset; 236 240 237 // set<CAxis*> setAxis; 238 // set<CDomain*> setDomains; 239 set<StdString> setAxis; 240 set<StdString> setDomains; 241 241 set<CAxis*> setAxis; 242 set<CDomain*> setDomains; 243 242 244 std::vector<CField*>::iterator it, end = this->enabledFields.end(); 243 245 for (it = this->enabledFields.begin(); it != end; it++) … … 247 249 std::vector<CAxis*> vecAxis = field->grid->getAxis(); 248 250 for (size_t i = 0; i < vecAxis.size(); ++i) 249 setAxis.insert(vecAxis[i]->getAxisOutputName()); 250 // setAxis.insert(vecAxis[i]); 251 setAxis.insert(vecAxis[i]); 251 252 std::vector<CDomain*> vecDomains = field->grid->getDomains(); 252 253 for (size_t i = 0; i < vecDomains.size(); ++i) 253 setDomains.insert(vecDomains[i]->getDomainOutputName()); 254 // setDomains.insert(vecDomains[i]); 254 setDomains.insert(vecDomains[i]); 255 255 256 256 field->resetNStep(recordOffset); … … 264 264 if (allDomainEmpty) MPI_Comm_free(&fileComm); 265 265 266 //if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered);266 if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered); 267 267 if (time_counter_name.isEmpty()) time_counter_name = "time_counter"; 268 268 } … … 375 375 if (pos2!=std::string::npos) 376 376 { 377 middlePart=filename.substr(pos1,pos2-pos1) ; 377 middlePart=filename.substr(pos1,pos2-pos1) ; 378 cout<<pos2<<endl ; 378 379 pos2+=strEndDate.size() ; 379 380 lastPart=filename.substr(pos2,filename.size()-pos2) ; … … 580 581 this->data_in->closeFile(); 581 582 } 583 582 584 if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm); 585 583 586 } 584 587 //---------------------------------------------------------------- … … 715 718 { 716 719 int size = this->enabledFields.size(); 720 717 721 for (int i = 0; i < size; ++i) 718 722 { … … 745 749 int size = this->enabledFields.size(); 746 750 for (int i = 0; i < size; ++i) 747 this->enabledFields[i]->sendReadDataRequest( CContext::getCurrent()->getCalendar()->getCurrentDate());751 this->enabledFields[i]->sendReadDataRequest(); 748 752 } 749 753 -
XIOS/dev/branch_yushan/src/node/file.hpp
r957 r1037 12 12 #include "attribute_enum_impl.hpp" 13 13 #include "mpi.hpp" 14 #ifdef _usingEP 15 #include "ep_declaration.hpp" 16 #endif 14 17 15 18 namespace xios { -
XIOS/dev/branch_yushan/src/node/grid.cpp
r1008 r1037 166 166 void CGrid::checkAttributesAfterTransformation() 167 167 { 168 setAxisList(); 169 std::vector<CAxis*> axisListP = this->getAxis(); 168 int myRank; 169 MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 170 171 setAxisList(); //printf("myRank = %d, setAxisList OK\n", myRank); 172 std::vector<CAxis*> axisListP = this->getAxis(); //printf("myRank = %d, this->getAxis OK\n", myRank); 170 173 if (!axisListP.empty()) 171 174 { 172 175 int idx = 0; 173 176 axisPositionInGrid_.resize(0); 177 174 178 for (int i = 0; i < axis_domain_order.numElements(); ++i) 175 179 { … … 179 183 axisPositionInGrid_.push_back(idx); 180 184 ++idx; 185 //printf("myRank = %d, axisPositionInGrid_.push_back OK\n", myRank); 181 186 } 182 187 else if (2 == elementDimension) idx += 2; … … 186 191 { 187 192 axisListP[i]->checkAttributesOnClientAfterTransformation(globalDim_,axisPositionInGrid_[i]); 188 } 189 } 190 191 setDomainList(); 192 std::vector<CDomain*> domListP = this->getDomains(); 193 //printf("myRank = %d, axisListP[%d/%d]->checkAttributesOnClientAfterTransformation OK\n", myRank, i, axisListP.size()); 194 } 195 } 196 197 setDomainList(); //printf("myRank = %d, setDomainList OK\n", myRank); 198 std::vector<CDomain*> domListP = this->getDomains(); //printf("myRank = %d, this->getDomains OK\n", myRank); 193 199 if (!domListP.empty()) 194 200 { 195 201 for (int i = 0; i < domListP.size(); ++i) 196 202 { 203 //printf("myRank = %d, start domListP[%d]->checkAttributesOnClientAfterTransformation\n", myRank, i); 197 204 domListP[i]->checkAttributesOnClientAfterTransformation(); 205 //printf("myRank = %d, domListP[%d]->checkAttributesOnClientAfterTransformation OK\n", myRank, i); 198 206 } 199 207 } … … 272 280 void CGrid::checkMaskIndex(bool doSendingIndex) 273 281 { 274 CContext* context = CContext::getCurrent(); 282 int myRank; 283 MPI_Comm_rank(MPI_COMM_WORLD, &myRank); 284 285 CContext* context = CContext::getCurrent(); 275 286 CContextClient* client=context->client; 276 287 … … 278 289 { 279 290 if (context->hasClient) 280 if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndexScalarGrid(); this->isIndexSent = true; } 291 if (this->isChecked && doSendingIndex && !isIndexSent) 292 { 293 sendIndexScalarGrid(); 294 this->isIndexSent = true; 295 } 281 296 282 297 if (this->isChecked) return; 283 284 298 if (context->hasClient) 285 299 { … … 287 301 } 288 302 289 if (!(this->hasTransform() && !this->isTransformed())) 290 this->isChecked = true; 303 this->isChecked = true; 291 304 return; 292 305 } 293 306 294 307 if (context->hasClient) 295 if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndex(); this->isIndexSent = true; } 308 if (this->isChecked && doSendingIndex && !isIndexSent) 309 { 310 sendIndex(); 311 this->isIndexSent = true; 312 } 296 313 297 314 if (this->isChecked) return; … … 299 316 if (context->hasClient) 300 317 { 301 this->checkAttributesAfterTransformation(); 302 this->checkMask(); 303 this->computeIndex(); 318 this->checkAttributesAfterTransformation(); 319 this->checkMask(); 320 this->computeIndex(); 304 321 } 305 306 if (!(this->hasTransform() && !this->isTransformed())) 307 this->isChecked = true; 308 309 if (!(this->hasTransform() && (!this->isGenerated()))) 310 this->isChecked = true; 322 this->isChecked = true; 311 323 } 312 324 … … 1051 1063 int rank = *itRank; 1052 1064 int nb = 1; 1053 storeIndex_toSrv.insert(std::make_pair(rank, CArray<int,1>(nb))); 1065 storeIndex_toSrv.insert(std::make_pair(rank, CArray<int,1>(nb))); 1054 1066 listOutIndex.push_back(CArray<size_t,1>(nb)); 1055 1067 … … 1063 1075 } 1064 1076 1065 storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer)));1066 1077 listMsg.push_back(CMessage()); 1067 1078 listMsg.back() << getId( )<< isDataDistributed_ << isCompressible_ << listOutIndex.back(); … … 1072 1083 } 1073 1084 else 1074 {1075 const std::list<int>& ranks = client->getRanksServerNotLeader();1076 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)1077 {1078 int rank = *itRank;1079 int nb = 1;1080 storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(nb)));1081 CArray<int, 1>& outLocalIndexToServer = storeIndex_fromSrv[rank];1082 for (int k = 0; k < nb; ++k)1083 {1084 outLocalIndexToServer(k) = 0;1085 }1086 }1087 1085 client->sendEvent(event); 1088 }1089 1086 } 1090 1087 … … 1114 1111 outLocalIndexToServer(idx) = itIndex->second; 1115 1112 } 1116 1113 1114 //int nbClient = client->clientSize; // This stupid variable signals the servers the number of client connect to them 1117 1115 const std::list<int>& ranks = client->getRanksServerLeader(); 1118 1116 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 1119 1117 { 1120 1118 storeIndex_toSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer))); 1121 storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));1122 1119 listOutIndex.push_back(CArray<size_t,1>(outGlobalIndexOnServer)); 1123 1120 … … 1129 1126 client->sendEvent(event); 1130 1127 } 1131 else 1132 { 1133 int indexSize = globalLocalIndexSendToServer.size(); 1134 CArray<int,1> outLocalIndexToServer(indexSize); 1135 for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx) 1136 { 1137 outLocalIndexToServer(idx) = itIndex->second; 1138 } 1139 1140 const std::list<int>& ranks = client->getRanksServerNotLeader(); 1141 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 1142 { 1143 storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer))); 1144 } 1128 else 1145 1129 client->sendEvent(event); 1146 }1147 1130 } 1148 1131 else … … 1177 1160 nb = globalIndexTmp[rank].size(); 1178 1161 1179 storeIndex_toSrv.insert(make_pair(rank, CArray<int,1>(nb))); 1162 storeIndex_toSrv.insert(make_pair(rank, CArray<int,1>(nb))); 1180 1163 listOutIndex.push_back(CArray<size_t,1>(nb)); 1181 1164 … … 1189 1172 } 1190 1173 1191 storeIndex_fromSrv.insert(make_pair(rank, CArray<int,1>(outLocalIndexToServer)));1192 1174 listMsg.push_back(CMessage()); 1193 1175 listMsg.back() << getId() << isDataDistributed_ << isCompressible_ << listOutIndex.back(); -
XIOS/dev/branch_yushan/src/node/grid.hpp
r988 r1037 221 221 222 222 map<int, CArray<int, 1> > storeIndex_toSrv; 223 map<int, CArray<int, 1> > storeIndex_fromSrv;224 223 map<int,int> nbSenders; 225 224 -
XIOS/dev/branch_yushan/src/node/interpolate_domain.cpp
r1014 r1037 48 48 } 49 49 50 if (this->mode.isEmpty()) this->mode.setValue(mode_attr::compute); 51 if (this->write_weight.isEmpty()) this->write_weight.setValue(false); 50 StdString weightFile = "interpolation_weights_" + domainSrc->getDomainOutputName(); 52 51 53 StdString weightFile; 54 switch (this->mode) 55 { 56 case mode_attr::read: 57 if (this->weight_filename.isEmpty()) 58 { 59 if (!this->write_weight) 52 if (!this->mode.isEmpty()) 53 { 54 if (mode_attr::read == this->mode) 55 { 56 if (this->file.isEmpty()) 57 { 60 58 ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)", 61 59 << "Read mode is activated but there is no file specified." << std::endl 62 60 << "Please define a correct file containing interpolation weights with option 'file'. "); 63 } 64 else 65 { 66 weightFile = this->weight_filename; 67 ifstream f(weightFile.c_str()); 68 if (!f.good()) 69 ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)", 70 << "Read mode is activated but file " << weightFile << " doesn't exist." << std::endl 71 << "Please check this file "); 72 } 73 break; 74 case mode_attr::compute: 75 break; 76 case mode_attr::read_or_compute: 77 if (!this->weight_filename.isEmpty() && !this->write_weight) 78 { 79 weightFile = this->weight_filename; 80 ifstream f(weightFile.c_str()); 81 if (!f.good()) 82 ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)", 83 << "read_or_compute mode is activated but file " << weightFile << " doesn't exist." << std::endl 84 << "Please check this file "); 85 } 86 break; 87 default: 88 break; 61 } 62 else 63 { 64 weightFile = this->file; 65 ifstream f(weightFile.c_str()); 66 if (!f.good()) 67 ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)", 68 << "Read mode is activated but file " << weightFile << " doesn't exist." << std::endl 69 << "Please check this file "); 70 } 71 } 72 else 73 { 74 if (file.isEmpty()) 75 this->file.setValue(weightFile); 76 } 77 } 78 else 79 { 80 if (!file.isEmpty()) // set mode read 81 { 82 weightFile = this->file; 83 ifstream f(weightFile.c_str()); 84 if (!f.good()) // file doesn't exist 85 this->mode.setValue(mode_attr::write); 86 else 87 this->mode.setValue(mode_attr::read); 88 } 89 else // only calculate weights() Mode set write but there is no file) 90 { 91 this->mode.setValue(mode_attr::write); 92 } 89 93 } 90 94 -
XIOS/dev/branch_yushan/src/node/interpolate_domain.hpp
r1004 r1037 50 50 virtual ~CInterpolateDomain(void); 51 51 52 virtual void checkValid(CDomain* domainSource);52 virtual void checkValid(CDomain* axisDest); 53 53 54 54 /// Accesseurs statiques /// -
XIOS/dev/branch_yushan/src/node/mesh.cpp
r1002 r1037 11 11 /// ////////////////////// Définitions ////////////////////// /// 12 12 13 CMesh::CMesh(void) : nbNodesGlo (0), nbEdgesGlo(0)14 , node_start (0), node_count(0)15 , edge_start (0), edge_count(0)16 , nbFaces_ (0), nbNodes_(0), nbEdges_(0)17 , nodesAreWritten (false), edgesAreWritten(false), facesAreWritten(false)13 CMesh::CMesh(void) : nbNodesGlo{0}, nbEdgesGlo{0} 14 , node_start{0}, node_count{0} 15 , edge_start{0}, edge_count{0} 16 , nbFaces_{0}, nbNodes_{0}, nbEdges_{0} 17 , nodesAreWritten{false}, edgesAreWritten{false}, facesAreWritten{false} 18 18 , node_lon(), node_lat() 19 19 , edge_lon(), edge_lat(), edge_nodes() 20 20 , face_lon(), face_lat() 21 21 , face_nodes() 22 , pNodeGlobalIndex (NULL), pEdgeGlobalIndex(NULL)22 , pNodeGlobalIndex{NULL}, pEdgeGlobalIndex{NULL} 23 23 { 24 24 } … … 91 91 seed ^= sizetHash(first) + 0x9e3779b9 + (seed << 6) + (seed >> 2); 92 92 } 93 return seed ; 94 } 95 96 ///---------------------------------------------------------------- 97 /*! 98 * \fn size_t generateEdgeIndex(size_t first, size_t second, int rank) 99 * Generates an edge index. 100 * If the same edge is generated by two processes, each process will have its own edge index. 101 * \param [in] first Edge node. 102 * \param [in] second Edge node. 103 * \param [in] rank MPI process rank. 104 */ 105 size_t generateEdgeIndex(size_t first, size_t second, int rank) 106 { 107 size_t seed = rank ; 108 if (first < second) 109 { 110 seed = hashPair(seed, first); 111 seed = hashPair(seed, second); 112 } 113 else 114 { 115 seed = hashPair(seed, second); 116 seed = hashPair(seed, first); 117 } 118 93 119 return seed ; 94 120 } … … 115 141 return seed ; 116 142 } 117 118 ///----------------------------------------------------------------119 /*!120 * \fn size_t generateNodeIndex(vector<size_t>& valList)121 * Generates a node index unique for all processes.122 * \param [in] valList Vector storing four node hashes.123 */124 size_t generateNodeIndex(vector<size_t>& valList)125 {126 // Sort is needed to avoid problems for nodes with lon = 0 generated by faces in east and west semisphere127 vector<size_t> vec = valList;128 sort (vec.begin(), vec.end());129 size_t seed = vec[0] ;130 int it = 1;131 for(; it != vec.size(); ++it)132 {133 seed = hashPair(seed, vec[it]);134 }135 return seed ;136 }137 138 143 139 144 ///---------------------------------------------------------------- … … 595 600 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeHash2Idx; 596 601 CArray<size_t,1> nodeHashList(nbEdges_*nvertex*4); 597 int nbHash = 0;598 602 for (int ne = 0; ne < nbEdges_; ++ne) 599 603 { … … 605 609 if (nodeHash2Idx[hashValues[nh]].size() == 0) 606 610 { 607 nodeHash2Idx[hashValues[nh]].push_back(generateNodeIndex(hashValues ));611 nodeHash2Idx[hashValues[nh]].push_back(generateNodeIndex(hashValues, mpiRank)); 608 612 nodeHash2Idx[hashValues[nh]].push_back(mpiRank); 609 nodeHashList(nbHash) = hashValues[nh];610 ++nbHash;611 613 } 612 }613 }614 }615 nodeHashList.resizeAndPreserve(nbHash);614 nodeHashList((ne*nvertex + nv)*4 + nh) = hashValues[nh]; 615 } 616 } 617 } 616 618 617 619 // (2.2) Generating global node indexes 618 // The ownership criterion: priority of the process ofsmaller index620 // The ownership criterion: priority of the process holding the smaller index 619 621 // Maps generated in this step are: 620 // Maps generated in this step are: 621 // nodeHash2Info = <hash, [[idx, rankMin], [idx, rank1], [idx, rank3]..]> 622 // nodeIdx2Idx = <idx, <rankOwner, idx>> 623 624 CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); 625 dhtNodeHash.computeIndexInfoMapping(nodeHashList); 626 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 627 628 629 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2Idx; 630 CArray<size_t,1> nodeIdxList(nbEdges_*nvertex*4); 631 size_t nIdx = 0; 632 633 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 634 { 635 size_t rankMin = (it->second)[1]; 636 size_t idx = (it->second)[0]; 637 for (int i = 2; i < (it->second).size();) 638 { 639 if ( (it->second)[i+1] < rankMin) 640 { 641 idx = (it->second)[i]; 642 rankMin = (it->second)[i+1]; 643 (it->second)[i+1] = (it->second)[i-1]; 644 } 645 i += 2; 646 } 647 if (nodeIdx2Idx.count(idx) == 0) 648 { 649 if (mpiRank == rankMin) 650 { 651 nodeIdx2Idx[idx].push_back(rankMin); 652 nodeIdx2Idx[idx].push_back(idx); 653 } 654 nodeIdxList(nIdx) = idx; 655 ++nIdx; 656 } 657 } 658 nodeIdxList.resizeAndPreserve(nIdx); 659 660 // CDHTAutoIndexing will not give consistent node numbering for varying number of procs. => 661 // Solution: global node indexing by hand. 662 // Maps modified in this step: 663 // nodeIdx2Idx = <idx, idxGlo> 664 int nodeCount = nodeIdx2Idx.size(); 665 int nodeStart, nbNodes; 666 MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 667 int nNodes = nodeStart; 668 MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 669 nbNodesGlo = nNodes; 670 671 nodeStart -= nodeCount; 672 node_start = nodeStart; 673 node_count = nodeCount; 674 CClientClientDHTSizet::Index2VectorInfoTypeMap dummyMap; // just a dummy map used to ensure that each node is numbered only once 675 size_t count = 0; 676 677 for (int ne = 0; ne < nbEdges_; ++ne) 678 { 679 for (int nv = 0; nv < nvertex; ++nv) 680 { 681 vector<size_t> hashValues = CMesh::createHashes(bounds_lon(nv, ne), bounds_lat(nv, ne)); 682 size_t nodeIdx = generateNodeIndex(hashValues); 683 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeIdx2Idx.find(nodeIdx); 684 if (it != nodeIdx2Idx.end()) 685 { 686 if (dummyMap.count(nodeIdx) == 0) 687 { 688 dummyMap[nodeIdx].push_back(nodeIdx); 689 (it->second)[1] = node_start + count; 690 ++count; 691 } 692 } 693 } 694 } 695 696 CClientClientDHTSizet dhtNodeIdx(nodeIdx2Idx, comm); 697 dhtNodeIdx.computeIndexInfoMapping(nodeIdxList); 698 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdx2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 622 // nodeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 623 // nodeIdx2IdxMin = <idx, idxMin> 624 // nodeIdx2IdxGlo = <idxMin, idxMin> 625 626 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxMin; 627 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxGlo; 628 CArray<size_t,1> nodeIdxMinList(nbEdges_*nvertex); 629 630 CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); 631 dhtNodeHash.computeIndexInfoMapping(nodeHashList); 632 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 633 size_t iIdxMin = 0; 634 635 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 636 { 637 size_t idx = (it->second)[0]; 638 size_t idxMin = (it->second)[0]; 639 for (int i = 2; i < (it->second).size();) 640 { 641 if (mpiRank == (it->second)[i+1]) 642 { 643 idx = (it->second)[i]; 644 } 645 if ((it->second)[i] < idxMin) 646 { 647 idxMin = (it->second)[i]; 648 (it->second)[i] = (it->second)[i-2]; 649 } 650 i += 2; 651 } 652 (it->second)[0] = idxMin; 653 if (nodeIdx2IdxMin.count(idx) == 0) 654 { 655 nodeIdx2IdxMin[idx].push_back(idxMin); 656 if (idx == idxMin) 657 nodeIdx2IdxGlo[idxMin].push_back(idxMin); 658 nodeIdxMinList(iIdxMin) = idxMin; 659 ++iIdxMin; 660 } 661 } 662 nodeIdxMinList.resizeAndPreserve(iIdxMin); 663 CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2IdxGlo, comm); 664 CClientClientDHTSizet dhtNodeIdx(nodeIdx2IdxGlo, comm); 665 dhtNodeIdx.computeIndexInfoMapping(nodeIdxMinList); 666 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdxMin2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 667 // nodeIdx2IdxGlo holds global indexes only for nodes owned by a process 668 // nodeIdxMin2IdxGlo holds global indexes for all nodes generated by a process 699 669 700 670 // (2.3) Saving variables: node_lon, node_lat, edge_nodes 701 671 // Creating map nodeHash2IdxGlo <hash, idxGlo> 702 672 // Creating map edgeHash2IdxGlo <hash, idxGlo> 703 //nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal();704 //node_count = dhtNodeIdxGlo.getIndexCount();705 //node_start = dhtNodeIdxGlo.getIndexStart();673 nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 674 node_count = dhtNodeIdxGlo.getIndexCount(); 675 node_start = dhtNodeIdxGlo.getIndexStart(); 706 676 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeHash2IdxGlo; 707 677 node_lon.resize(node_count); … … 715 685 { 716 686 hashValues = CMesh::createHashes(bounds_lon(nv, ne), bounds_lat(nv, ne)); 717 size_t myIdx = generateNodeIndex(hashValues); 718 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = nodeIdx2IdxGlo.find(myIdx); 719 idxGlo = (itIdx->second)[1]; 720 721 if (mpiRank == (itIdx->second)[0]) 722 { 687 size_t myIdx = generateNodeIndex(hashValues, mpiRank); 688 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = nodeIdx2IdxMin.find(myIdx); 689 size_t ownerIdx = (itIdx->second)[0]; 690 691 if (myIdx == ownerIdx) 692 { 693 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = nodeIdx2IdxGlo.find(myIdx); 694 idxGlo = (itIdxGlo->second)[0]; 723 695 // node_lon(idxGlo - node_start) = (bounds_lon(nv, ne) == 360.) ? (0.) : (bounds_lon(nv, ne)); 724 696 node_lon(idxGlo - node_start) = bounds_lon(nv, ne); 725 697 node_lat(idxGlo - node_start) = bounds_lat(nv, ne); 726 698 } 699 else 700 { 701 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = nodeIdxMin2IdxGlo.find(ownerIdx); 702 idxGlo = (itIdxGlo->second)[0]; 703 } 704 727 705 edge_nodes(nv,ne) = idxGlo; 728 706 for (int nh = 0; nh < 4; ++nh) … … 815 793 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeHash2Rank; 816 794 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face; 817 CArray<size_t,1> edgeIdx List(nbFaces_*nvertex);795 CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex); 818 796 size_t iIdx = 0; 819 797 … … 846 824 if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) 847 825 { 848 edgeIdx List(iIdx) = edgeIdxGlo;826 edgeIdxGloList(iIdx) = edgeIdxGlo; 849 827 ++iIdx; 850 828 } 851 829 edgeIdxGlo2Face[edgeIdxGlo].push_back(faceIdxGlo); 830 edgeHash2Rank[edgeHash].push_back(itEdgeHash->first); 852 831 edgeHash2Rank[edgeHash].push_back(mpiRank); 853 edgeHash2Rank[edgeHash].push_back(itEdgeHash->second[0]);854 832 } 855 833 else … … 859 837 } 860 838 } 861 edgeIdx List.resizeAndPreserve(iIdx);839 edgeIdxGloList.resizeAndPreserve(iIdx); 862 840 863 841 // (1.3) Saving remaining variables edge_faces and face_faces … … 868 846 dhtEdgeHash.computeIndexInfoMapping(edgeHashList); 869 847 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeHash2Info = dhtEdgeHash.getInfoIndexMap(); 870 871 // edgeHash2Info = <edgeHash, < rank1, idxGlo, rank2, idxGlo>> 872 int edgeCount = 0; 848 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeHashMin2IdxGlo; 849 850 // edgeHash2Info = <edgeHash, <idxGlo, rank1, idxGlo, rank2>> 851 // edgeHashMin2IdxGlo = <edgeHashMin, idxGlo> 873 852 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 874 853 { 875 854 vector <size_t> edgeInfo = it->second; 876 if (edgeInfo[0] == mpiRank) 877 { 878 ++edgeCount; 879 } 880 } 881 882 int edgeStart, nbEdges; 883 MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 884 int nEdges = edgeStart; 885 MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 886 nbEdgesGlo = nEdges; 887 888 // edges to be splitted equally between procs 889 if ( (nbEdgesGlo % mpiSize) == 0) 890 { 891 edge_count = nbEdgesGlo/mpiSize; 892 edge_start = mpiRank*edge_count; 893 } 894 else 895 { 896 if (mpiRank == (mpiSize - 1) ) 897 { 898 edge_count = nbEdgesGlo/mpiSize; 899 edge_start = mpiRank*(nbEdgesGlo/mpiSize + 1); 900 } 901 else 902 { 903 edge_count = nbEdgesGlo/mpiSize + 1; 904 edge_start = mpiRank*edge_count; 905 } 906 } 907 CArray<size_t,1> edgeIdxGloList(edge_count); 908 for (int i = 0; i < edge_count; ++i) 909 { 910 edgeIdxGloList(i) = i + edge_start; 911 } 912 913 CClientClientDHTSizet dhtEdgeIdxGlo2Face (edgeIdxGlo2Face, comm); 855 if (edgeInfo.size() == 4) // two processes generate the same edge 856 if (edgeInfo[1] > edgeInfo[3]) 857 edgeInfo[1] = edgeInfo[3]; 858 if (edgeInfo[1] == mpiRank) 859 edgeHashMin2IdxGlo[it->first].push_back(edgeInfo[0]); 860 } 861 862 CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeHashMin2IdxGlo, comm); 863 edge_count = dhtEdgeIdxGlo.getIndexCount(); 864 edge_start = dhtEdgeIdxGlo.getIndexStart(); 865 866 edge_faces.resize(2, edge_count); 867 face_faces.resize(nvertex, nbFaces_); 868 914 869 CClientClientDHTSizet dhtEdge2Face (edgeIdxGlo2Face, comm); 915 dhtEdgeIdxGlo2Face.computeIndexInfoMapping(edgeIdxGloList); 916 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdgeIdxGlo2Face.getInfoIndexMap(); 917 dhtEdge2Face.computeIndexInfoMapping(edgeIdxList); 918 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2FaceIdx = dhtEdge2Face.getInfoIndexMap(); 919 920 921 edge_faces.resize(2, edge_count); 922 for (int i = 0; i < edge_count; ++i) 923 { 924 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdxGlo2FaceIdx.find(i + edge_start); 925 int indexGlo = it->first; 926 vector<size_t> faces = it->second; 927 int face1 = faces[0]; 928 edge_faces(0, indexGlo - edge_start) = face1; 929 if (faces.size() == 2) 930 { 931 int face2 = faces[1]; 932 edge_faces(1, indexGlo - edge_start) = face2; 933 } 934 else 935 { 936 edge_faces(1, indexGlo - edge_start) = -999; 937 } 938 } 939 940 size_t tmp; 941 vector<size_t> tmpVec; 942 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2FaceIdx.begin(); it != edgeIdx2FaceIdx.end(); it++) 943 { 944 tmp = it->first; 945 tmpVec = it->second; 946 tmp++; 947 } 948 949 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itFace1, itFace2, itIndex; 950 face_faces.resize(nvertex, nbFaces_); 870 dhtEdge2Face.computeIndexInfoMapping(edgeIdxGloList); 871 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdge2Face.getInfoIndexMap(); 872 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itFace1, itFace2; 873 951 874 for (int nf = 0; nf < nbFaces_; ++nf) 952 875 { … … 973 896 size_t faceIdxGlo = nbFacesAccum + nf; 974 897 size_t edgeHash = hashPairOrdered(it1->second[0], it2->second[0]); 975 itEdgeHash = edgeHash2Info.find(edgeHash); 976 int edgeIdxGlo = (itEdgeHash->second)[1]; 977 978 if ( (itEdgeHash->second)[0] == mpiRank) 898 itEdgeHash = edgeHash2IdxGlo.find(edgeHash); 899 if (itEdgeHash != edgeHashMin2IdxGlo.end()) 979 900 { 980 itFace1 = edgeIdx2FaceIdx.find(edgeIdxGlo); 901 int edgeIdxGlo = itEdgeHash->second[0]; 902 itFace1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 981 903 int face1 = itFace1->second[0]; 982 904 if (itFace1->second.size() == 1) 983 905 { 906 edge_faces(0, edgeIdxGlo - edge_start) = face1; 907 edge_faces(1, edgeIdxGlo - edge_start) = -999; 984 908 face_faces(nv1, nf) = 999999; 985 909 } … … 987 911 { 988 912 int face2 = itFace1->second[1]; 913 edge_faces(0, edgeIdxGlo - edge_start) = face1; 914 edge_faces(1, edgeIdxGlo - edge_start) = face2; 989 915 face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 990 916 } … … 992 918 else 993 919 { 994 itFace1 = edgeIdx2FaceIdx.find(edgeIdxGlo); 920 itEdgeHash = edgeHashMin2IdxGlo.find(edgeHash); 921 size_t edgeIdxGlo = itEdgeHash->second[0]; 922 itFace1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 995 923 int face1 = itFace1->second[0]; 996 924 int face2 = itFace1->second[1]; … … 1029 957 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it1, it2; 1030 958 CArray<size_t,1> edgeHashList(nbFaces_*nvertex); 1031 int nEdgeHash = 0;1032 959 for (int nf = 0; nf < nbFaces_; ++nf) 1033 960 { … … 1051 978 face_nodes(nv1,nf) = it1->second[0]; 1052 979 size_t edgeHash = hashPairOrdered(it1->second[0], it2->second[0]); 1053 if (edgeHash2Idx.count(edgeHash) == 0) 1054 { 1055 edgeHash2Idx[edgeHash].push_back(edgeHash); 1056 edgeHash2Idx[edgeHash].push_back(mpiRank); 1057 edgeHashList(nEdgeHash) = edgeHash; 1058 ++nEdgeHash; 1059 } 1060 } 1061 } 1062 edgeHashList.resizeAndPreserve(nEdgeHash); 1063 1064 // (2.3) Generating global edge indexes 1065 // The ownership criterion: priority of the process with smaller rank 980 edgeHash2Idx[edgeHash].push_back(generateEdgeIndex(it1->second[0], it2->second[0], mpiRank)); 981 edgeHash2Idx[edgeHash].push_back(mpiRank); 982 edgeHashList(nf*nvertex + nv1) = edgeHash; 983 } 984 } 985 986 // (2.2) Generating global edge indexes 987 // The ownership criterion: priority of the process holding the smaller index 1066 988 // Maps generated in this step are: 1067 // edgeIdx2Idx = = <idx, <rankOwner, idx>> 1068 // edgeIdx2IdxGlo = <idxMin, <rankOwner, idxGlo>> 989 // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 990 // edgeIdx2IdxMin = = <idx, idxMin> 991 // edgeIdx2IdxGlo = <idxMin, idxGlo> 1069 992 1070 993 CClientClientDHTSizet dhtEdgeHash(edgeHash2Idx, comm); 1071 994 dhtEdgeHash.computeIndexInfoMapping(edgeHashList); 1072 995 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeHash2Info = dhtEdgeHash.getInfoIndexMap(); 1073 // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 1074 1075 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2Idx; 996 997 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxMin; 998 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxGlo; 999 CArray<size_t,1> edgeIdxMinList(nbFaces_*nvertex); 1000 size_t iIdxMin = 0; 1076 1001 1077 1002 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 1078 1003 { 1079 size_t rankMin = (it->second)[1];1004 size_t idxMin = (it->second)[0]; 1080 1005 size_t idx = (it->second)[0]; 1081 1082 1006 for (int i = 2; i < (it->second).size();) 1083 1007 { 1084 if ((it->second)[i+1] < rankMin) 1085 { 1086 rankMin = (it->second)[i+1]; 1008 if (mpiRank == (it->second)[i+1]) 1009 { 1087 1010 idx = (it->second)[i]; 1088 (it->second)[i+1] = (it->second)[i-1]; 1011 } 1012 if ((it->second)[i] < idxMin) 1013 { 1014 idxMin = (it->second)[i]; 1015 (it->second)[i] = (it->second)[i-2]; 1089 1016 } 1090 1017 i += 2; 1091 1018 } 1092 if (edgeIdx2Idx.count(idx) == 0) 1093 { 1094 if (mpiRank == rankMin) 1095 { 1096 edgeIdx2Idx[idx].push_back(rankMin); 1097 edgeIdx2Idx[idx].push_back(idx); 1098 } 1099 } 1100 } 1101 1102 int edgeCount = edgeIdx2Idx.size(); 1103 int edgeStart, nbEdges; 1104 MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 1105 int nEdges = edgeStart; 1106 MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 1107 nbEdgesGlo = nEdges; 1108 1109 edgeStart -= edgeCount; 1110 edge_start = edgeStart; 1111 edge_count = edgeCount; 1112 CClientClientDHTSizet::Index2VectorInfoTypeMap dummyEdgeMap; 1113 int count = 0; 1019 (it->second)[0] = idxMin; 1020 if (edgeIdx2IdxMin.count(idx) == 0) 1021 { 1022 edgeIdx2IdxMin[idx].push_back(idxMin); 1023 if (idx == idxMin) 1024 edgeIdx2IdxGlo[idxMin].push_back(idxMin); 1025 edgeIdxMinList(iIdxMin) = idxMin; 1026 ++iIdxMin; 1027 } 1028 } 1029 edgeIdxMinList.resizeAndPreserve(iIdxMin); 1030 CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeIdx2IdxGlo, comm); 1031 CClientClientDHTSizet dhtEdgeIdx(edgeIdx2IdxGlo, comm); 1032 dhtEdgeIdx.computeIndexInfoMapping(edgeIdxMinList); 1033 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxMin2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 1034 // edgeIdx2IdxGlo holds global indexes only for edges owned by a process 1035 // edgeIdxMin2IdxGlo holds global indexes for all edges generated by a process 1036 1037 // (2.3) Saving variables: edge_lon, edge_lat, face_edges 1038 nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 1039 edge_count = dhtEdgeIdxGlo.getIndexCount(); 1040 edge_start = dhtEdgeIdxGlo.getIndexStart(); 1041 edge_lon.resize(edge_count); 1042 edge_lat.resize(edge_count); 1043 edge_nodes.resize(2, edge_count); 1044 face_edges.resize(nvertex, nbFaces_); 1045 1046 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face; 1047 CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex); 1048 size_t iIdx = 0; 1114 1049 1115 1050 for (int nf = 0; nf < nbFaces_; ++nf) … … 1133 1068 it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh2)); 1134 1069 } 1135 size_t nodeIdxGlo1 = it1->second[0];1136 size_t nodeIdxGlo2 = it2->second[0];1137 1138 if (nodeIdxGlo1 != nodeIdxGlo2)1139 {1140 size_t edgeIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2);1141 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2Idx.find(edgeIdx);1142 if (it != edgeIdx2Idx.end())1143 {1144 if (dummyEdgeMap.count(edgeIdx) == 0)1145 {1146 dummyEdgeMap[edgeIdx].push_back(edgeIdx);1147 (it->second)[1] = edge_start + count;1148 ++count;1149 }1150 }1151 }1152 }1153 }1154 1155 CClientClientDHTSizet dhtEdgeIdx(edgeIdx2Idx, comm);1156 dhtEdgeIdx.computeIndexInfoMapping(edgeHashList);1157 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2IdxGlo = dhtEdgeIdx.getInfoIndexMap();1158 1159 // (2.4) Saving variables: edge_lon, edge_lat, face_edges1160 edge_lon.resize(edge_count);1161 edge_lat.resize(edge_count);1162 edge_nodes.resize(2, edge_count);1163 face_edges.resize(nvertex, nbFaces_);1164 1165 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face;1166 CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex);1167 size_t iIdx = 0;1168 1169 for (int nf = 0; nf < nbFaces_; ++nf)1170 {1171 for (int nv1 = 0; nv1 < nvertex; ++nv1)1172 {1173 // Getting global indexes of edge's nodes1174 int nh1 = 0;1175 int nv2 = (nv1 < nvertex -1 ) ? (nv1 + 1) : (nv1 + 1 - nvertex); // cyclic rotation1176 it1 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh1));1177 while (it1 == nodeHash2IdxGlo.end())1178 {1179 ++nh1;1180 it1 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh1));1181 }1182 int nh2 = 0;1183 it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv2)*4 + nh2));1184 while (it2 == nodeHash2IdxGlo.end())1185 {1186 ++nh2;1187 it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh2));1188 }1189 1070 // Getting edge global index 1190 1071 size_t nodeIdxGlo1 = it1->second[0]; 1191 1072 size_t nodeIdxGlo2 = it2->second[0]; 1192 size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2);1073 size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 1193 1074 if (nodeIdxGlo1 != nodeIdxGlo2) 1194 1075 { 1195 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 1196 int edgeIdxGlo = (itIdx->second)[1]; 1076 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 1077 size_t ownerIdx = (itIdx->second)[0]; 1078 int edgeIdxGlo = 0; 1197 1079 size_t faceIdxGlo = nbFacesAccum + nf; 1198 1080 1199 if (m piRank == (itIdx->second)[0])1081 if (myIdx == ownerIdx) 1200 1082 { 1083 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 1084 edgeIdxGlo = (itIdxGlo->second)[0]; 1201 1085 double edgeLon; 1202 1086 double diffLon = abs(bounds_lon(nv1, nf) - bounds_lon(nv2, nf)); … … 1212 1096 edge_nodes(1, edgeIdxGlo - edge_start) = nodeIdxGlo2; 1213 1097 } 1098 else 1099 { 1100 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 1101 edgeIdxGlo = (itIdxGlo->second)[0]; 1102 } 1214 1103 face_edges(nv1,nf) = edgeIdxGlo; 1215 1104 if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) … … 1228 1117 edgeIdxGloList.resizeAndPreserve(iIdx); 1229 1118 1230 // (2. 5) Saving remaining variables edge_faces and face_faces1119 // (2.4) Saving remaining variables edge_faces and face_faces 1231 1120 edge_faces.resize(2, edge_count); 1232 1121 face_faces.resize(nvertex, nbFaces_); … … 1236 1125 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdge2Face.getInfoIndexMap(); 1237 1126 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdxGlo1, itNodeIdxGlo2; 1238 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx;1239 1127 1240 1128 for (int nf = 0; nf < nbFaces_; ++nf) … … 1261 1149 size_t nodeIdxGlo2 = it2->second[0]; 1262 1150 1263 size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1264 itIdx = edgeIdx2IdxGlo.find(myIdx); 1151 size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 1152 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 1153 size_t ownerIdx = (itIdx->second)[0]; 1265 1154 size_t faceIdxGlo = nbFacesAccum + nf; 1266 int edgeIdxGlo = (itIdx->second)[1]; 1267 1268 if (mpiRank == (itIdx->second)[0]) 1269 { 1155 1156 if (myIdx == ownerIdx) 1157 { 1158 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 1159 int edgeIdxGlo = (itIdxGlo->second)[0]; 1270 1160 it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 1271 1161 int face1 = it1->second[0]; … … 1286 1176 else 1287 1177 { 1178 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 1179 size_t edgeIdxGlo = (itIdxGlo->second)[0]; 1288 1180 it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 1289 1181 int face1 = it1->second[0]; … … 1308 1200 { 1309 1201 hashValues = CMesh::createHashes(bounds_lon(nv, nf), bounds_lat(nv, nf)); 1310 // size_t nodeIndex = generateNodeIndex(hashValues, mpiRank); 1311 size_t nodeIndex = generateNodeIndex(hashValues); 1202 size_t nodeIndex = generateNodeIndex(hashValues, mpiRank); 1312 1203 for (int nh = 0; nh < 4; ++nh) 1313 1204 { … … 1325 1216 1326 1217 // (3.2) Generating global node indexes 1327 // The ownership criterion: priority of the process with smaller rank. 1328 // With any other criterion it is not possible to have consistent node indexing for different number of procs. 1218 // The ownership criterion: priority of the process holding the smaller index 1329 1219 // Maps generated in this step are: 1330 // nodeHash2Info = <hash, [[idx, rankMin], [idx, rank1], [idx, rank3]..]> 1331 // nodeIdx2Idx = <idx, <rankOwner, idx>> 1220 // nodeHash2Info = <hash, [[idxMin, rankMin], [idx1, rank1], [idx3, rank3]..]> 1221 // nodeIdx2IdxMin = = <idx, idxMin> 1222 // nodeIdx2IdxGlo = <idxMin, idxGlo> 1332 1223 1333 1224 CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); … … 1335 1226 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 1336 1227 1337 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2Idx; 1338 CArray<size_t,1> nodeIdxList(nbFaces_*nvertex*4); 1339 size_t nIdx = 0; 1228 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxMin; 1229 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxGlo; 1230 CArray<size_t,1> nodeIdxMinList(nbFaces_*nvertex*4); 1231 size_t iIdxMin = 0; 1340 1232 1341 1233 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 1342 1234 { 1343 size_t rankMin = (it->second)[1];1235 size_t idxMin = (it->second)[0]; 1344 1236 size_t idx = (it->second)[0]; 1345 1237 for (int i = 2; i < (it->second).size();) 1346 1238 { 1347 if ( (it->second)[i+1] < rankMin)1239 if (mpiRank == (it->second)[i+1]) 1348 1240 { 1349 1241 idx = (it->second)[i]; 1350 rankMin = (it->second)[i+1]; 1351 (it->second)[i+1] = (it->second)[i-1]; 1242 } 1243 if ((it->second)[i] < idxMin) 1244 { 1245 idxMin = (it->second)[i]; 1246 (it->second)[i] = (it->second)[i-2]; 1352 1247 } 1353 1248 i += 2; 1354 1249 } 1355 if (nodeIdx2Idx.count(idx) == 0) 1356 { 1357 if (mpiRank == rankMin) 1358 { 1359 nodeIdx2Idx[idx].push_back(rankMin); 1360 nodeIdx2Idx[idx].push_back(idx); 1361 } 1362 nodeIdxList(nIdx) = idx; 1363 ++nIdx; 1364 } 1365 } 1366 1367 // CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2Idx, comm); 1368 // CDHTAutoIndexing will not give consistent node numbering for varying number of procs. => 1369 // Solution: global node indexing by hand. 1370 // Maps modified in this step: 1371 // nodeIdx2Idx = <idx, idxGlo> 1372 int nodeCount = nodeIdx2Idx.size(); 1373 int nodeStart, nbNodes; 1374 MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 1375 int nNodes = nodeStart; 1376 MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 1377 nbNodesGlo = nNodes; 1378 1379 nodeStart -= nodeCount; 1380 node_start = nodeStart; 1381 node_count = nodeCount; 1382 CClientClientDHTSizet::Index2VectorInfoTypeMap dummyMap; // just a dummy map used to ensure that each node is numbered only once 1383 size_t count = 0; 1384 1385 for (int nf = 0; nf < nbFaces_; ++nf) 1386 { 1387 for (int nv = 0; nv < nvertex; ++nv) 1388 { 1389 vector<size_t> hashValues = CMesh::createHashes(bounds_lon(nv, nf), bounds_lat(nv, nf)); 1390 size_t nodeIdx = generateNodeIndex(hashValues); 1391 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeIdx2Idx.find(nodeIdx); 1392 if (it != nodeIdx2Idx.end()) 1393 { 1394 if (dummyMap.count(nodeIdx) == 0) 1395 { 1396 dummyMap[nodeIdx].push_back(nodeIdx); 1397 (it->second)[1] = node_start + count; 1398 ++count; 1399 } 1400 } 1401 } 1402 } 1403 nodeIdxList.resizeAndPreserve(nIdx); 1404 CClientClientDHTSizet dhtNodeIdx(nodeIdx2Idx, comm); 1405 dhtNodeIdx.computeIndexInfoMapping(nodeIdxList); 1406 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdx2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 1250 (it->second)[0] = idxMin; 1251 if (nodeIdx2IdxMin.count(idx) == 0) 1252 { 1253 nodeIdx2IdxMin[idx].push_back(idxMin); 1254 if (idx == idxMin) 1255 nodeIdx2IdxGlo[idxMin].push_back(idxMin); 1256 nodeIdxMinList(iIdxMin) = idxMin; 1257 ++iIdxMin; 1258 } 1259 } 1260 1261 nodeIdxMinList.resizeAndPreserve(iIdxMin); 1262 CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2IdxGlo, comm); 1263 CClientClientDHTSizet dhtNodeIdx(nodeIdx2IdxGlo, comm); 1264 dhtNodeIdx.computeIndexInfoMapping(nodeIdxMinList); 1265 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdxMin2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 1407 1266 1408 1267 // (3.3) Saving node data: node_lon, node_lat, and face_nodes 1409 1268 // Generating edgeHash2Info = <hash, <idx, rank>> and edgeHashList 1410 //nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal();1411 //node_count = dhtNodeIdxGlo.getIndexCount();1412 //node_start = dhtNodeIdxGlo.getIndexStart();1269 nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 1270 node_count = dhtNodeIdxGlo.getIndexCount(); 1271 node_start = dhtNodeIdxGlo.getIndexStart(); 1413 1272 node_lon.resize(node_count); 1414 1273 node_lat.resize(node_count); … … 1427 1286 vector<size_t> hashValues1 = CMesh::createHashes(bounds_lon(nv1, nf), bounds_lat(nv1, nf)); 1428 1287 vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 1429 size_t nodeIdx1 = generateNodeIndex(hashValues1);1430 size_t nodeIdx2 = generateNodeIndex(hashValues2);1431 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2Idx Glo.find(nodeIdx1);1432 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2Idx Glo.find(nodeIdx2);1433 size_t owner Rank= (itNodeIdx1->second)[0];1434 nodeIdxGlo1 = (itNodeIdx1->second)[1]; 1435 nodeIdxGlo2 = (itNodeIdx2->second)[1];1436 1437 if (mpiRank == ownerRank)1438 {1288 size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank); 1289 size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank); 1290 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxMin.find(myNodeIdx1); 1291 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxMin.find(myNodeIdx2); 1292 size_t ownerNodeIdx = (itNodeIdx1->second)[0]; 1293 1294 if (myNodeIdx1 == ownerNodeIdx) 1295 { 1296 itNodeIdxGlo1 = nodeIdx2IdxGlo.find(myNodeIdx1); 1297 nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 1439 1298 node_lon(nodeIdxGlo1 - node_start) = bounds_lon(nv1, nf); 1440 1299 node_lat(nodeIdxGlo1 - node_start) = bounds_lat(nv1, nf); 1441 1300 } 1301 else 1302 { 1303 itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find(ownerNodeIdx); 1304 nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 1305 } 1306 itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((itNodeIdx2->second)[0]); 1307 nodeIdxGlo2 = (itNodeIdxGlo2->second)[0]; 1442 1308 if (nodeIdxGlo1 != nodeIdxGlo2) 1443 1309 { 1444 1310 size_t edgeHash = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1445 edgeHash2Idx[edgeHash].push_back( edgeHash);1311 edgeHash2Idx[edgeHash].push_back(generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank)); 1446 1312 edgeHash2Idx[edgeHash].push_back(mpiRank); 1447 1313 edgeHashList(nEdgeHash) = edgeHash; … … 1455 1321 // (3.4) Generating global edge indexes 1456 1322 // Maps generated in this step are: 1457 // edgeIdx2Idx = = <idx, <rankOwner, idx>>1458 // edgeIdx2IdxGlo = <idxMin, <rankOwner, idxGlo>>1323 // edgeIdx2IdxMin = = <idx, idxMin> 1324 // edgeIdx2IdxGlo = <idxMin, idxGlo> 1459 1325 1460 1326 CClientClientDHTSizet dhtEdgeHash(edgeHash2Idx, comm); … … 1463 1329 // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 1464 1330 1465 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2Idx; 1331 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxMin; 1332 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxGlo; 1333 CArray<size_t,1> edgeIdxMinList(nbFaces_*nvertex); 1334 iIdxMin = 0; 1466 1335 1467 1336 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 1468 1337 { 1469 size_t rankMin = (it->second)[1];1338 size_t idxMin = (it->second)[0]; 1470 1339 size_t idx = (it->second)[0]; 1471 1340 1472 1341 for (int i = 2; i < (it->second).size();) 1473 1342 { 1474 if ((it->second)[i+1] < rankMin) 1475 { 1476 rankMin = (it->second)[i+1]; 1343 if (mpiRank == (it->second)[i+1]) 1344 { 1477 1345 idx = (it->second)[i]; 1478 (it->second)[i+1] = (it->second)[i-1]; 1346 } 1347 if ((it->second)[i] < idxMin) 1348 { 1349 idxMin = (it->second)[i]; 1350 (it->second)[i] = (it->second)[i-2]; 1479 1351 } 1480 1352 i += 2; 1481 1353 } 1482 if (edgeIdx2Idx.count(idx) == 0) 1483 { 1484 if (mpiRank == rankMin) 1485 { 1486 edgeIdx2Idx[idx].push_back(rankMin); 1487 edgeIdx2Idx[idx].push_back(idx); 1488 } 1489 } 1490 } 1491 1492 int edgeCount = edgeIdx2Idx.size(); 1493 int edgeStart, nbEdges; 1494 MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 1495 int nEdges = edgeStart; 1496 MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 1497 nbEdgesGlo = nEdges; 1498 1499 edgeStart -= edgeCount; 1500 edge_start = edgeStart; 1501 edge_count = edgeCount; 1502 CClientClientDHTSizet::Index2VectorInfoTypeMap dummyEdgeMap; 1503 count = 0; 1504 1505 for (int nf = 0; nf < nbFaces_; ++nf) 1506 { 1507 for (int nv1 = 0; nv1 < nvertex; ++nv1) 1508 { 1509 int nv2 = (nv1 < nvertex -1 ) ? (nv1 + 1) : (nv1 + 1 - nvertex); // cyclic rotation 1510 vector<size_t> hashValues1 = CMesh::createHashes(bounds_lon(nv1, nf), bounds_lat(nv1, nf)); 1511 vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 1512 size_t nodeIdx1 = generateNodeIndex(hashValues1); 1513 size_t nodeIdx2 = generateNodeIndex(hashValues2); 1514 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxGlo.find(nodeIdx1); 1515 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxGlo.find(nodeIdx2); 1516 nodeIdxGlo1 = (itNodeIdx1->second)[1]; 1517 nodeIdxGlo2 = (itNodeIdx2->second)[1]; 1518 1519 if (nodeIdxGlo1 != nodeIdxGlo2) 1520 { 1521 size_t edgeIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1522 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2Idx.find(edgeIdx); 1523 if (it != edgeIdx2Idx.end()) 1524 { 1525 if (dummyEdgeMap.count(edgeIdx) == 0) 1526 { 1527 dummyEdgeMap[edgeIdx].push_back(edgeIdx); 1528 (it->second)[1] = edge_start + count; 1529 ++count; 1530 } 1531 } 1532 } 1533 } 1534 } 1535 CClientClientDHTSizet dhtEdgeIdx(edgeIdx2Idx, comm); 1536 dhtEdgeIdx.computeIndexInfoMapping(edgeHashList); 1537 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 1354 (it->second)[0] = idxMin; 1355 if (edgeIdx2IdxMin.count(idx) == 0) 1356 { 1357 edgeIdx2IdxMin[idx].push_back(idxMin); 1358 if (idx == idxMin) 1359 edgeIdx2IdxGlo[idxMin].push_back(idxMin); 1360 edgeIdxMinList(iIdxMin) = idxMin; 1361 ++iIdxMin; 1362 } 1363 } 1364 edgeIdxMinList.resizeAndPreserve(iIdxMin); 1365 CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeIdx2IdxGlo, comm); 1366 CClientClientDHTSizet dhtEdgeIdx(edgeIdx2IdxGlo, comm); 1367 dhtEdgeIdx.computeIndexInfoMapping(edgeIdxMinList); 1368 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxMin2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 1538 1369 1539 1370 // (3.5) Saving variables: edge_lon, edge_lat, face_edges 1540 1371 // Creating map edgeIdxGlo2Face <idxGlo, face> 1541 // nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 1542 // edge_count = dhtEdgeIdxGlo.getIndexCount();1543 // edge_start = dhtEdgeIdxGlo.getIndexStart();1544 1372 1373 nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 1374 edge_count = dhtEdgeIdxGlo.getIndexCount(); 1375 edge_start = dhtEdgeIdxGlo.getIndexStart(); 1545 1376 edge_lon.resize(edge_count); 1546 1377 edge_lat.resize(edge_count); … … 1562 1393 vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 1563 1394 1564 size_t nodeIdx1 = generateNodeIndex(hashValues1); 1565 size_t nodeIdx2 = generateNodeIndex(hashValues2); 1566 it1 = nodeIdx2IdxGlo.find(nodeIdx1); 1567 it2 = nodeIdx2IdxGlo.find(nodeIdx2); 1568 size_t nodeIdxGlo1 = (it1->second)[1]; 1569 size_t nodeIdxGlo2 = (it2->second)[1]; 1395 size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank); 1396 size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank); 1397 it1 = nodeIdx2IdxMin.find(myNodeIdx1); 1398 it2 = nodeIdx2IdxMin.find(myNodeIdx2); 1399 itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find((it1->second)[0]); 1400 itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((it2->second)[0]); 1401 size_t nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 1402 size_t nodeIdxGlo2 = (itNodeIdxGlo2->second)[0]; 1570 1403 1571 1404 if (nodeIdxGlo1 != nodeIdxGlo2) 1572 1405 { 1573 size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1574 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 1575 int edgeIdxGlo = (itIdx->second)[1]; 1406 size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 1407 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 1408 size_t ownerIdx = (itIdx->second)[0]; 1409 int edgeIdxGlo; 1576 1410 size_t faceIdxGlo = nbFacesAccum + nf; 1577 1411 1578 if (m piRank == (itIdx->second)[0])1412 if (myIdx == ownerIdx) 1579 1413 { 1414 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 1415 edgeIdxGlo = (itIdxGlo->second)[0]; 1580 1416 double edgeLon; 1581 1417 double diffLon = abs(bounds_lon(nv1, nf) - bounds_lon(nv2, nf)); … … 1591 1427 edge_nodes(1, edgeIdxGlo - edge_start) = nodeIdxGlo2; 1592 1428 } 1429 else 1430 { 1431 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 1432 edgeIdxGlo = (itIdxGlo->second)[0]; 1433 } 1593 1434 face_edges(nv1,nf) = edgeIdxGlo; 1594 1435 if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) … … 1624 1465 vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 1625 1466 1626 size_t myNodeIdx1 = generateNodeIndex(hashValues1 );1627 size_t myNodeIdx2 = generateNodeIndex(hashValues2 );1467 size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank); 1468 size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank); 1628 1469 if (myNodeIdx1 != myNodeIdx2) 1629 1470 { 1630 it1 = nodeIdx2IdxGlo.find(myNodeIdx1); 1631 it2 = nodeIdx2IdxGlo.find(myNodeIdx2); 1632 size_t nodeIdxGlo1 = (it1->second)[1]; 1633 size_t nodeIdxGlo2 = (it2->second)[1]; 1634 size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1635 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 1636 int edgeIdxGlo = (itIdx->second)[1]; 1637 1471 it1 = nodeIdx2IdxMin.find(myNodeIdx1); 1472 it2 = nodeIdx2IdxMin.find(myNodeIdx2); 1473 itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find((it1->second)[0]); 1474 itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((it2->second)[0]); 1475 size_t nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 1476 size_t nodeIdxGlo2 = (itNodeIdxGlo2->second)[0]; 1477 1478 size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 1479 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 1480 size_t ownerIdx = (itIdx->second)[0]; 1638 1481 size_t faceIdxGlo = nbFacesAccum + nf; 1639 1482 1640 if (m piRank == (itIdx->second)[0])1483 if (myIdx == ownerIdx) 1641 1484 { 1485 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 1486 int edgeIdxGlo = (itIdxGlo->second)[0]; 1642 1487 it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 1643 1488 int face1 = it1->second[0]; … … 1655 1500 face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 1656 1501 } 1657 } 1502 } // myIdx == ownerIdx 1658 1503 else 1659 1504 { 1505 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx); 1506 size_t edgeIdxGlo = (itIdxGlo->second)[0]; 1660 1507 it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 1661 1508 int face1 = it1->second[0]; 1662 1509 int face2 = it1->second[1]; 1663 1510 face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 1664 } 1511 } // myIdx != ownerIdx 1665 1512 } // myNodeIdx1 != myNodeIdx2 1666 1513 else … … 1668 1515 } 1669 1516 } 1670 1671 1517 } 1672 1518 facesAreWritten = true; -
XIOS/dev/branch_yushan/src/parse_expr/filter_expr_node.cpp
r1001 r1037 40 40 boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 41 41 { 42 boost::shared_ptr<COutputPin> outputPin; 43 44 if (fieldId == "this") 45 outputPin = thisField.getSelfTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 46 else if (CField::has(fieldId)) 47 { 48 CField* field = CField::get(fieldId); 49 if (field == &thisField) 50 ERROR("boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 51 << "The field " << fieldId << " has an invalid reference to itself. " 52 << "Use the keyword \"this\" if you want to reference the input data sent to this field."); 53 54 field->buildFilterGraph(gc, false); 55 outputPin = field->getTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 56 } 57 else 42 if (!CField::has(fieldId)) 58 43 ERROR("boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 59 44 << "The field " << fieldId << " does not exist."); 60 45 61 return outputPin; 46 CField* field = CField::get(fieldId); 47 if (field == &thisField) 48 ERROR("boost::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 49 << "The field " << fieldId << " has an invalid reference to itself."); 50 51 field->buildFilterGraph(gc, false); 52 return field->getTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 62 53 } 63 54 -
XIOS/dev/branch_yushan/src/parse_expr/lex_parser.cpp
r1019 r1037 10 10 #define YY_FLEX_MAJOR_VERSION 2 11 11 #define YY_FLEX_MINOR_VERSION 5 12 #define YY_FLEX_SUBMINOR_VERSION 3 712 #define YY_FLEX_SUBMINOR_VERSION 39 13 13 #if YY_FLEX_SUBMINOR_VERSION > 0 14 14 #define FLEX_BETA … … 143 143 /* Size of default input buffer. */ 144 144 #ifndef YY_BUF_SIZE 145 #ifdef __ia64__ 146 /* On IA-64, the buffer size is 16k, not 8k. 147 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. 148 * Ditto for the __ia64__ case accordingly. 149 */ 150 #define YY_BUF_SIZE 32768 151 #else 145 152 #define YY_BUF_SIZE 16384 153 #endif /* __ia64__ */ 146 154 #endif 147 155 … … 169 177 170 178 #define YY_LESS_LINENO(n) 179 #define YY_LINENO_REWIND_TO(ptr) 171 180 172 181 /* Return all but the first "n" matched characters back to the input stream. */ … … 347 356 extern char *yytext; 348 357 #define yytext_ptr yytext 358 349 359 static yyconst flex_int16_t yy_nxt[][128] = 350 360 { … … 564 574 -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, 565 575 -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, 566 -12, 23, -12, -12, -12, -12, -12, -12, -12, -12,576 -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, 567 577 -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, 568 578 -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, … … 579 589 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, 580 590 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, 581 -13, -13, -13, -13, -13, -13, 2 4, -13, 25, 25,582 2 5, 25, 25, 25, 25, 25, 25, 25, -13, -13,583 -13, -13, -13, -13, -13, -13, -13, -13, -13, 2 6,591 -13, -13, -13, -13, -13, -13, 23, -13, 24, 24, 592 24, 24, 24, 24, 24, 24, 24, 24, -13, -13, 593 -13, -13, -13, -13, -13, -13, -13, -13, -13, 25, 584 594 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, 585 595 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, 586 596 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, 587 -13, 2 6, -13, -13, -13, -13, -13, -13, -13, -13,597 -13, 25, -13, -13, -13, -13, -13, -13, -13, -13, 588 598 589 599 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, … … 598 608 -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, 599 609 -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, 600 -14, 2 7, -14, -14, -14, -14, -14, -14, -14, -14,610 -14, 26, -14, -14, -14, -14, -14, -14, -14, -14, 601 611 -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, 602 612 … … 616 626 617 627 -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, 618 -15, 2 8, -15, -15, -15, -15, -15, -15, -15, -15,628 -15, 27, -15, -15, -15, -15, -15, -15, -15, -15, 619 629 -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, 620 630 -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, … … 633 643 -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, 634 644 -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, 635 -16, 2 9, -16, -16, -16, -16, -16, -16, -16, -16,645 -16, 28, -16, -16, -16, -16, -16, -16, -16, -16, 636 646 -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, 637 647 -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, … … 650 660 -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 651 661 -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 652 -17, -17, -17, -17, -17, 30, 30, 30, 30, 30,653 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,654 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,655 656 30, -17, -17, -17, -17, -17, -17, 30, 30, 30,657 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,658 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,659 30, 30, 30, -17, -17, -17, -17, -17662 -17, -17, -17, -17, -17, 29, 29, 29, 29, 29, 663 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 664 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 665 666 29, -17, -17, -17, -17, -17, -17, 29, 29, 29, 667 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 668 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 669 29, 29, 29, -17, -17, -17, -17, -17 660 670 }, 661 671 … … 665 675 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 666 676 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 667 -18, -18, -18, -18, -18, -18, -18, -18, 3 1, 31,668 3 1, 31, 31, 31, 31, 31, 31, 31, -18, -18,669 670 -18, -18, -18, -18, -18, 3 1, 31, 31, 31, 31,671 3 1, 31, 31, 31, 31, 31, 31, 31, 31, 31,672 3 1, 31, 31, 31, 31, 31, 31, 31, 31, 31,673 3 1, -18, -18, -18, -18, 31, -18, 31, 31, 31,674 3 1, 31, 31, 31, 31, 31, 31, 31, 31, 31,675 3 1, 31, 31, 31, 31, 31, 31, 31, 31, 31,676 3 1, 31, 31, -18, -18, -18, -18, -18677 -18, -18, -18, -18, -18, -18, -18, -18, 30, 30, 678 30, 30, 30, 30, 30, 30, 30, 30, -18, -18, 679 680 -18, -18, -18, -18, -18, 30, 30, 30, 30, 30, 681 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 682 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 683 30, -18, -18, -18, -18, 30, -18, 30, 30, 30, 684 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 685 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 686 30, 30, 30, -18, -18, -18, -18, -18 677 687 }, 678 688 … … 735 745 -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 736 746 737 -22, -22, -22, -22, -22, -22, -22, -22, 3 2, 32,738 3 2, 32, 32, 32, 32, 32, 32, 32, -22, -22,739 -22, -22, -22, -22, -22, 3 2, 32, 32, 32, 32,740 3 2, 32, 32, 32, 32, 32, 32, 32, 32, 32,741 3 2, 32, 32, 32, 32, 32, 32, 32, 32, 32,742 3 2, -22, -22, -22, -22, 32, -22, 32, 32, 32,743 3 2, 32, 32, 32, 32, 32, 32, 32, 32, 32,744 3 2, 32, 32, 32, 32, 32, 32, 32, 32, 32,745 3 2, 32, 32, -22, -22, -22, -22, -22747 -22, -22, -22, -22, -22, -22, -22, -22, 31, 31, 748 31, 31, 31, 31, 31, 31, 31, 31, -22, -22, 749 -22, -22, -22, -22, -22, 31, 31, 31, 31, 31, 750 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 751 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 752 31, -22, -22, -22, -22, 31, -22, 31, 31, 31, 753 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 754 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 755 31, 31, 31, -22, -22, -22, -22, -22 746 756 }, 747 757 … … 749 759 3, -23, -23, -23, -23, -23, -23, -23, -23, -23, 750 760 761 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 762 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 763 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 764 -23, -23, -23, -23, -23, -23, -23, -23, 32, 32, 765 32, 32, 32, 32, 32, 32, 32, 32, -23, -23, 751 766 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 752 767 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, … … 754 769 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 755 770 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 756 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,757 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,758 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,759 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,760 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,761 771 762 772 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, … … 769 779 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 770 780 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 771 -24, -24, -24, -24, -24, -24, -24, -24, 33, 33, 772 33, 33, 33, 33, 33, 33, 33, 33, -24, -24, 781 -24, -24, -24, -24, -24, -24, 23, -24, 24, 24, 782 24, 24, 24, 24, 24, 24, 24, 24, -24, -24, 783 -24, -24, -24, -24, -24, -24, -24, -24, -24, 25, 784 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 785 773 786 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 774 787 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 775 776 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 777 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 778 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 788 -24, 25, -24, -24, -24, -24, -24, -24, -24, -24, 779 789 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 780 790 -24, -24, -24, -24, -24, -24, -24, -24 … … 786 796 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 787 797 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 788 -25, -25, -25, -25, -25, -25, 24, -25, 25, 25, 789 790 25, 25, 25, 25, 25, 25, 25, 25, -25, -25, 791 -25, -25, -25, -25, -25, -25, -25, -25, -25, 26, 798 -25, -25, -25, 33, -25, 33, -25, -25, 34, 34, 799 800 34, 34, 34, 34, 34, 34, 34, 34, -25, -25, 792 801 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 793 802 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 794 803 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 795 -25, 26, -25, -25, -25, -25, -25, -25, -25, -25, 804 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 805 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 796 806 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 797 807 -25, -25, -25, -25, -25, -25, -25, -25 … … 804 814 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 805 815 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 806 -26, -26, -26, 34, -26, 34, -26, -26, 35, 35,807 35, 35, 35, 35, 35, 35, 35, 35, -26, -26,816 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 817 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 808 818 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 809 819 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, … … 856 866 857 867 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 858 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,859 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,860 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,861 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,862 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,863 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,864 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,865 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,866 -29, -29, -29, -29, -29, -29, -29, -29868 -29, -29, -29, -29, -29, -29, -29, -29, 35, 35, 869 35, 35, 35, 35, 35, 35, 35, 35, -29, -29, 870 -29, -29, -29, -29, -29, 35, 35, 35, 35, 35, 871 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 872 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 873 35, -29, -29, -29, -29, 35, -29, 35, 35, 35, 874 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 875 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 876 35, 35, 35, -29, -29, -29, -29, -29 867 877 868 878 }, … … 873 883 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 874 884 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 875 -30, -30, -30, -30, -30, -30, -30, -30, 3 6, 36,876 3 6, 36, 36, 36, 36, 36, 36, 36, -30, -30,877 -30, -30, -30, -30, -30, 3 6, 36, 36, 36, 36,878 3 6, 36, 36, 36, 36, 36, 36, 36, 36, 36,879 3 6, 36, 36, 36, 36, 36, 36, 36, 36, 36,880 3 6, -30, -30, -30, -30, 36, -30, 36, 36, 36,881 882 3 6, 36, 36, 36, 36, 36, 36, 36, 36, 36,883 3 6, 36, 36, 36, 36, 36, 36, 36, 36, 36,884 3 6, 36, 36, -30, -30, -30, -30, -30885 -30, -30, -30, -30, -30, -30, -30, -30, 30, 30, 886 30, 30, 30, 30, 30, 30, 30, 30, -30, -30, 887 -30, -30, -30, -30, -30, 30, 30, 30, 30, 30, 888 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 889 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 890 30, -30, -30, -30, -30, 30, -30, 30, 30, 30, 891 892 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 893 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 894 30, 30, 30, -30, -30, -30, -30, -30 885 895 }, 886 896 … … 910 920 -32, -32, -32, -32, -32, -32, -32, -32, 32, 32, 911 921 32, 32, 32, 32, 32, 32, 32, 32, -32, -32, 912 -32, -32, -32, -32, -32, 32, 32, 32, 32, 32,913 32, 32, 32, 32, 32, 32, 32, 32, 32,32,914 32, 32, 32, 32, 32, 32, 32, 32, 32,32,915 32, -32, -32, -32, -32, 32, -32, 32, 32,32,916 32, 32, 32, 32, 32, 32, 32, 32, 32,32,917 32, 32, 32, 32, 32, 32, 32, 32, 32,32,918 32, 32,32, -32, -32, -32, -32, -32922 -32, -32, -32, -32, -32, -32, -32, -32, -32, 25, 923 -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, 924 -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, 925 -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, 926 -32, 25, -32, -32, -32, -32, -32, -32, -32, -32, 927 -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, 928 -32, -32, -32, -32, -32, -32, -32, -32 919 929 }, 920 930 … … 925 935 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, 926 936 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, 927 -33, -33, -33, -33, -33, -33, -33, -33, 33, 33, 928 33, 33, 33, 33, 33, 33, 33, 33, -33, -33, 929 -33, -33, -33, -33, -33, -33, -33, -33, -33, 26, 937 -33, -33, -33, -33, -33, -33, -33, -33, 34, 34, 938 34, 34, 34, 34, 34, 34, 34, 34, -33, -33, 930 939 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, 931 940 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, 932 941 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, 933 -33, 26, -33, -33, -33, -33, -33, -33, -33, -33, 942 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, 943 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, 934 944 935 945 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, … … 942 952 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, 943 953 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, 944 -34, -34, -34, -34, -34, -34, -34, -34, 3 5, 35,945 3 5, 35, 35, 35, 35, 35, 35, 35, -34, -34,954 -34, -34, -34, -34, -34, -34, -34, -34, 34, 34, 955 34, 34, 34, 34, 34, 34, 34, 34, -34, -34, 946 956 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, 947 957 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, … … 962 972 963 973 35, 35, 35, 35, 35, 35, 35, 35, -35, -35, 964 -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, 965 -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, 966 -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, 967 -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, 968 -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, 969 -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, 970 -35, -35, -35, -35, -35, -35, -35, -35 971 }, 972 973 { 974 3, -36, -36, -36, -36, -36, -36, -36, -36, -36, 975 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 976 977 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 978 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 979 -36, -36, -36, -36, -36, -36, -36, -36, 36, 36, 980 36, 36, 36, 36, 36, 36, 36, 36, -36, -36, 981 -36, -36, -36, -36, -36, 36, 36, 36, 36, 36, 982 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 983 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 984 36, -36, -36, -36, -36, 36, -36, 36, 36, 36, 985 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 986 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 987 988 36, 36, 36, -36, -36, -36, -36, -36 974 -35, -35, -35, -35, -35, 35, 35, 35, 35, 35, 975 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 976 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 977 35, -35, -35, -35, -35, 35, -35, 35, 35, 35, 978 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 979 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 980 35, 35, 35, -35, -35, -35, -35, -35 989 981 }, 990 982 … … 1006 998 (yy_c_buf_p) = yy_cp; 1007 999 1008 #define YY_NUM_RULES 201009 #define YY_END_OF_BUFFER 2 11000 #define YY_NUM_RULES 19 1001 #define YY_END_OF_BUFFER 20 1010 1002 /* This struct is not used in this scanner, 1011 1003 but its presence is necessary. */ … … 1015 1007 flex_int32_t yy_nxt; 1016 1008 }; 1017 static yyconst flex_int16_t yy_accept[3 7] =1009 static yyconst flex_int16_t yy_accept[36] = 1018 1010 { 0, 1019 0, 0, 2 1, 20, 1, 20, 17, 18, 8, 6,1020 7, 9, 2, 12, 20, 13, 20, 5, 10, 19,1021 1, 4, 16, 0, 2, 0, 14, 11, 15, 3,1022 5,4, 2, 0, 2, 31011 0, 0, 20, 19, 1, 19, 16, 17, 8, 6, 1012 7, 9, 2, 12, 19, 13, 19, 5, 10, 18, 1013 1, 4, 0, 2, 0, 14, 11, 15, 3, 5, 1014 4, 2, 0, 2, 3 1023 1015 } ; 1024 1016 … … 1026 1018 static char *yy_last_accepting_cpos; 1027 1019 1028 static yyconst yy_state_type yy_NUL_trans[3 7] =1020 static yyconst yy_state_type yy_NUL_trans[36] = 1029 1021 { 0, 1030 1022 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 1031 1023 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1032 1024 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1033 0, 0, 0, 0, 0 , 01025 0, 0, 0, 0, 0 1034 1026 } ; 1035 1027 … … 1061 1053 #include "yacc_parser.hpp" 1062 1054 1063 #line 10 64"lex_parser.cpp"1055 #line 1056 "lex_parser.cpp" 1064 1056 1065 1057 #define INITIAL 0 … … 1142 1134 /* Amount of stuff to slurp up with each read. */ 1143 1135 #ifndef YY_READ_BUF_SIZE 1136 #ifdef __ia64__ 1137 /* On IA-64, the buffer size is 16k, not 8k */ 1138 #define YY_READ_BUF_SIZE 16384 1139 #else 1144 1140 #define YY_READ_BUF_SIZE 8192 1141 #endif /* __ia64__ */ 1145 1142 #endif 1146 1143 … … 1227 1224 register int yy_act; 1228 1225 1229 #line 29 "lex_parser.lex"1230 1231 1232 #line 1233 "lex_parser.cpp"1233 1234 1226 if ( !(yy_init) ) 1235 1227 { … … 1257 1249 yy_load_buffer_state( ); 1258 1250 } 1251 1252 { 1253 #line 29 "lex_parser.lex" 1254 1255 1256 #line 1257 "lex_parser.cpp" 1259 1257 1260 1258 while ( 1 ) /* loops until end-of-file is reached */ … … 1390 1388 case 16: 1391 1389 YY_RULE_SETUP 1392 #line 6 7"lex_parser.lex"1393 return NE;1390 #line 68 "lex_parser.lex" 1391 return LEFT_PARENTHESIS; 1394 1392 YY_BREAK 1395 1393 case 17: 1396 1394 YY_RULE_SETUP 1397 1395 #line 69 "lex_parser.lex" 1398 return LEFT_PARENTHESIS;1396 return RIGHT_PARENTHESIS; 1399 1397 YY_BREAK 1400 1398 case 18: 1401 1399 YY_RULE_SETUP 1402 #line 7 0"lex_parser.lex"1403 return RIGHT_PARENTHESIS;1400 #line 71 "lex_parser.lex" 1401 return END; 1404 1402 YY_BREAK 1405 1403 case 19: 1406 1404 YY_RULE_SETUP 1407 1405 #line 72 "lex_parser.lex" 1408 return END;1409 YY_BREAK1410 case 20:1411 YY_RULE_SETUP1412 #line 73 "lex_parser.lex"1413 1406 ECHO; 1414 1407 YY_BREAK 1415 #line 14 16"lex_parser.cpp"1408 #line 1409 "lex_parser.cpp" 1416 1409 case YY_STATE_EOF(INITIAL): 1417 1410 yyterminate(); … … 1544 1537 } /* end of action switch */ 1545 1538 } /* end of scanning one token */ 1539 } /* end of user's declarations */ 1546 1540 } /* end of yylex */ 1547 1541 … … 2402 2396 #define YYTABLES_NAME "yytables" 2403 2397 2404 #line 7 3"lex_parser.lex"2398 #line 71 "lex_parser.lex" -
XIOS/dev/branch_yushan/src/parse_expr/lex_parser.lex
r1019 r1037 65 65 "<=" return LE; 66 66 ">=" return GE; 67 "/=" return NE;68 67 69 68 "(" return LEFT_PARENTHESIS; -
XIOS/dev/branch_yushan/src/parse_expr/operator_expr.hpp
r1019 r1037 43 43 opScalarScalar[string("le")] = le_ss; 44 44 opScalarScalar[string("ge")] = ge_ss; 45 opScalarScalar[string("ne")] = ne_ss;46 45 47 46 opField[string("neg")] = neg_f; … … 64 63 opFieldField[string("le")] = le_ff; 65 64 opFieldField[string("ge")] = ge_ff; 66 opFieldField[string("ne")] = ne_ff;67 65 68 66 opFieldScalar[string("add")] = add_fs; … … 76 74 opFieldScalar[string("le")] = le_fs; 77 75 opFieldScalar[string("ge")] = ge_fs; 78 opFieldScalar[string("ne")] = ne_fs;79 76 80 77 opScalarField[string("add")] = add_sf; … … 87 84 opScalarField[string("le")] = le_sf; 88 85 opScalarField[string("ge")] = ge_sf; 89 opScalarField[string("ne")] = ne_sf;90 86 } 91 87 … … 164 160 static inline double le_ss(double x, double y) { return x <= y; } 165 161 static inline double ge_ss(double x, double y) { return x >= y; } 166 static inline double ne_ss(double x, double y) { return x != y; }167 162 168 163 static inline CArray<double,1> neg_f(const CArray<double,1>& x) { return Array<double,1>(-x); } … … 185 180 static inline CArray<double,1> le_ff(const CArray<double,1>& x, const CArray<double,1>& y) { return Array<double,1>(x <= y); } 186 181 static inline CArray<double,1> ge_ff(const CArray<double,1>& x, const CArray<double,1>& y) { return Array<double,1>(x >= y); } 187 static inline CArray<double,1> ne_ff(const CArray<double,1>& x, const CArray<double,1>& y) { return Array<double,1>(x != y); }188 182 189 183 static inline CArray<double,1> add_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x + y); } … … 197 191 static inline CArray<double,1> le_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x <= y); } 198 192 static inline CArray<double,1> ge_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x >= y); } 199 static inline CArray<double,1> ne_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x != y); }200 193 201 194 static inline CArray<double,1> add_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x + y); } … … 208 201 static inline CArray<double,1> le_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x <= y); } 209 202 static inline CArray<double,1> ge_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x >= y); } 210 static inline CArray<double,1> ne_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x != y); }211 203 }; 212 204 -
XIOS/dev/branch_yushan/src/parse_expr/scalar_expr_node.cpp
r1020 r1037 23 23 double CScalarVarExprNode::reduce() const 24 24 { 25 // $missing_value will be replaced with NaN 26 if (varId == "missing_value") 27 { 28 return std::numeric_limits<double>::quiet_NaN(); 29 } 30 else 31 { 32 if (!CVariable::has(varId)) 33 ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist."); 25 if (!CVariable::has(varId)) 26 ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist."); 34 27 35 return CVariable::get(varId)->getData<double>(); 36 } 28 return CVariable::get(varId)->getData<double>(); 37 29 } 38 30 -
XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.cpp
r1019 r1037 1 /* A Bison parser, made by GNU Bison 2.7. */1 /* A Bison parser, made by GNU Bison 3.0.2. */ 2 2 3 3 /* Bison implementation for Yacc-like parsers in C 4 5 Copyright (C) 1984, 1989-1990, 2000-2012Free Software Foundation, Inc.6 4 5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. 6 7 7 This program is free software: you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation, either version 3 of the License, or 10 10 (at your option) any later version. 11 11 12 12 This program is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 15 GNU General Public License for more details. 16 16 17 17 You should have received a copy of the GNU General Public License 18 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ … … 27 27 Bison output files to be licensed under the GNU General Public 28 28 License without this special exception. 29 29 30 30 This special exception was added by the Free Software Foundation in 31 31 version 2.2 of Bison. */ … … 45 45 46 46 /* Bison version. */ 47 #define YYBISON_VERSION " 2.7"47 #define YYBISON_VERSION "3.0.2" 48 48 49 49 /* Skeleton name. */ … … 63 63 64 64 /* Copy the first part of user declarations. */ 65 /* Line 371 of yacc.c */ 66 #line 1 "yacc_parser.yacc" 65 #line 1 "yacc_parser.yacc" /* yacc.c:339 */ 67 66 68 67 #include "filter_expr_node.hpp" … … 97 96 } 98 97 99 /* Line 371 of yacc.c */ 100 #line 101 "yacc_parser.cpp" 101 102 # ifndef YY_NULL 98 #line 99 "yacc_parser.cpp" /* yacc.c:339 */ 99 100 # ifndef YY_NULLPTR 103 101 # if defined __cplusplus && 201103L <= __cplusplus 104 # define YY_NULL nullptr102 # define YY_NULLPTR nullptr 105 103 # else 106 # define YY_NULL 0104 # define YY_NULLPTR 0 107 105 # endif 108 106 # endif … … 120 118 #ifndef YY_YY_YACC_PARSER_HPP_INCLUDED 121 119 # define YY_YY_YACC_PARSER_HPP_INCLUDED 122 /* Enabling traces. */120 /* Debug traces. */ 123 121 #ifndef YYDEBUG 124 122 # define YYDEBUG 0 … … 128 126 #endif 129 127 130 /* Token s. */128 /* Token type. */ 131 129 #ifndef YYTOKENTYPE 132 130 # define YYTOKENTYPE 133 /* Put the tokens into the symbol table, so that GDB and other debuggers 134 know about them. */ 135 enum yytokentype { 136 NUMBER = 258, 137 VAR = 259, 138 ID = 260, 139 AVERAGE = 261, 140 PLUS = 262, 141 MINUS = 263, 142 TIMES = 264, 143 DIVIDE = 265, 144 POWER = 266, 145 EQ = 267, 146 LT = 268, 147 GT = 269, 148 LE = 270, 149 GE = 271, 150 NE = 272, 151 LEFT_PARENTHESIS = 273, 152 RIGHT_PARENTHESIS = 274, 153 END = 275, 154 NEG = 276 155 }; 156 #endif 157 158 131 enum yytokentype 132 { 133 NUMBER = 258, 134 VAR = 259, 135 ID = 260, 136 AVERAGE = 261, 137 PLUS = 262, 138 MINUS = 263, 139 TIMES = 264, 140 DIVIDE = 265, 141 POWER = 266, 142 EQ = 267, 143 LT = 268, 144 GT = 269, 145 LE = 270, 146 GE = 271, 147 LEFT_PARENTHESIS = 272, 148 RIGHT_PARENTHESIS = 273, 149 END = 274, 150 NEG = 275 151 }; 152 #endif 153 154 /* Value type. */ 159 155 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 160 typedef union YYSTYPE 161 { 162 /* Line 387 of yacc.c */ 163 #line 35 "yacc_parser.yacc" 156 typedef union YYSTYPE YYSTYPE; 157 union YYSTYPE 158 { 159 #line 35 "yacc_parser.yacc" /* yacc.c:355 */ 164 160 165 161 std::string* str; /* symbol table index */ … … 167 163 xios::IFilterExprNode* filterNode; 168 164 169 170 /* Line 387 of yacc.c */ 171 #line 172 "yacc_parser.cpp" 172 } YYSTYPE; 165 #line 166 "yacc_parser.cpp" /* yacc.c:355 */ 166 }; 173 167 # define YYSTYPE_IS_TRIVIAL 1 174 # define yystype YYSTYPE /* obsolescent; will be withdrawn */175 168 # define YYSTYPE_IS_DECLARED 1 176 169 #endif 177 170 171 178 172 extern YYSTYPE yylval; 179 173 180 #ifdef YYPARSE_PARAM181 #if defined __STDC__ || defined __cplusplus182 int yyparse (void *YYPARSE_PARAM);183 #else184 int yyparse ();185 #endif186 #else /* ! YYPARSE_PARAM */187 #if defined __STDC__ || defined __cplusplus188 174 int yyparse (void); 189 #else190 int yyparse ();191 #endif192 #endif /* ! YYPARSE_PARAM */193 175 194 176 #endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED */ … … 196 178 /* Copy the second part of user declarations. */ 197 179 198 /* Line 390 of yacc.c */ 199 #line 200 "yacc_parser.cpp" 180 #line 181 "yacc_parser.cpp" /* yacc.c:358 */ 200 181 201 182 #ifdef short … … 211 192 #ifdef YYTYPE_INT8 212 193 typedef YYTYPE_INT8 yytype_int8; 213 #elif (defined __STDC__ || defined __C99__FUNC__ \ 214 || defined __cplusplus || defined _MSC_VER) 194 #else 215 195 typedef signed char yytype_int8; 216 #else217 typedef short int yytype_int8;218 196 #endif 219 197 … … 235 213 # elif defined size_t 236 214 # define YYSIZE_T size_t 237 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 238 || defined __cplusplus || defined _MSC_VER) 215 # elif ! defined YYSIZE_T 239 216 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 240 217 # define YYSIZE_T size_t … … 258 235 #endif 259 236 237 #ifndef YY_ATTRIBUTE 238 # if (defined __GNUC__ \ 239 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 240 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 241 # define YY_ATTRIBUTE(Spec) __attribute__(Spec) 242 # else 243 # define YY_ATTRIBUTE(Spec) /* empty */ 244 # endif 245 #endif 246 247 #ifndef YY_ATTRIBUTE_PURE 248 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 249 #endif 250 251 #ifndef YY_ATTRIBUTE_UNUSED 252 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 253 #endif 254 255 #if !defined _Noreturn \ 256 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 257 # if defined _MSC_VER && 1200 <= _MSC_VER 258 # define _Noreturn __declspec (noreturn) 259 # else 260 # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 261 # endif 262 #endif 263 260 264 /* Suppress unused-variable warnings by "using" E. */ 261 265 #if ! defined lint || defined __GNUC__ … … 265 269 #endif 266 270 267 /* Identity function, used to suppress warnings about constant conditions. */ 268 #ifndef lint 269 # define YYID(N) (N) 271 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 272 /* Suppress an incorrect diagnostic about yylval being uninitialized. */ 273 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 274 _Pragma ("GCC diagnostic push") \ 275 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 276 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 277 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 278 _Pragma ("GCC diagnostic pop") 270 279 #else 271 #if (defined __STDC__ || defined __C99__FUNC__ \ 272 || defined __cplusplus || defined _MSC_VER) 273 static int 274 YYID (int yyi) 275 #else 276 static int 277 YYID (yyi) 278 int yyi; 279 #endif 280 { 281 return yyi; 282 } 283 #endif 280 # define YY_INITIAL_VALUE(Value) Value 281 #endif 282 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 283 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 284 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 285 #endif 286 #ifndef YY_INITIAL_VALUE 287 # define YY_INITIAL_VALUE(Value) /* Nothing. */ 288 #endif 289 284 290 285 291 #if ! defined yyoverflow || YYERROR_VERBOSE … … 300 306 # else 301 307 # define YYSTACK_ALLOC alloca 302 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 303 || defined __cplusplus || defined _MSC_VER) 308 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 304 309 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 305 310 /* Use EXIT_SUCCESS as a witness for stdlib.h. */ … … 313 318 314 319 # ifdef YYSTACK_ALLOC 315 /* Pacify GCC's `empty if-body' warning. */316 # define YYSTACK_FREE(Ptr) do { /* empty */; } while ( YYID (0))320 /* Pacify GCC's 'empty if-body' warning. */ 321 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 317 322 # ifndef YYSTACK_ALLOC_MAXIMUM 318 323 /* The OS might guarantee only one guard page at the bottom of the stack, … … 330 335 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 331 336 && ! ((defined YYMALLOC || defined malloc) \ 332 337 && (defined YYFREE || defined free))) 333 338 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 334 339 # ifndef EXIT_SUCCESS … … 338 343 # ifndef YYMALLOC 339 344 # define YYMALLOC malloc 340 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 341 || defined __cplusplus || defined _MSC_VER) 345 # if ! defined malloc && ! defined EXIT_SUCCESS 342 346 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 343 347 # endif … … 345 349 # ifndef YYFREE 346 350 # define YYFREE free 347 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 348 || defined __cplusplus || defined _MSC_VER) 351 # if ! defined free && ! defined EXIT_SUCCESS 349 352 void free (void *); /* INFRINGES ON USER NAME SPACE */ 350 353 # endif … … 356 359 #if (! defined yyoverflow \ 357 360 && (! defined __cplusplus \ 358 361 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 359 362 360 363 /* A type that is properly aligned for any stack member. */ … … 381 384 stack. Advance YYPTR to a properly aligned location for the next 382 385 stack. */ 383 # define YYSTACK_RELOCATE(Stack_alloc, Stack) 384 do 385 { 386 YYSIZE_T yynewbytes;\387 YYCOPY (&yyptr->Stack_alloc, Stack, yysize);\388 Stack = &yyptr->Stack_alloc;\389 390 yyptr += yynewbytes / sizeof (*yyptr);\391 } 392 while ( YYID (0))386 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 387 do \ 388 { \ 389 YYSIZE_T yynewbytes; \ 390 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 391 Stack = &yyptr->Stack_alloc; \ 392 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 393 yyptr += yynewbytes / sizeof (*yyptr); \ 394 } \ 395 while (0) 393 396 394 397 #endif … … 409 412 (Dst)[yyi] = (Src)[yyi]; \ 410 413 } \ 411 while ( YYID (0))414 while (0) 412 415 # endif 413 416 # endif … … 417 420 #define YYFINAL 16 418 421 /* YYLAST -- Last index in YYTABLE. */ 419 #define YYLAST 2 29422 #define YYLAST 204 420 423 421 424 /* YYNTOKENS -- Number of terminals. */ 422 #define YYNTOKENS 2 2425 #define YYNTOKENS 21 423 426 /* YYNNTS -- Number of nonterminals. */ 424 427 #define YYNNTS 4 425 428 /* YYNRULES -- Number of rules. */ 426 #define YYNRULES 56 427 /* YYNRULES -- Number of states. */ 428 #define YYNSTATES 116 429 430 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 429 #define YYNRULES 52 430 /* YYNSTATES -- Number of states. */ 431 #define YYNSTATES 108 432 433 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned 434 by yylex, with out-of-bounds checking. */ 431 435 #define YYUNDEFTOK 2 432 #define YYMAXUTOK 27 6433 434 #define YYTRANSLATE(YYX) 436 #define YYMAXUTOK 275 437 438 #define YYTRANSLATE(YYX) \ 435 439 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 436 440 437 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 441 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM 442 as returned by yylex, without out-of-bounds checking. */ 438 443 static const yytype_uint8 yytranslate[] = 439 444 { … … 465 470 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 466 471 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 467 15, 16, 17, 18, 19, 20 , 21472 15, 16, 17, 18, 19, 20 468 473 }; 469 474 470 475 #if YYDEBUG 471 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 472 YYRHS. */ 473 static const yytype_uint8 yyprhs[] = 474 { 475 0, 0, 3, 5, 8, 10, 12, 16, 20, 24, 476 28, 31, 35, 39, 43, 47, 51, 55, 59, 63, 477 68, 70, 72, 76, 80, 84, 88, 91, 95, 99, 478 103, 107, 111, 115, 119, 123, 127, 131, 135, 139, 479 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 480 183, 187, 191, 195, 199, 203, 207 481 }; 482 483 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 484 static const yytype_int8 yyrhs[] = 485 { 486 23, 0, -1, 20, -1, 25, 20, -1, 3, -1, 487 4, -1, 24, 7, 24, -1, 24, 8, 24, -1, 488 24, 9, 24, -1, 24, 10, 24, -1, 8, 24, 489 -1, 24, 11, 24, -1, 24, 12, 24, -1, 24, 490 13, 24, -1, 24, 14, 24, -1, 24, 15, 24, 491 -1, 24, 16, 24, -1, 24, 17, 24, -1, 18, 492 24, 19, -1, 5, 18, 24, 19, -1, 5, -1, 493 6, -1, 25, 7, 25, -1, 25, 8, 25, -1, 494 25, 9, 25, -1, 25, 10, 25, -1, 8, 25, 495 -1, 25, 11, 25, -1, 25, 12, 25, -1, 25, 496 13, 25, -1, 25, 14, 25, -1, 25, 15, 25, 497 -1, 25, 16, 25, -1, 25, 17, 25, -1, 18, 498 25, 19, -1, 25, 7, 24, -1, 24, 7, 25, 499 -1, 25, 8, 24, -1, 24, 8, 25, -1, 25, 500 9, 24, -1, 24, 9, 25, -1, 25, 10, 24, 501 -1, 24, 10, 25, -1, 25, 11, 24, -1, 25, 502 12, 24, -1, 24, 12, 25, -1, 25, 13, 24, 503 -1, 24, 13, 25, -1, 25, 14, 24, -1, 24, 504 14, 25, -1, 25, 15, 24, -1, 24, 15, 25, 505 -1, 25, 16, 24, -1, 24, 16, 25, -1, 25, 506 17, 24, -1, 24, 17, 25, -1, 5, 18, 25, 507 19, -1 508 }; 509 510 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 476 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ 511 477 static const yytype_uint8 yyrline[] = 512 478 { 513 479 0, 61, 61, 62, 66, 67, 68, 69, 70, 71, 514 72, 73, 74, 75, 76, 77, 78, 79, 80, 8 1,480 72, 73, 74, 75, 76, 77, 78, 79, 80, 84, 515 481 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 516 482 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 517 483 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 518 115, 116, 117 , 118, 119, 120, 121484 115, 116, 117 519 485 }; 520 486 #endif … … 526 492 { 527 493 "$end", "error", "$undefined", "NUMBER", "VAR", "ID", "AVERAGE", "PLUS", 528 "MINUS", "TIMES", "DIVIDE", "POWER", "EQ", "LT", "GT", "LE", "GE", "NE",494 "MINUS", "TIMES", "DIVIDE", "POWER", "EQ", "LT", "GT", "LE", "GE", 529 495 "LEFT_PARENTHESIS", "RIGHT_PARENTHESIS", "END", "NEG", "$accept", "Line", 530 "Expression", "Field_expr", YY_NULL 496 "Expression", "Field_expr", YY_NULLPTR 531 497 }; 532 498 #endif 533 499 534 500 # ifdef YYPRINT 535 /* YYTOKNUM[ YYLEX-NUM] -- Internal token number corresponding to536 token YYLEX-NUM. */501 /* YYTOKNUM[NUM] -- (External) token number corresponding to the 502 (internal) symbol number NUM (which must be that of a token). */ 537 503 static const yytype_uint16 yytoknum[] = 538 504 { 539 505 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 540 506 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 541 275 , 276507 275 542 508 }; 543 509 # endif 544 510 545 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 511 #define YYPACT_NINF -13 512 513 #define yypact_value_is_default(Yystate) \ 514 (!!((Yystate) == (-13))) 515 516 #define YYTABLE_NINF -1 517 518 #define yytable_value_is_error(Yytable_value) \ 519 0 520 521 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 522 STATE-NUM. */ 523 static const yytype_int16 yypact[] = 524 { 525 90, -13, -13, -12, -13, 35, 35, -13, 44, 188, 526 103, 35, 24, 34, 116, 128, -13, 35, 35, 35, 527 35, 65, 35, 35, 35, 35, 35, 35, 35, 35, 528 35, 35, 35, 35, 35, 35, 35, -13, 140, 152, 529 -13, -13, -7, 23, -7, 23, 24, 34, 24, 34, 530 54, 65, 65, 24, 0, 67, 0, 67, 0, 67, 531 0, 67, 0, 67, -7, 23, -7, 23, 24, 34, 532 24, 34, 24, 34, 0, 67, 0, 67, 0, 67, 533 0, 67, 0, 67, -13, -13, 65, 24, 164, 65, 534 65, 65, 65, 65, 65, 65, 65, 65, 176, 95, 535 95, 24, 24, 92, 92, 92, 92, 92 536 }; 537 538 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 539 Performed when YYTABLE does not specify something else to do. Zero 540 means the default is an error. */ 541 static const yytype_uint8 yydefact[] = 542 { 543 0, 4, 5, 19, 20, 0, 0, 2, 0, 0, 544 0, 0, 10, 25, 0, 0, 1, 0, 0, 0, 545 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 546 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 547 17, 32, 6, 34, 7, 36, 8, 38, 9, 40, 548 0, 0, 0, 11, 12, 43, 13, 45, 14, 47, 549 15, 49, 16, 51, 33, 21, 35, 22, 37, 23, 550 39, 24, 41, 26, 42, 27, 44, 28, 46, 29, 551 48, 30, 50, 31, 18, 52, 0, 10, 0, 0, 552 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 553 7, 8, 9, 12, 13, 14, 15, 16 554 }; 555 556 /* YYPGOTO[NTERM-NUM]. */ 557 static const yytype_int8 yypgoto[] = 558 { 559 -13, -13, -5, 31 560 }; 561 562 /* YYDEFGOTO[NTERM-NUM]. */ 563 static const yytype_int8 yydefgoto[] = 564 { 565 -1, 8, 9, 10 566 }; 567 568 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If 569 positive, shift that token. If negative, reduce the rule whose 570 number is the opposite. If YYTABLE_NINF, syntax error. */ 571 static const yytype_uint8 yytable[] = 572 { 573 12, 14, 19, 20, 21, 11, 38, 17, 18, 19, 574 20, 21, 42, 44, 46, 48, 53, 54, 56, 58, 575 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 576 80, 82, 29, 30, 31, 21, 13, 15, 1, 2, 577 3, 4, 39, 5, 16, 31, 87, 88, 43, 45, 578 47, 49, 6, 55, 57, 59, 61, 63, 65, 67, 579 69, 71, 73, 75, 77, 79, 81, 83, 1, 2, 580 50, 86, 0, 51, 27, 28, 29, 30, 31, 0, 581 0, 98, 52, 0, 99, 100, 101, 102, 103, 104, 582 105, 106, 107, 1, 2, 3, 4, 0, 5, 89, 583 90, 91, 92, 21, 91, 92, 21, 6, 0, 7, 584 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 585 0, 0, 37, 17, 18, 19, 20, 21, 22, 23, 586 24, 25, 26, 0, 40, 27, 28, 29, 30, 31, 587 32, 33, 34, 35, 36, 0, 41, 17, 18, 19, 588 20, 21, 22, 23, 24, 25, 26, 0, 84, 27, 589 28, 29, 30, 31, 32, 33, 34, 35, 36, 0, 590 85, 89, 90, 91, 92, 21, 93, 94, 95, 96, 591 97, 0, 40, 89, 90, 91, 92, 21, 93, 94, 592 95, 96, 97, 0, 84, 17, 18, 19, 20, 21, 593 22, 23, 24, 25, 26 594 }; 595 596 static const yytype_int8 yycheck[] = 597 { 598 5, 6, 9, 10, 11, 17, 11, 7, 8, 9, 599 10, 11, 17, 18, 19, 20, 21, 22, 23, 24, 600 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 601 35, 36, 9, 10, 11, 11, 5, 6, 3, 4, 602 5, 6, 11, 8, 0, 11, 51, 52, 17, 18, 603 19, 20, 17, 22, 23, 24, 25, 26, 27, 28, 604 29, 30, 31, 32, 33, 34, 35, 36, 3, 4, 605 5, 17, -1, 8, 7, 8, 9, 10, 11, -1, 606 -1, 86, 17, -1, 89, 90, 91, 92, 93, 94, 607 95, 96, 97, 3, 4, 5, 6, -1, 8, 7, 608 8, 9, 10, 11, 9, 10, 11, 17, -1, 19, 609 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 610 -1, -1, 19, 7, 8, 9, 10, 11, 12, 13, 611 14, 15, 16, -1, 18, 7, 8, 9, 10, 11, 612 12, 13, 14, 15, 16, -1, 18, 7, 8, 9, 613 10, 11, 12, 13, 14, 15, 16, -1, 18, 7, 614 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, 615 18, 7, 8, 9, 10, 11, 12, 13, 14, 15, 616 16, -1, 18, 7, 8, 9, 10, 11, 12, 13, 617 14, 15, 16, -1, 18, 7, 8, 9, 10, 11, 618 12, 13, 14, 15, 16 619 }; 620 621 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 622 symbol of state STATE-NUM. */ 623 static const yytype_uint8 yystos[] = 624 { 625 0, 3, 4, 5, 6, 8, 17, 19, 22, 23, 626 24, 17, 23, 24, 23, 24, 0, 7, 8, 9, 627 10, 11, 12, 13, 14, 15, 16, 7, 8, 9, 628 10, 11, 12, 13, 14, 15, 16, 19, 23, 24, 629 18, 18, 23, 24, 23, 24, 23, 24, 23, 24, 630 5, 8, 17, 23, 23, 24, 23, 24, 23, 24, 631 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 632 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 633 23, 24, 23, 24, 18, 18, 17, 23, 23, 7, 634 8, 9, 10, 12, 13, 14, 15, 16, 23, 23, 635 23, 23, 23, 23, 23, 23, 23, 23 636 }; 637 638 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 546 639 static const yytype_uint8 yyr1[] = 547 640 { 548 0, 22, 23, 23, 24, 24, 24, 24, 24, 24, 641 0, 21, 22, 22, 23, 23, 23, 23, 23, 23, 642 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 549 643 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 550 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 551 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 552 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 553 25, 25, 25, 25, 25, 25, 25 644 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 645 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 646 24, 24, 24 554 647 }; 555 648 556 /* YYR2[YYN] -- Number of symbols composingright hand side of rule YYN. */649 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ 557 650 static const yytype_uint8 yyr2[] = 558 651 { 559 652 0, 2, 1, 2, 1, 1, 3, 3, 3, 3, 560 2, 3, 3, 3, 3, 3, 3, 3, 3, 4,561 1, 1, 3, 3, 3, 3, 2, 3, 3, 3,653 2, 3, 3, 3, 3, 3, 3, 3, 4, 1, 654 1, 3, 3, 3, 3, 2, 3, 3, 3, 3, 562 655 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 563 656 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 564 3, 3, 3, 3, 3, 3,4657 3, 3, 4 565 658 }; 566 659 567 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 568 Performed when YYTABLE doesn't specify something else to do. Zero 569 means the default is an error. */ 570 static const yytype_uint8 yydefact[] = 571 { 572 0, 4, 5, 20, 21, 0, 0, 2, 0, 0, 573 0, 0, 10, 26, 0, 0, 1, 0, 0, 0, 574 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 575 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 576 0, 0, 18, 34, 6, 36, 7, 38, 8, 40, 577 9, 42, 0, 0, 0, 11, 12, 45, 13, 47, 578 14, 49, 15, 51, 16, 53, 17, 55, 35, 22, 579 37, 23, 39, 24, 41, 25, 43, 27, 44, 28, 580 46, 29, 48, 30, 50, 31, 52, 32, 54, 33, 581 19, 56, 0, 10, 0, 0, 0, 0, 0, 0, 582 0, 0, 0, 0, 0, 0, 6, 7, 8, 9, 583 12, 13, 14, 15, 16, 17 584 }; 585 586 /* YYDEFGOTO[NTERM-NUM]. */ 587 static const yytype_int8 yydefgoto[] = 588 { 589 -1, 8, 9, 10 590 }; 591 592 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 593 STATE-NUM. */ 594 #define YYPACT_NINF -14 595 static const yytype_int16 yypact[] = 596 { 597 97, -14, -14, -13, -14, 70, 70, -14, 37, 207, 598 115, 70, 32, 34, 129, 142, -14, 70, 70, 70, 599 70, 103, 70, 70, 70, 70, 70, 70, 70, 70, 600 70, 70, 70, 70, 70, 70, 70, 70, 70, -14, 601 155, 168, -14, -14, -7, 25, -7, 25, 32, 34, 602 32, 34, 28, 103, 103, 32, 0, 72, 0, 72, 603 0, 72, 0, 72, 0, 72, 0, 72, -7, 25, 604 -7, 25, 32, 34, 32, 34, 32, 34, 0, 72, 605 0, 72, 0, 72, 0, 72, 0, 72, 0, 72, 606 -14, -14, 103, 32, 181, 103, 103, 103, 103, 103, 607 103, 103, 103, 103, 103, 194, 31, 31, 32, 32, 608 218, 218, 218, 218, 218, 218 609 }; 610 611 /* YYPGOTO[NTERM-NUM]. */ 612 static const yytype_int8 yypgoto[] = 613 { 614 -14, -14, -5, 33 615 }; 616 617 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 618 positive, shift that token. If negative, reduce the rule which 619 number is the opposite. If YYTABLE_NINF, syntax error. */ 620 #define YYTABLE_NINF -1 621 static const yytype_uint8 yytable[] = 622 { 623 12, 14, 19, 20, 21, 11, 40, 17, 18, 19, 624 20, 21, 44, 46, 48, 50, 55, 56, 58, 60, 625 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 626 82, 84, 86, 88, 30, 31, 32, 16, 13, 15, 627 97, 98, 21, 21, 41, 32, 92, 0, 93, 94, 628 45, 47, 49, 51, 0, 57, 59, 61, 63, 65, 629 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 630 87, 89, 0, 1, 2, 3, 4, 0, 5, 28, 631 29, 30, 31, 32, 0, 0, 0, 105, 6, 0, 632 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 633 1, 2, 3, 4, 0, 5, 1, 2, 52, 0, 634 0, 53, 0, 0, 0, 6, 0, 7, 0, 0, 635 0, 54, 28, 29, 30, 31, 32, 33, 34, 35, 636 36, 37, 38, 0, 0, 39, 17, 18, 19, 20, 637 21, 22, 23, 24, 25, 26, 27, 0, 42, 28, 638 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 639 0, 43, 17, 18, 19, 20, 21, 22, 23, 24, 640 25, 26, 27, 0, 90, 28, 29, 30, 31, 32, 641 33, 34, 35, 36, 37, 38, 0, 91, 95, 96, 642 97, 98, 21, 99, 100, 101, 102, 103, 104, 0, 643 42, 95, 96, 97, 98, 21, 99, 100, 101, 102, 644 103, 104, 0, 90, 17, 18, 19, 20, 21, 22, 645 23, 24, 25, 26, 27, 95, 96, 97, 98, 21 646 }; 647 648 #define yypact_value_is_default(Yystate) \ 649 (!!((Yystate) == (-14))) 650 651 #define yytable_value_is_error(Yytable_value) \ 652 YYID (0) 653 654 static const yytype_int8 yycheck[] = 655 { 656 5, 6, 9, 10, 11, 18, 11, 7, 8, 9, 657 10, 11, 17, 18, 19, 20, 21, 22, 23, 24, 658 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 659 35, 36, 37, 38, 9, 10, 11, 0, 5, 6, 660 9, 10, 11, 11, 11, 11, 18, -1, 53, 54, 661 17, 18, 19, 20, -1, 22, 23, 24, 25, 26, 662 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 663 37, 38, -1, 3, 4, 5, 6, -1, 8, 7, 664 8, 9, 10, 11, -1, -1, -1, 92, 18, -1, 665 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 666 3, 4, 5, 6, -1, 8, 3, 4, 5, -1, 667 -1, 8, -1, -1, -1, 18, -1, 20, -1, -1, 668 -1, 18, 7, 8, 9, 10, 11, 12, 13, 14, 669 15, 16, 17, -1, -1, 20, 7, 8, 9, 10, 670 11, 12, 13, 14, 15, 16, 17, -1, 19, 7, 671 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 672 -1, 19, 7, 8, 9, 10, 11, 12, 13, 14, 673 15, 16, 17, -1, 19, 7, 8, 9, 10, 11, 674 12, 13, 14, 15, 16, 17, -1, 19, 7, 8, 675 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, 676 19, 7, 8, 9, 10, 11, 12, 13, 14, 15, 677 16, 17, -1, 19, 7, 8, 9, 10, 11, 12, 678 13, 14, 15, 16, 17, 7, 8, 9, 10, 11 679 }; 680 681 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 682 symbol of state STATE-NUM. */ 683 static const yytype_uint8 yystos[] = 684 { 685 0, 3, 4, 5, 6, 8, 18, 20, 23, 24, 686 25, 18, 24, 25, 24, 25, 0, 7, 8, 9, 687 10, 11, 12, 13, 14, 15, 16, 17, 7, 8, 688 9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 689 24, 25, 19, 19, 24, 25, 24, 25, 24, 25, 690 24, 25, 5, 8, 18, 24, 24, 25, 24, 25, 691 24, 25, 24, 25, 24, 25, 24, 25, 24, 25, 692 24, 25, 24, 25, 24, 25, 24, 25, 24, 25, 693 24, 25, 24, 25, 24, 25, 24, 25, 24, 25, 694 19, 19, 18, 24, 24, 7, 8, 9, 10, 12, 695 13, 14, 15, 16, 17, 24, 24, 24, 24, 24, 696 24, 24, 24, 24, 24, 24 697 }; 698 699 #define yyerrok (yyerrstatus = 0) 700 #define yyclearin (yychar = YYEMPTY) 701 #define YYEMPTY (-2) 702 #define YYEOF 0 703 704 #define YYACCEPT goto yyacceptlab 705 #define YYABORT goto yyabortlab 706 #define YYERROR goto yyerrorlab 707 708 709 /* Like YYERROR except do call yyerror. This remains here temporarily 710 to ease the transition to the new meaning of YYERROR, for GCC. 711 Once GCC version 2 has supplanted version 1, this can go. However, 712 YYFAIL appears to be in use. Nevertheless, it is formally deprecated 713 in Bison 2.4.2's NEWS entry, where a plan to phase it out is 714 discussed. */ 715 716 #define YYFAIL goto yyerrlab 717 #if defined YYFAIL 718 /* This is here to suppress warnings from the GCC cpp's 719 -Wunused-macros. Normally we don't worry about that warning, but 720 some users do, and we want to make it easy for users to remove 721 YYFAIL uses, which will produce warnings from Bison 2.5. */ 722 #endif 660 661 #define yyerrok (yyerrstatus = 0) 662 #define yyclearin (yychar = YYEMPTY) 663 #define YYEMPTY (-2) 664 #define YYEOF 0 665 666 #define YYACCEPT goto yyacceptlab 667 #define YYABORT goto yyabortlab 668 #define YYERROR goto yyerrorlab 669 723 670 724 671 #define YYRECOVERING() (!!yyerrstatus) … … 737 684 { \ 738 685 yyerror (YY_("syntax error: cannot back up")); \ 739 YYERROR; 740 } 741 while ( YYID (0))686 YYERROR; \ 687 } \ 688 while (0) 742 689 743 690 /* Error token number */ 744 #define YYTERROR 1 745 #define YYERRCODE 256 746 747 748 /* This macro is provided for backward compatibility. */ 749 #ifndef YY_LOCATION_PRINT 750 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 751 #endif 752 753 754 /* YYLEX -- calling `yylex' with the right arguments. */ 755 #ifdef YYLEX_PARAM 756 # define YYLEX yylex (YYLEX_PARAM) 757 #else 758 # define YYLEX yylex () 759 #endif 691 #define YYTERROR 1 692 #define YYERRCODE 256 693 694 760 695 761 696 /* Enable debugging if requested. */ … … 767 702 # endif 768 703 769 # define YYDPRINTF(Args) \ 770 do { \ 771 if (yydebug) \ 772 YYFPRINTF Args; \ 773 } while (YYID (0)) 774 775 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 776 do { \ 777 if (yydebug) \ 778 { \ 779 YYFPRINTF (stderr, "%s ", Title); \ 780 yy_symbol_print (stderr, \ 781 Type, Value); \ 782 YYFPRINTF (stderr, "\n"); \ 783 } \ 784 } while (YYID (0)) 785 786 787 /*--------------------------------. 788 | Print this symbol on YYOUTPUT. | 789 `--------------------------------*/ 790 791 /*ARGSUSED*/ 792 #if (defined __STDC__ || defined __C99__FUNC__ \ 793 || defined __cplusplus || defined _MSC_VER) 704 # define YYDPRINTF(Args) \ 705 do { \ 706 if (yydebug) \ 707 YYFPRINTF Args; \ 708 } while (0) 709 710 /* This macro is provided for backward compatibility. */ 711 #ifndef YY_LOCATION_PRINT 712 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 713 #endif 714 715 716 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 717 do { \ 718 if (yydebug) \ 719 { \ 720 YYFPRINTF (stderr, "%s ", Title); \ 721 yy_symbol_print (stderr, \ 722 Type, Value); \ 723 YYFPRINTF (stderr, "\n"); \ 724 } \ 725 } while (0) 726 727 728 /*----------------------------------------. 729 | Print this symbol's value on YYOUTPUT. | 730 `----------------------------------------*/ 731 794 732 static void 795 733 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 796 #else797 static void798 yy_symbol_value_print (yyoutput, yytype, yyvaluep)799 FILE *yyoutput;800 int yytype;801 YYSTYPE const * const yyvaluep;802 #endif803 734 { 804 735 FILE *yyo = yyoutput; … … 809 740 if (yytype < YYNTOKENS) 810 741 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 811 # else812 YYUSE (yyoutput);813 742 # endif 814 switch (yytype) 815 { 816 default: 817 break; 818 } 743 YYUSE (yytype); 819 744 } 820 745 … … 824 749 `--------------------------------*/ 825 750 826 #if (defined __STDC__ || defined __C99__FUNC__ \827 || defined __cplusplus || defined _MSC_VER)828 751 static void 829 752 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 830 #else 831 static void 832 yy_symbol_print (yyoutput, yytype, yyvaluep) 833 FILE *yyoutput; 834 int yytype; 835 YYSTYPE const * const yyvaluep; 836 #endif 837 { 838 if (yytype < YYNTOKENS) 839 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 840 else 841 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 753 { 754 YYFPRINTF (yyoutput, "%s %s (", 755 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); 842 756 843 757 yy_symbol_value_print (yyoutput, yytype, yyvaluep); … … 850 764 `------------------------------------------------------------------*/ 851 765 852 #if (defined __STDC__ || defined __C99__FUNC__ \853 || defined __cplusplus || defined _MSC_VER)854 766 static void 855 767 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 856 #else857 static void858 yy_stack_print (yybottom, yytop)859 yytype_int16 *yybottom;860 yytype_int16 *yytop;861 #endif862 768 { 863 769 YYFPRINTF (stderr, "Stack now"); … … 870 776 } 871 777 872 # define YY_STACK_PRINT(Bottom, Top) 873 do { 874 if (yydebug) 875 yy_stack_print ((Bottom), (Top)); 876 } while ( YYID (0))778 # define YY_STACK_PRINT(Bottom, Top) \ 779 do { \ 780 if (yydebug) \ 781 yy_stack_print ((Bottom), (Top)); \ 782 } while (0) 877 783 878 784 … … 881 787 `------------------------------------------------*/ 882 788 883 #if (defined __STDC__ || defined __C99__FUNC__ \884 || defined __cplusplus || defined _MSC_VER)885 789 static void 886 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 887 #else 888 static void 889 yy_reduce_print (yyvsp, yyrule) 890 YYSTYPE *yyvsp; 891 int yyrule; 892 #endif 893 { 790 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) 791 { 792 unsigned long int yylno = yyrline[yyrule]; 894 793 int yynrhs = yyr2[yyrule]; 895 794 int yyi; 896 unsigned long int yylno = yyrline[yyrule];897 795 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 898 796 yyrule - 1, yylno); 899 797 /* The symbols being reduced. */ 900 798 for (yyi = 0; yyi < yynrhs; yyi++) 901 799 { 902 800 YYFPRINTF (stderr, " $%d = ", yyi + 1); 903 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 904 &(yyvsp[(yyi + 1) - (yynrhs)]) 905 ); 801 yy_symbol_print (stderr, 802 yystos[yyssp[yyi + 1 - yynrhs]], 803 &(yyvsp[(yyi + 1) - (yynrhs)]) 804 ); 906 805 YYFPRINTF (stderr, "\n"); 907 806 } 908 807 } 909 808 910 # define YY_REDUCE_PRINT(Rule) 911 do { 912 if (yydebug) 913 yy_reduce_print (yy vsp, Rule); \914 } while ( YYID (0))809 # define YY_REDUCE_PRINT(Rule) \ 810 do { \ 811 if (yydebug) \ 812 yy_reduce_print (yyssp, yyvsp, Rule); \ 813 } while (0) 915 814 916 815 /* Nonzero means print parse trace. It is left uninitialized so that … … 926 825 927 826 /* YYINITDEPTH -- initial size of the parser's stacks. */ 928 #ifndef 827 #ifndef YYINITDEPTH 929 828 # define YYINITDEPTH 200 930 829 #endif … … 949 848 # else 950 849 /* Return the length of YYSTR. */ 951 #if (defined __STDC__ || defined __C99__FUNC__ \952 || defined __cplusplus || defined _MSC_VER)953 850 static YYSIZE_T 954 851 yystrlen (const char *yystr) 955 #else956 static YYSIZE_T957 yystrlen (yystr)958 const char *yystr;959 #endif960 852 { 961 853 YYSIZE_T yylen; … … 973 865 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 974 866 YYDEST. */ 975 #if (defined __STDC__ || defined __C99__FUNC__ \976 || defined __cplusplus || defined _MSC_VER)977 867 static char * 978 868 yystpcpy (char *yydest, const char *yysrc) 979 #else980 static char *981 yystpcpy (yydest, yysrc)982 char *yydest;983 const char *yysrc;984 #endif985 869 { 986 870 char *yyd = yydest; … … 1012 896 1013 897 for (;;) 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 898 switch (*++yyp) 899 { 900 case '\'': 901 case ',': 902 goto do_not_strip_quotes; 903 904 case '\\': 905 if (*++yyp != '\\') 906 goto do_not_strip_quotes; 907 /* Fall through. */ 908 default: 909 if (yyres) 910 yyres[yyn] = *yyp; 911 yyn++; 912 break; 913 914 case '"': 915 if (yyres) 916 yyres[yyn] = '\0'; 917 return yyn; 918 } 1035 919 do_not_strip_quotes: ; 1036 920 } … … 1055 939 yytype_int16 *yyssp, int yytoken) 1056 940 { 1057 YYSIZE_T yysize0 = yytnamerr (YY_NULL , yytname[yytoken]);941 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); 1058 942 YYSIZE_T yysize = yysize0; 1059 943 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1060 944 /* Internationalized format string. */ 1061 const char *yyformat = YY_NULL ;945 const char *yyformat = YY_NULLPTR; 1062 946 /* Arguments of yyformat. */ 1063 947 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; … … 1067 951 1068 952 /* There are many possibilities here to consider: 1069 - Assume YYFAIL is not used. It's too flawed to consider. See1070 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>1071 for details. YYERROR is fine as it does not invoke this1072 function.1073 953 - If this state is a consistent state with a default action, then 1074 954 the only way this function was invoked is if the default action … … 1120 1000 yyarg[yycount++] = yytname[yyx]; 1121 1001 { 1122 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL , yytname[yyx]);1002 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); 1123 1003 if (! (yysize <= yysize1 1124 1004 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) … … 1187 1067 `-----------------------------------------------*/ 1188 1068 1189 /*ARGSUSED*/1190 #if (defined __STDC__ || defined __C99__FUNC__ \1191 || defined __cplusplus || defined _MSC_VER)1192 1069 static void 1193 1070 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1194 #else1195 static void1196 yydestruct (yymsg, yytype, yyvaluep)1197 const char *yymsg;1198 int yytype;1199 YYSTYPE *yyvaluep;1200 #endif1201 1071 { 1202 1072 YYUSE (yyvaluep); 1203 1204 1073 if (!yymsg) 1205 1074 yymsg = "Deleting"; 1206 1075 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1207 1076 1208 switch (yytype) 1209 { 1210 1211 default: 1212 break; 1213 } 1077 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1078 YYUSE (yytype); 1079 YY_IGNORE_MAYBE_UNINITIALIZED_END 1214 1080 } 1215 1081 … … 1220 1086 int yychar; 1221 1087 1222 1223 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN1224 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN1225 # define YY_IGNORE_MAYBE_UNINITIALIZED_END1226 #endif1227 #ifndef YY_INITIAL_VALUE1228 # define YY_INITIAL_VALUE(Value) /* Nothing. */1229 #endif1230 1231 1088 /* The semantic value of the lookahead symbol. */ 1232 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); 1233 1089 YYSTYPE yylval; 1234 1090 /* Number of syntax errors so far. */ 1235 1091 int yynerrs; … … 1240 1096 `----------*/ 1241 1097 1242 #ifdef YYPARSE_PARAM1243 #if (defined __STDC__ || defined __C99__FUNC__ \1244 || defined __cplusplus || defined _MSC_VER)1245 int1246 yyparse (void *YYPARSE_PARAM)1247 #else1248 int1249 yyparse (YYPARSE_PARAM)1250 void *YYPARSE_PARAM;1251 #endif1252 #else /* ! YYPARSE_PARAM */1253 #if (defined __STDC__ || defined __C99__FUNC__ \1254 || defined __cplusplus || defined _MSC_VER)1255 1098 int 1256 1099 yyparse (void) 1257 #else1258 int1259 yyparse ()1260 1261 #endif1262 #endif1263 1100 { 1264 1101 int yystate; … … 1267 1104 1268 1105 /* The stacks and their tools: 1269 `yyss': related to states.1270 `yyvs': related to semantic values.1106 'yyss': related to states. 1107 'yyvs': related to semantic values. 1271 1108 1272 1109 Refer to the stacks through separate pointers, to allow yyoverflow … … 1336 1173 #ifdef yyoverflow 1337 1174 { 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1175 /* Give user a chance to reallocate the stack. Use copies of 1176 these so that the &'s don't force the real ones into 1177 memory. */ 1178 YYSTYPE *yyvs1 = yyvs; 1179 yytype_int16 *yyss1 = yyss; 1180 1181 /* Each stack pointer address is followed by the size of the 1182 data in use in that stack, in bytes. This used to be a 1183 conditional around just the two extra args, but that might 1184 be undefined if yyoverflow is a macro. */ 1185 yyoverflow (YY_("memory exhausted"), 1186 &yyss1, yysize * sizeof (*yyssp), 1187 &yyvs1, yysize * sizeof (*yyvsp), 1188 &yystacksize); 1189 1190 yyss = yyss1; 1191 yyvs = yyvs1; 1355 1192 } 1356 1193 #else /* no yyoverflow */ … … 1360 1197 /* Extend the stack our own way. */ 1361 1198 if (YYMAXDEPTH <= yystacksize) 1362 1199 goto yyexhaustedlab; 1363 1200 yystacksize *= 2; 1364 1201 if (YYMAXDEPTH < yystacksize) 1365 1202 yystacksize = YYMAXDEPTH; 1366 1203 1367 1204 { 1368 1369 1370 1371 1372 1373 1374 1205 yytype_int16 *yyss1 = yyss; 1206 union yyalloc *yyptr = 1207 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1208 if (! yyptr) 1209 goto yyexhaustedlab; 1210 YYSTACK_RELOCATE (yyss_alloc, yyss); 1211 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1375 1212 # undef YYSTACK_RELOCATE 1376 1377 1213 if (yyss1 != yyssa) 1214 YYSTACK_FREE (yyss1); 1378 1215 } 1379 1216 # endif … … 1384 1221 1385 1222 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1386 1223 (unsigned long int) yystacksize)); 1387 1224 1388 1225 if (yyss + yystacksize - 1 <= yyssp) 1389 1226 YYABORT; 1390 1227 } 1391 1228 … … 1416 1253 { 1417 1254 YYDPRINTF ((stderr, "Reading a token: ")); 1418 yychar = YYLEX;1255 yychar = yylex (); 1419 1256 } 1420 1257 … … 1481 1318 1482 1319 /* If YYLEN is nonzero, implement the default value of the action: 1483 `$$ = $1'.1320 '$$ = $1'. 1484 1321 1485 1322 Otherwise, the following line sets YYVAL to garbage. … … 1495 1332 { 1496 1333 case 2: 1497 /* Line 1792 of yacc.c */ 1498 #line 61 "yacc_parser.yacc" 1334 #line 61 "yacc_parser.yacc" /* yacc.c:1646 */ 1499 1335 { /* Nothing to do */ } 1336 #line 1337 "yacc_parser.cpp" /* yacc.c:1646 */ 1500 1337 break; 1501 1338 1502 1339 case 3: 1503 /* Line 1792 of yacc.c*/1504 #line 62 "yacc_parser.yacc" 1505 { parsed = (yyvsp[(1) - (2)].filterNode); } 1340 #line 62 "yacc_parser.yacc" /* yacc.c:1646 */ 1341 { parsed = (yyvsp[-1].filterNode); } 1342 #line 1343 "yacc_parser.cpp" /* yacc.c:1646 */ 1506 1343 break; 1507 1344 1508 1345 case 4: 1509 /* Line 1792 of yacc.c*/1510 #line 66 "yacc_parser.yacc" 1511 { (yyval.scalarNode) = new CScalarValExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); } 1346 #line 66 "yacc_parser.yacc" /* yacc.c:1646 */ 1347 { (yyval.scalarNode) = new CScalarValExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 1348 #line 1349 "yacc_parser.cpp" /* yacc.c:1646 */ 1512 1349 break; 1513 1350 1514 1351 case 5: 1515 /* Line 1792 of yacc.c*/1516 #line 67 "yacc_parser.yacc" 1517 { (yyval.scalarNode) = new CScalarVarExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); } 1352 #line 67 "yacc_parser.yacc" /* yacc.c:1646 */ 1353 { (yyval.scalarNode) = new CScalarVarExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 1354 #line 1355 "yacc_parser.cpp" /* yacc.c:1646 */ 1518 1355 break; 1519 1356 1520 1357 case 6: 1521 /* Line 1792 of yacc.c*/1522 #line 68 "yacc_parser.yacc" 1523 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "add", (yyvsp[(3) - (3)].scalarNode)); } 1358 #line 68 "yacc_parser.yacc" /* yacc.c:1646 */ 1359 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].scalarNode)); } 1360 #line 1361 "yacc_parser.cpp" /* yacc.c:1646 */ 1524 1361 break; 1525 1362 1526 1363 case 7: 1527 /* Line 1792 of yacc.c*/1528 #line 69 "yacc_parser.yacc" 1529 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "minus", (yyvsp[(3) - (3)].scalarNode)); } 1364 #line 69 "yacc_parser.yacc" /* yacc.c:1646 */ 1365 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].scalarNode)); } 1366 #line 1367 "yacc_parser.cpp" /* yacc.c:1646 */ 1530 1367 break; 1531 1368 1532 1369 case 8: 1533 /* Line 1792 of yacc.c*/1534 #line 70 "yacc_parser.yacc" 1535 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "mult", (yyvsp[(3) - (3)].scalarNode)); } 1370 #line 70 "yacc_parser.yacc" /* yacc.c:1646 */ 1371 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].scalarNode)); } 1372 #line 1373 "yacc_parser.cpp" /* yacc.c:1646 */ 1536 1373 break; 1537 1374 1538 1375 case 9: 1539 /* Line 1792 of yacc.c*/1540 #line 71 "yacc_parser.yacc" 1541 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "div", (yyvsp[(3) - (3)].scalarNode)); } 1376 #line 71 "yacc_parser.yacc" /* yacc.c:1646 */ 1377 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].scalarNode)); } 1378 #line 1379 "yacc_parser.cpp" /* yacc.c:1646 */ 1542 1379 break; 1543 1380 1544 1381 case 10: 1545 /* Line 1792 of yacc.c*/1546 #line 72 "yacc_parser.yacc" 1547 { (yyval.scalarNode) = new CScalarUnaryOpExprNode("neg", (yyvsp[(2) - (2)].scalarNode)); } 1382 #line 72 "yacc_parser.yacc" /* yacc.c:1646 */ 1383 { (yyval.scalarNode) = new CScalarUnaryOpExprNode("neg", (yyvsp[0].scalarNode)); } 1384 #line 1385 "yacc_parser.cpp" /* yacc.c:1646 */ 1548 1385 break; 1549 1386 1550 1387 case 11: 1551 /* Line 1792 of yacc.c*/1552 #line 73 "yacc_parser.yacc" 1553 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "pow", (yyvsp[(3) - (3)].scalarNode)); } 1388 #line 73 "yacc_parser.yacc" /* yacc.c:1646 */ 1389 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "pow", (yyvsp[0].scalarNode)); } 1390 #line 1391 "yacc_parser.cpp" /* yacc.c:1646 */ 1554 1391 break; 1555 1392 1556 1393 case 12: 1557 /* Line 1792 of yacc.c*/1558 #line 74 "yacc_parser.yacc" 1559 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "eq", (yyvsp[(3) - (3)].scalarNode)); } 1394 #line 74 "yacc_parser.yacc" /* yacc.c:1646 */ 1395 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].scalarNode)); } 1396 #line 1397 "yacc_parser.cpp" /* yacc.c:1646 */ 1560 1397 break; 1561 1398 1562 1399 case 13: 1563 /* Line 1792 of yacc.c*/1564 #line 75 "yacc_parser.yacc" 1565 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "lt", (yyvsp[(3) - (3)].scalarNode)); } 1400 #line 75 "yacc_parser.yacc" /* yacc.c:1646 */ 1401 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].scalarNode)); } 1402 #line 1403 "yacc_parser.cpp" /* yacc.c:1646 */ 1566 1403 break; 1567 1404 1568 1405 case 14: 1569 /* Line 1792 of yacc.c*/1570 #line 76 "yacc_parser.yacc" 1571 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "gt", (yyvsp[(3) - (3)].scalarNode)); } 1406 #line 76 "yacc_parser.yacc" /* yacc.c:1646 */ 1407 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].scalarNode)); } 1408 #line 1409 "yacc_parser.cpp" /* yacc.c:1646 */ 1572 1409 break; 1573 1410 1574 1411 case 15: 1575 /* Line 1792 of yacc.c*/1576 #line 77 "yacc_parser.yacc" 1577 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "le", (yyvsp[(3) - (3)].scalarNode)); } 1412 #line 77 "yacc_parser.yacc" /* yacc.c:1646 */ 1413 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].scalarNode)); } 1414 #line 1415 "yacc_parser.cpp" /* yacc.c:1646 */ 1578 1415 break; 1579 1416 1580 1417 case 16: 1581 /* Line 1792 of yacc.c*/1582 #line 78 "yacc_parser.yacc" 1583 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "ge", (yyvsp[(3) - (3)].scalarNode)); } 1418 #line 78 "yacc_parser.yacc" /* yacc.c:1646 */ 1419 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].scalarNode)); } 1420 #line 1421 "yacc_parser.cpp" /* yacc.c:1646 */ 1584 1421 break; 1585 1422 1586 1423 case 17: 1587 /* Line 1792 of yacc.c*/1588 #line 79 "yacc_parser.yacc" 1589 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[(1) - (3)].scalarNode), "ne", (yyvsp[(3) - (3)].scalarNode)); } 1424 #line 79 "yacc_parser.yacc" /* yacc.c:1646 */ 1425 { (yyval.scalarNode) = (yyvsp[-1].scalarNode); } 1426 #line 1427 "yacc_parser.cpp" /* yacc.c:1646 */ 1590 1427 break; 1591 1428 1592 1429 case 18: 1593 /* Line 1792 of yacc.c*/1594 #line 80 "yacc_parser.yacc" 1595 { (yyval.scalarNode) = (yyvsp[(2) - (3)].scalarNode); } 1430 #line 80 "yacc_parser.yacc" /* yacc.c:1646 */ 1431 { (yyval.scalarNode) = new CScalarUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].scalarNode)); delete (yyvsp[-3].str); } 1432 #line 1433 "yacc_parser.cpp" /* yacc.c:1646 */ 1596 1433 break; 1597 1434 1598 1435 case 19: 1599 /* Line 1792 of yacc.c*/1600 #line 81 "yacc_parser.yacc" 1601 { (yyval.scalarNode) = new CScalarUnaryOpExprNode(*(yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].scalarNode)); delete (yyvsp[(1) - (4)].str); } 1436 #line 84 "yacc_parser.yacc" /* yacc.c:1646 */ 1437 { (yyval.filterNode) = new CFilterFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 1438 #line 1439 "yacc_parser.cpp" /* yacc.c:1646 */ 1602 1439 break; 1603 1440 1604 1441 case 20: 1605 /* Line 1792 of yacc.c*/1606 #line 85 "yacc_parser.yacc" 1607 { (yyval.filterNode) = new CFilterFieldExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); } 1442 #line 85 "yacc_parser.yacc" /* yacc.c:1646 */ 1443 { (yyval.filterNode) = new CFilterTemporalFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 1444 #line 1445 "yacc_parser.cpp" /* yacc.c:1646 */ 1608 1445 break; 1609 1446 1610 1447 case 21: 1611 /* Line 1792 of yacc.c*/1612 #line 86 "yacc_parser.yacc" 1613 { (yyval.filterNode) = new CFilterTemporalFieldExprNode(*(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str); } 1448 #line 86 "yacc_parser.yacc" /* yacc.c:1646 */ 1449 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].filterNode)); } 1450 #line 1451 "yacc_parser.cpp" /* yacc.c:1646 */ 1614 1451 break; 1615 1452 1616 1453 case 22: 1617 /* Line 1792 of yacc.c*/1618 #line 87 "yacc_parser.yacc" 1619 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "add", (yyvsp[(3) - (3)].filterNode)); } 1454 #line 87 "yacc_parser.yacc" /* yacc.c:1646 */ 1455 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].filterNode)); } 1456 #line 1457 "yacc_parser.cpp" /* yacc.c:1646 */ 1620 1457 break; 1621 1458 1622 1459 case 23: 1623 /* Line 1792 of yacc.c*/1624 #line 88 "yacc_parser.yacc" 1625 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "minus", (yyvsp[(3) - (3)].filterNode)); } 1460 #line 88 "yacc_parser.yacc" /* yacc.c:1646 */ 1461 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].filterNode)); } 1462 #line 1463 "yacc_parser.cpp" /* yacc.c:1646 */ 1626 1463 break; 1627 1464 1628 1465 case 24: 1629 /* Line 1792 of yacc.c*/1630 #line 89 "yacc_parser.yacc" 1631 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "mult", (yyvsp[(3) - (3)].filterNode)); } 1466 #line 89 "yacc_parser.yacc" /* yacc.c:1646 */ 1467 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].filterNode)); } 1468 #line 1469 "yacc_parser.cpp" /* yacc.c:1646 */ 1632 1469 break; 1633 1470 1634 1471 case 25: 1635 /* Line 1792 of yacc.c*/1636 #line 90 "yacc_parser.yacc" 1637 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "div", (yyvsp[(3) - (3)].filterNode)); } 1472 #line 90 "yacc_parser.yacc" /* yacc.c:1646 */ 1473 { (yyval.filterNode) = new CFilterUnaryOpExprNode("neg", (yyvsp[0].filterNode)); } 1474 #line 1475 "yacc_parser.cpp" /* yacc.c:1646 */ 1638 1475 break; 1639 1476 1640 1477 case 26: 1641 /* Line 1792 of yacc.c*/1642 #line 91 "yacc_parser.yacc" 1643 { (yyval.filterNode) = new CFilterUnaryOpExprNode("neg", (yyvsp[(2) - (2)].filterNode)); } 1478 #line 91 "yacc_parser.yacc" /* yacc.c:1646 */ 1479 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].filterNode)); } 1480 #line 1481 "yacc_parser.cpp" /* yacc.c:1646 */ 1644 1481 break; 1645 1482 1646 1483 case 27: 1647 /* Line 1792 of yacc.c*/1648 #line 92 "yacc_parser.yacc" 1649 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "pow", (yyvsp[(3) - (3)].filterNode)); } 1484 #line 92 "yacc_parser.yacc" /* yacc.c:1646 */ 1485 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].filterNode)); } 1486 #line 1487 "yacc_parser.cpp" /* yacc.c:1646 */ 1650 1487 break; 1651 1488 1652 1489 case 28: 1653 /* Line 1792 of yacc.c*/1654 #line 93 "yacc_parser.yacc" 1655 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "eq", (yyvsp[(3) - (3)].filterNode)); } 1490 #line 93 "yacc_parser.yacc" /* yacc.c:1646 */ 1491 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].filterNode)); } 1492 #line 1493 "yacc_parser.cpp" /* yacc.c:1646 */ 1656 1493 break; 1657 1494 1658 1495 case 29: 1659 /* Line 1792 of yacc.c*/1660 #line 94 "yacc_parser.yacc" 1661 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "lt", (yyvsp[(3) - (3)].filterNode)); } 1496 #line 94 "yacc_parser.yacc" /* yacc.c:1646 */ 1497 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].filterNode)); } 1498 #line 1499 "yacc_parser.cpp" /* yacc.c:1646 */ 1662 1499 break; 1663 1500 1664 1501 case 30: 1665 /* Line 1792 of yacc.c*/1666 #line 95 "yacc_parser.yacc" 1667 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "gt", (yyvsp[(3) - (3)].filterNode)); } 1502 #line 95 "yacc_parser.yacc" /* yacc.c:1646 */ 1503 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].filterNode)); } 1504 #line 1505 "yacc_parser.cpp" /* yacc.c:1646 */ 1668 1505 break; 1669 1506 1670 1507 case 31: 1671 /* Line 1792 of yacc.c*/1672 #line 96 "yacc_parser.yacc" 1673 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "le", (yyvsp[(3) - (3)].filterNode)); } 1508 #line 96 "yacc_parser.yacc" /* yacc.c:1646 */ 1509 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].filterNode)); } 1510 #line 1511 "yacc_parser.cpp" /* yacc.c:1646 */ 1674 1511 break; 1675 1512 1676 1513 case 32: 1677 /* Line 1792 of yacc.c*/1678 #line 97 "yacc_parser.yacc" 1679 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "ge", (yyvsp[(3) - (3)].filterNode)); } 1514 #line 97 "yacc_parser.yacc" /* yacc.c:1646 */ 1515 { (yyval.filterNode) = (yyvsp[-1].filterNode); } 1516 #line 1517 "yacc_parser.cpp" /* yacc.c:1646 */ 1680 1517 break; 1681 1518 1682 1519 case 33: 1683 /* Line 1792 of yacc.c*/1684 #line 98 "yacc_parser.yacc" 1685 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[(1) - (3)].filterNode), "ne", (yyvsp[(3) - (3)].filterNode)); } 1520 #line 98 "yacc_parser.yacc" /* yacc.c:1646 */ 1521 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].scalarNode)); } 1522 #line 1523 "yacc_parser.cpp" /* yacc.c:1646 */ 1686 1523 break; 1687 1524 1688 1525 case 34: 1689 /* Line 1792 of yacc.c*/1690 #line 99 "yacc_parser.yacc" 1691 { (yyval.filterNode) = (yyvsp[(2) - (3)].filterNode); } 1526 #line 99 "yacc_parser.yacc" /* yacc.c:1646 */ 1527 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].filterNode)); } 1528 #line 1529 "yacc_parser.cpp" /* yacc.c:1646 */ 1692 1529 break; 1693 1530 1694 1531 case 35: 1695 /* Line 1792 of yacc.c*/1696 #line 100 "yacc_parser.yacc" 1697 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "add", (yyvsp[(3) - (3)].scalarNode)); } 1532 #line 100 "yacc_parser.yacc" /* yacc.c:1646 */ 1533 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].scalarNode)); } 1534 #line 1535 "yacc_parser.cpp" /* yacc.c:1646 */ 1698 1535 break; 1699 1536 1700 1537 case 36: 1701 /* Line 1792 of yacc.c*/1702 #line 101 "yacc_parser.yacc" 1703 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "add", (yyvsp[(3) - (3)].filterNode)); } 1538 #line 101 "yacc_parser.yacc" /* yacc.c:1646 */ 1539 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].filterNode)); } 1540 #line 1541 "yacc_parser.cpp" /* yacc.c:1646 */ 1704 1541 break; 1705 1542 1706 1543 case 37: 1707 /* Line 1792 of yacc.c*/1708 #line 102 "yacc_parser.yacc" 1709 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "minus", (yyvsp[(3) - (3)].scalarNode)); } 1544 #line 102 "yacc_parser.yacc" /* yacc.c:1646 */ 1545 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].scalarNode)); } 1546 #line 1547 "yacc_parser.cpp" /* yacc.c:1646 */ 1710 1547 break; 1711 1548 1712 1549 case 38: 1713 /* Line 1792 of yacc.c*/1714 #line 103 "yacc_parser.yacc" 1715 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "minus", (yyvsp[(3) - (3)].filterNode)); } 1550 #line 103 "yacc_parser.yacc" /* yacc.c:1646 */ 1551 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].filterNode)); } 1552 #line 1553 "yacc_parser.cpp" /* yacc.c:1646 */ 1716 1553 break; 1717 1554 1718 1555 case 39: 1719 /* Line 1792 of yacc.c*/1720 #line 104 "yacc_parser.yacc" 1721 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "mult", (yyvsp[(3) - (3)].scalarNode)); } 1556 #line 104 "yacc_parser.yacc" /* yacc.c:1646 */ 1557 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].scalarNode)); } 1558 #line 1559 "yacc_parser.cpp" /* yacc.c:1646 */ 1722 1559 break; 1723 1560 1724 1561 case 40: 1725 /* Line 1792 of yacc.c*/1726 #line 105 "yacc_parser.yacc" 1727 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "mult", (yyvsp[(3) - (3)].filterNode)); } 1562 #line 105 "yacc_parser.yacc" /* yacc.c:1646 */ 1563 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].filterNode)); } 1564 #line 1565 "yacc_parser.cpp" /* yacc.c:1646 */ 1728 1565 break; 1729 1566 1730 1567 case 41: 1731 /* Line 1792 of yacc.c*/1732 #line 106 "yacc_parser.yacc" 1733 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "div", (yyvsp[(3) - (3)].scalarNode)); } 1568 #line 106 "yacc_parser.yacc" /* yacc.c:1646 */ 1569 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].scalarNode)); } 1570 #line 1571 "yacc_parser.cpp" /* yacc.c:1646 */ 1734 1571 break; 1735 1572 1736 1573 case 42: 1737 /* Line 1792 of yacc.c*/1738 #line 107 "yacc_parser.yacc" 1739 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "div", (yyvsp[(3) - (3)].filterNode)); } 1574 #line 107 "yacc_parser.yacc" /* yacc.c:1646 */ 1575 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].scalarNode)); } 1576 #line 1577 "yacc_parser.cpp" /* yacc.c:1646 */ 1740 1577 break; 1741 1578 1742 1579 case 43: 1743 /* Line 1792 of yacc.c*/1744 #line 108 "yacc_parser.yacc" 1745 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "pow", (yyvsp[(3) - (3)].scalarNode)); } 1580 #line 108 "yacc_parser.yacc" /* yacc.c:1646 */ 1581 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].filterNode)); } 1582 #line 1583 "yacc_parser.cpp" /* yacc.c:1646 */ 1746 1583 break; 1747 1584 1748 1585 case 44: 1749 /* Line 1792 of yacc.c*/1750 #line 109 "yacc_parser.yacc" 1751 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "eq", (yyvsp[(3) - (3)].scalarNode)); } 1586 #line 109 "yacc_parser.yacc" /* yacc.c:1646 */ 1587 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].scalarNode)); } 1588 #line 1589 "yacc_parser.cpp" /* yacc.c:1646 */ 1752 1589 break; 1753 1590 1754 1591 case 45: 1755 /* Line 1792 of yacc.c*/1756 #line 110 "yacc_parser.yacc" 1757 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "eq", (yyvsp[(3) - (3)].filterNode)); } 1592 #line 110 "yacc_parser.yacc" /* yacc.c:1646 */ 1593 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].filterNode)); } 1594 #line 1595 "yacc_parser.cpp" /* yacc.c:1646 */ 1758 1595 break; 1759 1596 1760 1597 case 46: 1761 /* Line 1792 of yacc.c*/1762 #line 111 "yacc_parser.yacc" 1763 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "lt", (yyvsp[(3) - (3)].scalarNode)); } 1598 #line 111 "yacc_parser.yacc" /* yacc.c:1646 */ 1599 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].scalarNode)); } 1600 #line 1601 "yacc_parser.cpp" /* yacc.c:1646 */ 1764 1601 break; 1765 1602 1766 1603 case 47: 1767 /* Line 1792 of yacc.c*/1768 #line 112 "yacc_parser.yacc" 1769 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "lt", (yyvsp[(3) - (3)].filterNode)); } 1604 #line 112 "yacc_parser.yacc" /* yacc.c:1646 */ 1605 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].filterNode)); } 1606 #line 1607 "yacc_parser.cpp" /* yacc.c:1646 */ 1770 1607 break; 1771 1608 1772 1609 case 48: 1773 /* Line 1792 of yacc.c*/1774 #line 113 "yacc_parser.yacc" 1775 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "gt", (yyvsp[(3) - (3)].scalarNode)); } 1610 #line 113 "yacc_parser.yacc" /* yacc.c:1646 */ 1611 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].scalarNode)); } 1612 #line 1613 "yacc_parser.cpp" /* yacc.c:1646 */ 1776 1613 break; 1777 1614 1778 1615 case 49: 1779 /* Line 1792 of yacc.c*/1780 #line 114 "yacc_parser.yacc" 1781 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "gt", (yyvsp[(3) - (3)].filterNode)); } 1616 #line 114 "yacc_parser.yacc" /* yacc.c:1646 */ 1617 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].filterNode)); } 1618 #line 1619 "yacc_parser.cpp" /* yacc.c:1646 */ 1782 1619 break; 1783 1620 1784 1621 case 50: 1785 /* Line 1792 of yacc.c*/1786 #line 115 "yacc_parser.yacc" 1787 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "le", (yyvsp[(3) - (3)].scalarNode)); } 1622 #line 115 "yacc_parser.yacc" /* yacc.c:1646 */ 1623 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].scalarNode)); } 1624 #line 1625 "yacc_parser.cpp" /* yacc.c:1646 */ 1788 1625 break; 1789 1626 1790 1627 case 51: 1791 /* Line 1792 of yacc.c*/1792 #line 116 "yacc_parser.yacc" 1793 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "le", (yyvsp[(3) - (3)].filterNode)); } 1628 #line 116 "yacc_parser.yacc" /* yacc.c:1646 */ 1629 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].filterNode)); } 1630 #line 1631 "yacc_parser.cpp" /* yacc.c:1646 */ 1794 1631 break; 1795 1632 1796 1633 case 52: 1797 /* Line 1792 of yacc.c */ 1798 #line 117 "yacc_parser.yacc" 1799 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "ge", (yyvsp[(3) - (3)].scalarNode)); } 1800 break; 1801 1802 case 53: 1803 /* Line 1792 of yacc.c */ 1804 #line 118 "yacc_parser.yacc" 1805 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "ge", (yyvsp[(3) - (3)].filterNode)); } 1806 break; 1807 1808 case 54: 1809 /* Line 1792 of yacc.c */ 1810 #line 119 "yacc_parser.yacc" 1811 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[(1) - (3)].filterNode), "ne", (yyvsp[(3) - (3)].scalarNode)); } 1812 break; 1813 1814 case 55: 1815 /* Line 1792 of yacc.c */ 1816 #line 120 "yacc_parser.yacc" 1817 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[(1) - (3)].scalarNode), "ne", (yyvsp[(3) - (3)].filterNode)); } 1818 break; 1819 1820 case 56: 1821 /* Line 1792 of yacc.c */ 1822 #line 121 "yacc_parser.yacc" 1823 { (yyval.filterNode) = new CFilterUnaryOpExprNode(*(yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].filterNode)); delete (yyvsp[(1) - (4)].str); } 1824 break; 1825 1826 1827 /* Line 1792 of yacc.c */ 1828 #line 1829 "yacc_parser.cpp" 1634 #line 117 "yacc_parser.yacc" /* yacc.c:1646 */ 1635 { (yyval.filterNode) = new CFilterUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].filterNode)); delete (yyvsp[-3].str); } 1636 #line 1637 "yacc_parser.cpp" /* yacc.c:1646 */ 1637 break; 1638 1639 1640 #line 1641 "yacc_parser.cpp" /* yacc.c:1646 */ 1829 1641 default: break; 1830 1642 } … … 1848 1660 *++yyvsp = yyval; 1849 1661 1850 /* Now `shift' the result of the reduction. Determine what state1662 /* Now 'shift' the result of the reduction. Determine what state 1851 1663 that goes to, based on the state we popped back to and the rule 1852 1664 number reduced by. */ … … 1863 1675 1864 1676 1865 /*------------------------------------ .1866 | yyerrlab -- here on detecting error |1867 `------------------------------------ */1677 /*--------------------------------------. 1678 | yyerrlab -- here on detecting error. | 1679 `--------------------------------------*/ 1868 1680 yyerrlab: 1869 1681 /* Make sure we have latest lookahead translation. See comments at … … 1916 1728 { 1917 1729 /* If just tried and failed to reuse lookahead token after an 1918 1730 error, discard it. */ 1919 1731 1920 1732 if (yychar <= YYEOF) 1921 1922 1923 1924 1925 1733 { 1734 /* Return failure if at end of input. */ 1735 if (yychar == YYEOF) 1736 YYABORT; 1737 } 1926 1738 else 1927 1928 1929 1930 1931 1739 { 1740 yydestruct ("Error: discarding", 1741 yytoken, &yylval); 1742 yychar = YYEMPTY; 1743 } 1932 1744 } 1933 1745 … … 1948 1760 goto yyerrorlab; 1949 1761 1950 /* Do not reclaim the symbols of the rule wh ichaction triggered1762 /* Do not reclaim the symbols of the rule whose action triggered 1951 1763 this YYERROR. */ 1952 1764 YYPOPSTACK (yylen); … … 1961 1773 `-------------------------------------------------------------*/ 1962 1774 yyerrlab1: 1963 yyerrstatus = 3; 1775 yyerrstatus = 3; /* Each real token shifted decrements this. */ 1964 1776 1965 1777 for (;;) … … 1967 1779 yyn = yypact[yystate]; 1968 1780 if (!yypact_value_is_default (yyn)) 1969 1970 1971 1972 1973 1974 1975 1976 1977 1781 { 1782 yyn += YYTERROR; 1783 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1784 { 1785 yyn = yytable[yyn]; 1786 if (0 < yyn) 1787 break; 1788 } 1789 } 1978 1790 1979 1791 /* Pop the current state because it cannot handle the error token. */ 1980 1792 if (yyssp == yyss) 1981 1793 YYABORT; 1982 1794 1983 1795 1984 1796 yydestruct ("Error: popping", 1985 1797 yystos[yystate], yyvsp); 1986 1798 YYPOPSTACK (1); 1987 1799 yystate = *yyssp; … … 2034 1846 yytoken, &yylval); 2035 1847 } 2036 /* Do not reclaim the symbols of the rule wh ichaction triggered1848 /* Do not reclaim the symbols of the rule whose action triggered 2037 1849 this YYABORT or YYACCEPT. */ 2038 1850 YYPOPSTACK (yylen); … … 2041 1853 { 2042 1854 yydestruct ("Cleanup: popping", 2043 1855 yystos[*yyssp], yyvsp); 2044 1856 YYPOPSTACK (1); 2045 1857 } … … 2052 1864 YYSTACK_FREE (yymsg); 2053 1865 #endif 2054 /* Make sure YYID is used. */ 2055 return YYID (yyresult); 1866 return yyresult; 2056 1867 } 2057 2058 2059 /* Line 2055 of yacc.c */ 2060 #line 123 "yacc_parser.yacc" 1868 #line 119 "yacc_parser.yacc" /* yacc.c:1906 */ 2061 1869 2062 1870 -
XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.hpp
r1019 r1037 1 /* A Bison parser, made by GNU Bison 2.7. */1 /* A Bison parser, made by GNU Bison 3.0.2. */ 2 2 3 3 /* Bison interface for Yacc-like parsers in C 4 5 Copyright (C) 1984, 1989-1990, 2000-2012Free Software Foundation, Inc.6 4 5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. 6 7 7 This program is free software: you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation, either version 3 of the License, or 10 10 (at your option) any later version. 11 11 12 12 This program is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 15 GNU General Public License for more details. 16 16 17 17 You should have received a copy of the GNU General Public License 18 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ … … 27 27 Bison output files to be licensed under the GNU General Public 28 28 License without this special exception. 29 29 30 30 This special exception was added by the Free Software Foundation in 31 31 version 2.2 of Bison. */ … … 33 33 #ifndef YY_YY_YACC_PARSER_HPP_INCLUDED 34 34 # define YY_YY_YACC_PARSER_HPP_INCLUDED 35 /* Enabling traces. */35 /* Debug traces. */ 36 36 #ifndef YYDEBUG 37 37 # define YYDEBUG 0 … … 41 41 #endif 42 42 43 /* Token s. */43 /* Token type. */ 44 44 #ifndef YYTOKENTYPE 45 45 # define YYTOKENTYPE 46 /* Put the tokens into the symbol table, so that GDB and other debuggers 47 know about them. */ 48 enum yytokentype { 49 NUMBER = 258, 50 VAR = 259, 51 ID = 260, 52 AVERAGE = 261, 53 PLUS = 262, 54 MINUS = 263, 55 TIMES = 264, 56 DIVIDE = 265, 57 POWER = 266, 58 EQ = 267, 59 LT = 268, 60 GT = 269, 61 LE = 270, 62 GE = 271, 63 NE = 272, 64 LEFT_PARENTHESIS = 273, 65 RIGHT_PARENTHESIS = 274, 66 END = 275, 67 NEG = 276 68 }; 46 enum yytokentype 47 { 48 NUMBER = 258, 49 VAR = 259, 50 ID = 260, 51 AVERAGE = 261, 52 PLUS = 262, 53 MINUS = 263, 54 TIMES = 264, 55 DIVIDE = 265, 56 POWER = 266, 57 EQ = 267, 58 LT = 268, 59 GT = 269, 60 LE = 270, 61 GE = 271, 62 LEFT_PARENTHESIS = 272, 63 RIGHT_PARENTHESIS = 273, 64 END = 274, 65 NEG = 275 66 }; 69 67 #endif 70 68 71 69 /* Value type. */ 72 70 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 73 typedef union YYSTYPE 71 typedef union YYSTYPE YYSTYPE; 72 union YYSTYPE 74 73 { 75 /* Line 2058 of yacc.c */ 76 #line 35 "yacc_parser.yacc" 74 #line 35 "yacc_parser.yacc" /* yacc.c:1909 */ 77 75 78 76 std::string* str; /* symbol table index */ … … 80 78 xios::IFilterExprNode* filterNode; 81 79 82 83 /* Line 2058 of yacc.c */ 84 #line 85 "yacc_parser.hpp" 85 } YYSTYPE; 80 #line 81 "yacc_parser.hpp" /* yacc.c:1909 */ 81 }; 86 82 # define YYSTYPE_IS_TRIVIAL 1 87 # define yystype YYSTYPE /* obsolescent; will be withdrawn */88 83 # define YYSTYPE_IS_DECLARED 1 89 84 #endif 90 85 86 91 87 extern YYSTYPE yylval; 92 88 93 #ifdef YYPARSE_PARAM94 #if defined __STDC__ || defined __cplusplus95 int yyparse (void *YYPARSE_PARAM);96 #else97 int yyparse ();98 #endif99 #else /* ! YYPARSE_PARAM */100 #if defined __STDC__ || defined __cplusplus101 89 int yyparse (void); 102 #else103 int yyparse ();104 #endif105 #endif /* ! YYPARSE_PARAM */106 90 107 91 #endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED */ -
XIOS/dev/branch_yushan/src/parse_expr/yacc_parser.yacc
r1019 r1037 42 42 %token <str> VAR ID AVERAGE 43 43 %token PLUS MINUS TIMES DIVIDE POWER 44 %token EQ LT GT LE GE NE44 %token EQ LT GT LE GE 45 45 %token LEFT_PARENTHESIS RIGHT_PARENTHESIS 46 46 %token <str> END 47 47 48 %left EQ LT GT LE GE NE48 %left EQ LT GT LE GE 49 49 %left PLUS MINUS 50 50 %left TIMES DIVIDE … … 77 77 | Expression LE Expression { $$ = new CScalarBinaryOpExprNode($1, "le", $3); } 78 78 | Expression GE Expression { $$ = new CScalarBinaryOpExprNode($1, "ge", $3); } 79 | Expression NE Expression { $$ = new CScalarBinaryOpExprNode($1, "ne", $3); }80 79 | LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS { $$ = $2; } 81 80 | ID LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS { $$ = new CScalarUnaryOpExprNode(*$1, $3); delete $1; } … … 96 95 | Field_expr LE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "le", $3); } 97 96 | Field_expr GE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "ge", $3); } 98 | Field_expr NE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "ne", $3); }99 97 | LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS { $$ = $2; } 100 98 | Field_expr PLUS Expression { $$ = new CFilterFieldScalarOpExprNode($1, "add", $3); } … … 117 115 | Field_expr GE Expression { $$ = new CFilterFieldScalarOpExprNode($1, "ge", $3); } 118 116 | Expression GE Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "ge", $3); } 119 | Field_expr NE Expression { $$ = new CFilterFieldScalarOpExprNode($1, "ne", $3); }120 | Expression NE Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "ne", $3); }121 117 | ID LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS { $$ = new CFilterUnaryOpExprNode(*$1, $3); delete $1; } 122 118 ; -
XIOS/dev/branch_yushan/src/registry.cpp
r696 r1037 4 4 #include <fstream> 5 5 #include <sstream> 6 6 7 7 8 namespace xios … … 221 222 222 223 int* sizes=new int[mpiSize] ; 223 CBufferOut localBuffer(this->size()) ; 224 size_t st = this->size(); 225 CBufferOut localBuffer(st) ; 224 226 this->toBuffer(localBuffer) ; 225 227 int localSize=localBuffer.count() ; 226 MPI_Gather(&localSize,1,MPI_INT,sizes,1,MPI_INT,0,comm) ; 228 MPI_Gather(&localSize,1,MPI_INT,sizes,1,MPI_INT,0,comm) ; 227 229 228 230 char* globalBuffer ; … … 252 254 } 253 255 else MPI_Gatherv(localBuffer.start(),localSize,MPI_CHAR,globalBuffer,sizes,displs,MPI_CHAR,0,comm) ; 256 254 257 delete[] sizes ; 255 258 … … 258 261 void CRegistry::hierarchicalGatherRegistry(void) 259 262 { 260 hierarchicalGatherRegistry(communicator) ;263 //hierarchicalGatherRegistry(communicator) ; 261 264 } 262 265 -
XIOS/dev/branch_yushan/src/registry.hpp
r700 r1037 6 6 #include "mpi.hpp" 7 7 #include "message.hpp" 8 #ifdef _usingEP 9 #include "ep_declaration.hpp" 10 #endif 11 8 12 9 13 // Those two headers can be replaced by the C++11 equivalent in the future … … 23 27 24 28 /** Constructor, the communicator is used for bcast or gather operation between MPI processes */ 29 25 30 CRegistry(const MPI_Comm& comm=MPI_COMM_WORLD) : communicator(comm) {} 26 31 32 33 27 34 /** Copy constructor */ 28 35 CRegistry(const CRegistry& reg) ; -
XIOS/dev/branch_yushan/src/server.cpp
r1032 r1037 9 9 #include <boost/functional/hash.hpp> 10 10 #include <boost/algorithm/string.hpp> 11 #include "mpi.hpp"11 //#include "mpi.hpp" 12 12 #include "tracer.hpp" 13 13 #include "timer.hpp" … … 26 26 bool CServer::finished=false ; 27 27 bool CServer::is_MPI_Initialized ; 28 29 28 30 CEventScheduler* CServer::eventScheduler = 0; 29 31 30 32 void CServer::initialize(void) 31 33 { 32 int initialized ;33 MPI_Initialized(&initialized) ;34 if (initialized) is_MPI_Initialized=true ;35 else is_MPI_Initialized=false ;36 37 34 // Not using OASIS 38 35 if (!CXios::usingOasis) 39 36 { 40 37 41 if (!is_MPI_Initialized)42 {43 MPI_Init(NULL, NULL);44 }45 38 CTimer::get("XIOS").resume() ; 46 39 … … 50 43 unsigned long* hashAll ; 51 44 52 // int rank ; 45 53 46 int size ; 54 47 int myColor ; … … 77 70 78 71 myColor=colors[hashServer] ; 79 MPI_Comm_split(MPI_COMM_WORLD,myColor,rank,&intraComm) ; 80 72 73 74 MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ; 75 76 81 77 int serverLeader=leaders[hashServer] ; 82 78 int clientLeader; … … 96 92 MPI_Intercomm_create(intraComm,0,CXios::globalComm,clientLeader,0,&newComm) ; 97 93 interComm.push_back(newComm) ; 94 printf("after inter create, interComm.size = %lu\n", interComm.size()); 98 95 } 99 96 } … … 104 101 else 105 102 { 106 // int rank ,size;107 103 int size; 108 104 if (!is_MPI_Initialized) oasis_init(CXios::xiosCodeId); … … 148 144 149 145 delete eventScheduler ; 146 147 150 148 151 149 for (std::list<MPI_Comm>::iterator it = contextInterComms.begin(); it != contextInterComms.end(); it++) 152 150 MPI_Comm_free(&(*it)); 151 153 152 for (std::list<MPI_Comm>::iterator it = interComm.begin(); it != interComm.end(); it++) 154 153 MPI_Comm_free(&(*it)); 154 155 155 MPI_Comm_free(&intraComm); 156 156 … … 158 158 { 159 159 if (CXios::usingOasis) oasis_finalize(); 160 else MPI_Finalize() ;160 else {MPI_Finalize() ; printf("CServer::finalize called MPI_finalize\n");} 161 161 } 162 163 162 164 report(0)<<"Performance report : Time spent for XIOS : "<<CTimer::get("XIOS server").getCumulatedTime()<<endl ; 163 165 report(0)<<"Performance report : Time spent in processing events : "<<CTimer::get("Process events").getCumulatedTime()<<endl ; … … 174 176 if (isRoot) 175 177 { 176 listenContext(); 177 if (!finished) listenFinalize() ; 178 listenContext(); 179 if (!finished) listenFinalize() ; 178 180 } 179 181 else 180 182 { 181 listenRootContext(); 182 if (!finished) listenRootFinalize() ; 183 } 184 183 listenRootContext(); 184 if (!finished) 185 { 186 listenRootFinalize() ; 187 } 188 } 189 185 190 contextEventLoop() ; 186 191 if (finished && contextList.empty()) stop=true ; 192 187 193 eventScheduler->checkEvent() ; 188 194 } 195 196 189 197 CTimer::get("XIOS server").suspend() ; 190 198 } … … 195 203 int msg ; 196 204 int flag ; 205 197 206 198 207 for(it=interComm.begin();it!=interComm.end();it++) … … 205 214 { 206 215 MPI_Recv(&msg,1,MPI_INT,0,0,*it,&status) ; 216 printf(" CServer : Receive client finalize\n"); 207 217 info(20)<<" CServer : Receive client finalize"<<endl ; 218 208 219 MPI_Comm_free(&(*it)); 209 220 interComm.erase(it) ; … … 234 245 MPI_Status status ; 235 246 int msg ; 236 247 237 248 traceOff() ; 238 249 MPI_Iprobe(0,4,intraComm, &flag, &status) ; … … 249 260 250 261 MPI_Status status ; 251 int flag ;252 static char* buffer ;262 int flag = false ; 263 static void* buffer ; 253 264 static MPI_Request request ; 254 265 static bool recept=false ; 255 266 int rank ; 256 int count ; 267 int count ; 257 268 258 269 if (recept==false) 259 { 270 { 260 271 traceOff() ; 261 272 MPI_Iprobe(MPI_ANY_SOURCE,1,CXios::globalComm, &flag, &status) ; 262 273 traceOn() ; 274 263 275 if (flag==true) 264 276 { 277 #ifdef _usingMPI 265 278 rank=status.MPI_SOURCE ; 279 #elif _usingEP 280 rank= status.ep_src ; 281 #endif 266 282 MPI_Get_count(&status,MPI_CHAR,&count) ; 267 283 buffer=new char[count] ; 268 MPI_Irecv( (void*)buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ;284 MPI_Irecv(buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ; 269 285 recept=true ; 270 286 } 287 271 288 } 272 289 else … … 277 294 if (flag==true) 278 295 { 296 #ifdef _usingMPI 279 297 rank=status.MPI_SOURCE ; 298 #elif _usingEP 299 rank= status.ep_src ; 300 #endif 280 301 MPI_Get_count(&status,MPI_CHAR,&count) ; 281 recvContextMessage((void*)buffer,count) ; 302 recvContextMessage(buffer,count) ; 303 printf("listerContext register context OK, interComm size = %lu\n", interComm.size()); 304 282 305 delete [] buffer ; 283 306 recept=false ; … … 322 345 MPI_Waitall(size-1,requests,status) ; 323 346 registerContext(buff,count,it->second.leaderRank) ; 347 printf("recvContextMessage register context OK\n"); 324 348 325 349 recvContextId.erase(it) ; … … 335 359 MPI_Status status ; 336 360 int flag ; 337 static char* buffer ;361 static void* buffer ; 338 362 static MPI_Request request ; 339 363 static bool recept=false ; … … 341 365 int count ; 342 366 const int root=0 ; 367 343 368 344 369 if (recept==false) … … 351 376 MPI_Get_count(&status,MPI_CHAR,&count) ; 352 377 buffer=new char[count] ; 353 MPI_Irecv( (void*)buffer,count,MPI_CHAR,root,2,intraComm,&request) ;378 MPI_Irecv(buffer,count,MPI_CHAR,root,2,intraComm,&request) ; 354 379 recept=true ; 355 380 } … … 361 386 { 362 387 MPI_Get_count(&status,MPI_CHAR,&count) ; 363 registerContext((void*)buffer,count) ; 388 registerContext(buffer,count) ; 389 printf("listenRootContext register context OK, interComm size = %lu\n", interComm.size()); 364 390 delete [] buffer ; 365 391 recept=false ; … … 381 407 382 408 MPI_Comm contextIntercomm; 409 383 410 MPI_Intercomm_create(intraComm,0,CXios::globalComm,leaderRank,10+leaderRank,&contextIntercomm); 384 411 … … 386 413 MPI_Intercomm_merge(contextIntercomm,1,&inter); 387 414 MPI_Barrier(inter); 415 388 416 389 417 CContext* context=CContext::create(contextId); 390 418 contextList[contextId]=context; 391 419 context->initServer(intraComm,contextIntercomm); 420 421 392 422 393 423 contextInterComms.push_back(contextIntercomm); 424 425 394 426 MPI_Comm_free(&inter); 427 428 printf(" **** server: register context OK\n"); 395 429 } 396 430 -
XIOS/dev/branch_yushan/src/server.hpp
r697 r1037 7 7 #include "mpi.hpp" 8 8 #include "event_scheduler.hpp" 9 10 #ifdef _usingEP 11 #include "ep_declaration.hpp" 12 #endif 9 13 10 14 namespace xios -
XIOS/dev/branch_yushan/src/test/test_client.f90
r794 r1037 35 35 36 36 CALL MPI_INIT(ierr) 37 38 37 CALL init_wait 39 40 !!! XIOS Initialization (get the local communicator) 41 38 42 39 CALL xios_initialize(id,return_comm=comm) 40 41 print*, "test_client xios_initialize OK" 43 42 44 43 CALL MPI_COMM_RANK(comm,rank,ierr) 44 print*, "test_client MPI_COMM_RANK OK" 45 45 CALL MPI_COMM_SIZE(comm,size,ierr) 46 46 47 47 48 DO j=1,nj_glo … … 70 71 lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) 71 72 field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:) 73 74 CALL xios_context_initialize("test",comm) 72 75 73 CALL xios_context_initialize("test",comm)74 76 CALL xios_get_handle("test",ctx_hdl) 77 print*, "Client xios_get_handle OK" 75 78 CALL xios_set_current_context(ctx_hdl) 76 79 print*, "Client xios_set_current_handle OK" 80 81 82 83 77 84 CALL xios_get_calendar_type(calendar_type) 78 85 PRINT *, "calendar_type = ", calendar_type … … 91 98 CALL xios_add_child(file_hdl,field_hdl) 92 99 CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C") 93 100 94 101 dtime%second = 3600 95 102 CALL xios_set_timestep(dtime) 103 print*, "Client xios_set_timestep OK" 96 104 97 105 ! The calendar is created as soon as the calendar type is defined. This way … … 119 127 ni=0 ; lonvalue(:,:)=0; 120 128 CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_2D=lonvalue) 121 122 129 print *,"ni",ni 123 print *,"lonvalue",lonvalue;130 !print *,"lonvalue",lonvalue; 124 131 125 132 CALL xios_is_defined_field_attr("field_A",enabled=ok) 126 133 PRINT *,"field_A : attribute enabled is defined ? ",ok 134 127 135 CALL xios_close_context_definition() 136 print*, "xios_close_context_definition OK" 128 137 129 138 PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 130 DO ts=1,24*10 139 !DO ts=1,24*10 140 DO ts=1,24 131 141 CALL xios_update_calendar(ts) 142 print*, "xios_update_calendar OK, ts = ", ts 132 143 CALL xios_send_field("field_A",field_A) 133 CALL wait_us(5000) ; 144 print*, "xios_send_field OK, ts = ", ts 145 CALL wait_us(5000) 134 146 ENDDO 147 135 148 136 149 CALL xios_context_finalize() 150 print*, "xios_context_finalize OK" 137 151 138 152 DEALLOCATE(lon, lat, field_A, lonvalue) -
XIOS/dev/branch_yushan/src/test/test_regular.f90
r1002 r1037 18 18 INTEGER :: comm 19 19 INTEGER :: ierr 20 INTEGER :: size Comm, rank ! SIZE is a fortran function20 INTEGER :: size, rank 21 21 22 22 INTEGER :: nlon = 100 … … 94 94 95 95 CALL MPI_COMM_RANK(comm,rank,ierr) 96 CALL MPI_COMM_SIZE(comm,size Comm,ierr)96 CALL MPI_COMM_SIZE(comm,size,ierr) 97 97 98 IF (MOD(ncell, size Comm) == 0) THEN99 ni = ncell/size Comm98 IF (MOD(ncell, size) == 0) THEN 99 ni = ncell/size 100 100 ibegin = rank*ni 101 101 ELSE 102 IF (rank < MOD(ncell, size Comm)) THEN103 ni = ncell/size Comm+ 1104 ibegin = rank*(ncell/size Comm+ 1)102 IF (rank < MOD(ncell, size)) THEN 103 ni = ncell/size + 1 104 ibegin = rank*(ncell/size + 1) 105 105 ELSE 106 ni = ncell/size Comm107 IF (rank == MOD(ncell, size Comm)) THEN108 ibegin = rank*(ncell/size Comm+ 1)106 ni = ncell/size 107 IF (rank == MOD(ncell, size)) THEN 108 ibegin = rank*(ncell/size + 1) 109 109 ELSE 110 ibegin = MOD(ncell,size Comm)*(ncell/sizeComm + 1) + (rank-MOD(ncell,sizeComm))*ncell/sizeComm110 ibegin = MOD(ncell,size)*(ncell/size + 1) + (rank-MOD(ncell,size))*ncell/size 111 111 END IF 112 112 END IF … … 118 118 ALLOCATE(bounds_lat(4,ni)) 119 119 ALLOCATE(field_temp(ni,ntime)) 120 lon = lon_glo(1+ibegin: ibegin+ni)121 lat = lat_glo(1+ibegin: ibegin+ni)122 bounds_lon(:,:) = bounds_lon_glo(:,1+ibegin: ibegin+ni)123 bounds_lat(:,:) = bounds_lat_glo(:,1+ibegin: ibegin+ni)120 lon = lon_glo(1+ibegin:1+ibegin+ni) 121 lat = lat_glo(1+ibegin:1+ibegin+ni) 122 bounds_lon(:,:) = bounds_lon_glo(:,1+ibegin:1+ibegin+ni) 123 bounds_lat(:,:) = bounds_lat_glo(:,1+ibegin:1+ibegin+ni) 124 124 field_temp(:,:) = rank 125 125 -
XIOS/dev/branch_yushan/src/test/test_remap.f90
r1018 r1037 91 91 IF (MOD(i,10)==0) THEN 92 92 src_mask_2D(i)=.FALSE. 93 src_field_2D(i) = 10000094 93 ELSE 95 src_mask_2D(i)=.TRUE. 94 src_mask_2D(i)=.TRUE. 96 95 ENDIF 97 96 ENDDO … … 100 99 lval(i) = i*100 101 100 src_field_pression(:,i) = i * 100 102 IF (MOD(i,3)==0) THEN 103 ! src_field_pression(:,i) = 100000 104 src_field_3D(:,i) = 100000 105 ELSE 106 ! src_field_pression(:,i) = i * 100 107 src_field_3D(:,i) = src_field_3D(:,i) + i * 10 108 ENDIF 109 ! src_field_3D(:,i) = src_field_3D(:,i) + i * 10 101 src_field_3D(:,i) = src_field_3D(:,i) + i * 10 110 102 ENDDO 111 103 112 104 DO i=1,llm2 113 src_field_4D(:,:,i) = src_field_3D(:,:) + i * 100105 src_field_4D(:,:,i) = src_field_3D(:,:) 114 106 ENDDO 115 107 … … 192 184 CALL xios_send_field("src_field_2D_clone",src_field_2D) 193 185 CALL xios_send_field("src_field_3D",src_field_3D) 194 CALL xios_send_field("src_field_3D_clone",src_field_3D)195 186 CALL xios_send_field("src_field_4D",src_field_4D) 196 187 CALL xios_send_field("src_field_3D_pression",src_field_pression) -
XIOS/dev/branch_yushan/src/transformation/Functions/average_reduction.cpp
r1018 r1037 3 3 \author Ha NGUYEN 4 4 \since 8 Sep 2016 5 \date 9 Jan 20175 \date 8 Sep 2016 6 6 7 7 \brief average reduction 8 8 */ 9 9 #include "average_reduction.hpp" 10 #include "utils.hpp"11 10 12 11 namespace xios { … … 30 29 const double* dataInput, 31 30 CArray<double,1>& dataOut, 32 std::vector<bool>& flagInitial, 33 const double& defaultValue) 31 std::vector<bool>& flagInitial) 34 32 { 35 33 if (resetWeight_) { weights_.resize(flagInitial.size()); weights_ = 1.0; resetWeight_ = false; } 36 bool hasMissingValue = NumTraits<double>::isnan(defaultValue);37 34 38 if (hasMissingValue) 35 int nbLocalIndex = localIndex.size(); 36 int currentlocalIndex = 0; 37 double currentWeight = 0.0; 38 for (int idx = 0; idx < nbLocalIndex; ++idx) 39 39 { 40 int nbLocalIndex = localIndex.size();41 int currentlocalIndex = 0;42 double currentWeight = 0.0; 43 for (int idx = 0; idx < nbLocalIndex; ++idx)40 currentlocalIndex = localIndex[idx].first; 41 currentWeight = localIndex[idx].second; 42 43 if (flagInitial[currentlocalIndex]) 44 44 { 45 currentlocalIndex = localIndex[idx].first; 46 currentWeight = localIndex[idx].second; 47 if (!NumTraits<double>::isnan(*(dataInput + idx))) 48 { 49 if (flagInitial[currentlocalIndex]) 50 { 51 dataOut(currentlocalIndex) = *(dataInput + idx); 52 flagInitial[currentlocalIndex] = false; 53 } 54 else 55 { 56 dataOut(currentlocalIndex) += *(dataInput + idx); 57 weights_(currentlocalIndex) += 1.0; 58 } 59 } 45 dataOut(currentlocalIndex) = *(dataInput + idx); 46 flagInitial[currentlocalIndex] = false; 60 47 } 61 } 62 else 63 { 64 int nbLocalIndex = localIndex.size(); 65 int currentlocalIndex = 0; 66 double currentWeight = 0.0; 67 for (int idx = 0; idx < nbLocalIndex; ++idx) 48 else 68 49 { 69 currentlocalIndex = localIndex[idx].first; 70 currentWeight = localIndex[idx].second; 71 72 if (flagInitial[currentlocalIndex]) 73 { 74 dataOut(currentlocalIndex) = *(dataInput + idx); 75 flagInitial[currentlocalIndex] = false; 76 } 77 else 78 { 79 dataOut(currentlocalIndex) += *(dataInput + idx); 80 weights_(currentlocalIndex) += 1.0; 81 } 50 dataOut(currentlocalIndex) += *(dataInput + idx); 51 weights_(currentlocalIndex) += 1.0; 82 52 } 83 53 } -
XIOS/dev/branch_yushan/src/transformation/Functions/average_reduction.hpp
r1018 r1037 26 26 const double* dataInput, 27 27 CArray<double,1>& dataOut, 28 std::vector<bool>& flagInitial, 29 const double& defaultValue); 28 std::vector<bool>& flagInitial); 30 29 31 30 virtual void updateData(CArray<double,1>& dataOut); -
XIOS/dev/branch_yushan/src/transformation/Functions/extract.cpp
r1018 r1037 29 29 const double* dataInput, 30 30 CArray<double,1>& dataOut, 31 std::vector<bool>& flagInitial, 32 const double& defaultValue) 31 std::vector<bool>& flagInitial) 33 32 { 34 33 int nbLocalIndex = localIndex.size(); -
XIOS/dev/branch_yushan/src/transformation/Functions/extract.hpp
r1018 r1037 26 26 const double* dataInput, 27 27 CArray<double,1>& dataOut, 28 std::vector<bool>& flagInitial, 29 const double& defaultValue); 28 std::vector<bool>& flagInitial); 30 29 31 30 virtual ~CExtractReductionAlgorithm() {} -
XIOS/dev/branch_yushan/src/transformation/Functions/max_reduction.cpp
r1018 r1037 8 8 */ 9 9 #include "max_reduction.hpp" 10 #include "utils.hpp"11 10 12 11 namespace xios { … … 30 29 const double* dataInput, 31 30 CArray<double,1>& dataOut, 32 std::vector<bool>& flagInitial, 33 const double& defaultValue) 31 std::vector<bool>& flagInitial) 34 32 { 35 bool hasMissingValue = NumTraits<double>::isnan(defaultValue); 36 37 if (hasMissingValue) 33 int nbLocalIndex = localIndex.size(); 34 int currentlocalIndex = 0; 35 double currentWeight = 0.0; 36 for (int idx = 0; idx < nbLocalIndex; ++idx) 38 37 { 39 int nbLocalIndex = localIndex.size();40 int currentlocalIndex = 0;41 for (int idx = 0; idx < nbLocalIndex; ++idx)38 currentlocalIndex = localIndex[idx].first; 39 currentWeight = localIndex[idx].second; 40 if (flagInitial[currentlocalIndex]) 42 41 { 43 currentlocalIndex = localIndex[idx].first; 44 if (!NumTraits<double>::isnan(*(dataInput + idx))) 45 { 46 if (flagInitial[currentlocalIndex]) 47 { 48 dataOut(currentlocalIndex) = *(dataInput + idx); 49 flagInitial[currentlocalIndex] = false; 50 } 51 else 52 { 53 dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 54 } 55 } 42 dataOut(currentlocalIndex) = *(dataInput + idx); 43 flagInitial[currentlocalIndex] = false; 56 44 } 57 } 58 else 59 { 60 int nbLocalIndex = localIndex.size(); 61 int currentlocalIndex = 0; 62 for (int idx = 0; idx < nbLocalIndex; ++idx) 45 else 63 46 { 64 currentlocalIndex = localIndex[idx].first; 65 if (flagInitial[currentlocalIndex]) 66 { 67 dataOut(currentlocalIndex) = *(dataInput + idx); 68 flagInitial[currentlocalIndex] = false; 69 } 70 else 71 { 72 dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 73 } 47 dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 74 48 } 75 49 } -
XIOS/dev/branch_yushan/src/transformation/Functions/max_reduction.hpp
r1018 r1037 26 26 const double* dataInput, 27 27 CArray<double,1>& dataOut, 28 std::vector<bool>& flagInitial, 29 const double& defaultValue); 28 std::vector<bool>& flagInitial); 30 29 31 30 virtual ~CMaxReductionAlgorithm() {} -
XIOS/dev/branch_yushan/src/transformation/Functions/min_reduction.cpp
r1018 r1037 3 3 \author Ha NGUYEN 4 4 \since 27 June 2016 5 \date 9 Jan 20175 \date 27 June 2016 6 6 7 7 \brief min reduction 8 8 */ 9 9 #include "min_reduction.hpp" 10 #include "utils.hpp"11 10 12 11 namespace xios { … … 30 29 const double* dataInput, 31 30 CArray<double,1>& dataOut, 32 std::vector<bool>& flagInitial, 33 const double& defaultValue) 31 std::vector<bool>& flagInitial) 34 32 { 35 bool hasMissingValue = NumTraits<double>::isnan(defaultValue);36 37 if (hasMissingValue)33 int nbLocalIndex = localIndex.size(); 34 int currentlocalIndex = 0; 35 for (int idx = 0; idx < nbLocalIndex; ++idx) 38 36 { 39 int nbLocalIndex = localIndex.size(); 40 int currentlocalIndex = 0; 41 for (int idx = 0; idx < nbLocalIndex; ++idx) 37 currentlocalIndex = localIndex[idx].first; 38 if (flagInitial[currentlocalIndex]) 42 39 { 43 currentlocalIndex = localIndex[idx].first; 44 if (!NumTraits<double>::isnan(*(dataInput + idx))) 45 { 46 if (flagInitial[currentlocalIndex]) 47 { 48 dataOut(currentlocalIndex) = *(dataInput + idx); 49 flagInitial[currentlocalIndex] = false; 50 } 51 else 52 { 53 dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 54 } 55 } 40 dataOut(currentlocalIndex) = *(dataInput + idx); 41 flagInitial[currentlocalIndex] = false; 56 42 } 57 } 58 else 59 { 60 int nbLocalIndex = localIndex.size(); 61 int currentlocalIndex = 0; 62 for (int idx = 0; idx < nbLocalIndex; ++idx) 43 else 63 44 { 64 currentlocalIndex = localIndex[idx].first; 65 if (flagInitial[currentlocalIndex]) 66 { 67 dataOut(currentlocalIndex) = *(dataInput + idx); 68 flagInitial[currentlocalIndex] = false; 69 } 70 else 71 { 72 dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 73 } 45 dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 74 46 } 75 47 } -
XIOS/dev/branch_yushan/src/transformation/Functions/min_reduction.hpp
r1018 r1037 26 26 const double* dataInput, 27 27 CArray<double,1>& dataOut, 28 std::vector<bool>& flagInitial, 29 const double& defaultValue); 28 std::vector<bool>& flagInitial); 30 29 31 30 virtual ~CMinReductionAlgorithm() {} -
XIOS/dev/branch_yushan/src/transformation/Functions/reduction.hpp
r1018 r1037 45 45 const double* dataInput, 46 46 CArray<double,1>& dataOut, 47 std::vector<bool>& flagInitial, 48 const double& defaultValue) = 0; 47 std::vector<bool>& flagInitial) = 0; 49 48 /*! 50 49 Update local data -
XIOS/dev/branch_yushan/src/transformation/Functions/sum_reduction.cpp
r1018 r1037 3 3 \author Ha NGUYEN 4 4 \since 27 June 2016 5 \date 9 Jan 20175 \date 27 June 2016 6 6 7 7 \brief sum reduction 8 8 */ 9 9 #include "sum_reduction.hpp" 10 #include "utils.hpp"11 10 12 11 namespace xios { … … 30 29 const double* dataInput, 31 30 CArray<double,1>& dataOut, 32 std::vector<bool>& flagInitial, 33 const double& defaultValue) 31 std::vector<bool>& flagInitial) 34 32 { 35 bool hasMissingValue = NumTraits<double>::isnan(defaultValue); 36 if (hasMissingValue) 33 int nbLocalIndex = localIndex.size(); 34 int currentlocalIndex = 0; 35 double currentWeight = 0.0; 36 for (int idx = 0; idx < nbLocalIndex; ++idx) 37 37 { 38 int nbLocalIndex = localIndex.size();39 int currentlocalIndex = 0;40 for (int idx = 0; idx < nbLocalIndex; ++idx)38 currentlocalIndex = localIndex[idx].first; 39 currentWeight = localIndex[idx].second; 40 if (flagInitial[currentlocalIndex]) 41 41 { 42 currentlocalIndex = localIndex[idx].first; 43 if (!NumTraits<double>::isnan(*(dataInput + idx))) 44 { 45 if (flagInitial[currentlocalIndex]) 46 { 47 dataOut(currentlocalIndex) = *(dataInput + idx); 48 flagInitial[currentlocalIndex] = false; 49 } 50 else 51 { 52 dataOut(currentlocalIndex) += *(dataInput + idx); 53 } 54 } 55 } 56 } 57 else 58 { 59 int nbLocalIndex = localIndex.size(); 60 int currentlocalIndex = 0; 61 for (int idx = 0; idx < nbLocalIndex; ++idx) 42 dataOut(currentlocalIndex) = *(dataInput + idx); 43 flagInitial[currentlocalIndex] = false; 44 } 45 else 62 46 { 63 currentlocalIndex = localIndex[idx].first; 64 if (flagInitial[currentlocalIndex]) 65 { 66 dataOut(currentlocalIndex) = *(dataInput + idx); 67 flagInitial[currentlocalIndex] = false; 68 } 69 else 70 { 71 dataOut(currentlocalIndex) += *(dataInput + idx); 72 } 47 dataOut(currentlocalIndex) += *(dataInput + idx); 73 48 } 74 49 } -
XIOS/dev/branch_yushan/src/transformation/Functions/sum_reduction.hpp
r1018 r1037 26 26 const double* dataInput, 27 27 CArray<double,1>& dataOut, 28 std::vector<bool>& flagInitial, 29 const double& defaultValue); 28 std::vector<bool>& flagInitial); 30 29 31 30 virtual ~CSumReductionAlgorithm() {} -
XIOS/dev/branch_yushan/src/transformation/axis_algorithm_extract_domain.cpp
r1018 r1037 71 71 const double& defaultValue) 72 72 { 73 reduction_->apply(localIndex, dataInput, dataOut, flagInitial , defaultValue);73 reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 74 74 } 75 75 -
XIOS/dev/branch_yushan/src/transformation/axis_algorithm_inverse.cpp
r936 r1037 211 211 212 212 status.resize(requests.size()); 213 //printf("(%d) src/transformation/axis_algorithm_inverse 1st waitall\n", clientRank); 213 214 MPI_Waitall(requests.size(), &requests[0], &status[0]); 214 215 //printf("(%d) src/transformation/axis_algorithm_inverse 1st waitall OK\n", clientRank); 215 216 216 217 std::vector<MPI_Request>().swap(requests); … … 245 246 } 246 247 status.resize(requests.size()); 248 //printf("(%d) src/transformation/axis_algorithm_inverse 2nd waitall\n", clientRank); 249 247 250 MPI_Waitall(requests.size(), &requests[0], &status[0]); 248 251 //printf("(%d) src/transformation/axis_algorithm_inverse 2nd waitall OK\n", clientRank); 249 252 250 253 size_t nGloAxisDest = axisDest_->n_glo.getValue() - 1; -
XIOS/dev/branch_yushan/src/transformation/axis_algorithm_reduce_domain.cpp
r1018 r1037 79 79 const double& defaultValue) 80 80 { 81 reduction_->apply(localIndex, dataInput, dataOut, flagInitial , defaultValue);81 reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 82 82 } 83 83 -
XIOS/dev/branch_yushan/src/transformation/domain_algorithm_interpolate.cpp
r1014 r1037 48 48 49 49 CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain) 50 : CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false) 51 { 52 CContext* context = CContext::getCurrent(); 50 : CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false) 51 { 53 52 interpDomain_->checkValid(domainSource); 54 fileToReadWrite_ = "xios_interpolation_weights_"; 55 56 if (interpDomain_->weight_filename.isEmpty()) 57 { 58 fileToReadWrite_ += context->getId() + "_" + 59 domainSource->getDomainOutputName() + "_" + 60 domainDestination->getDomainOutputName() + ".nc"; 61 } 62 else 63 fileToReadWrite_ = interpDomain_->weight_filename; 64 65 ifstream f(fileToReadWrite_.c_str()); 66 switch (interpDomain_->mode) 67 { 68 case CInterpolateDomain::mode_attr::read: 69 readFromFile_ = true; 70 break; 71 case CInterpolateDomain::mode_attr::compute: 72 readFromFile_ = false; 73 break; 74 case CInterpolateDomain::mode_attr::read_or_compute: 75 if (!f.good()) 76 readFromFile_ = false; 77 else 78 readFromFile_ = true; 79 break; 80 default: 81 break; 82 } 83 84 writeToFile_ = interpDomain_->write_weight; 85 53 if ((CInterpolateDomain::mode_attr::write == interpDomain_->mode) && 54 (!interpDomain_->file.isEmpty())) 55 writeToFile_ = true; 86 56 } 87 57 … … 384 354 } 385 355 386 if (writeToFile_ && !readFromFile_)356 if (writeToFile_) 387 357 writeRemapInfo(interpMapValue); 388 358 exchangeRemapInfo(interpMapValue); … … 469 439 void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 470 440 { 471 if ( readFromFile_ && !writeToFile_)441 if (CInterpolateDomain::mode_attr::read == interpDomain_->mode) 472 442 readRemapInfo(); 473 443 else … … 478 448 479 449 void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 480 { 481 writeInterpolationInfo(fileToReadWrite_, interpMapValue); 450 { 451 std::string filename = interpDomain_->file.getValue(); 452 writeInterpolationInfo(filename, interpMapValue); 482 453 } 483 454 484 455 void CDomainAlgorithmInterpolate::readRemapInfo() 485 { 456 { 457 std::string filename = interpDomain_->file.getValue(); 486 458 std::map<int,std::vector<std::pair<int,double> > > interpMapValue; 487 readInterpolationInfo(file ToReadWrite_, interpMapValue);459 readInterpolationInfo(filename, interpMapValue); 488 460 489 461 exchangeRemapInfo(interpMapValue); … … 636 608 int countBuff = 0; 637 609 MPI_Get_count(&recvStatus, MPI_INT, &countBuff); 610 #ifdef _usingMPI 638 611 clientSrcRank = recvStatus.MPI_SOURCE; 639 612 #elif _usingEP 613 clientSrcRank = recvStatus.ep_src; 614 #endif 640 615 MPI_Recv((recvIndexSrcBuff + receivedSize), 641 616 recvBuffSize, … … 681 656 const StdSize size) 682 657 { 683 returnCONetCDF4::addDimension(name, size);658 CONetCDF4::addDimension(name, size); 684 659 } 685 660 … … 687 662 const std::vector<StdString>& dim) 688 663 { 689 return CONetCDF4::addVariable(name, type, dim); 690 } 691 692 void CDomainAlgorithmInterpolate::WriteNetCdf::endDefinition() 693 { 694 CONetCDF4::definition_end(); 664 CONetCDF4::addVariable(name, type, dim); 695 665 } 696 666 … … 756 726 MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, client->intraComm); 757 727 758 if (0 == globalNbWeight)759 {760 info << "There is no interpolation weights calculated between "761 << "domain source: " << domainSrc_->getDomainOutputName()762 << " and domain destination: " << domainDest_->getDomainOutputName()763 << std::endl;764 return;765 }766 767 728 std::vector<StdSize> start(1, startIndex - localNbWeight); 768 729 std::vector<StdSize> count(1, localNbWeight); 769 770 WriteNetCdf netCdfWriter(filename, client->intraComm); 730 731 WriteNetCdf netCdfWriter(filename, client->intraComm); 732 733 // netCdfWriter = CONetCDF4(filename, false, false, true, client->intraComm, false); 771 734 772 735 // Define some dimensions … … 782 745 netCdfWriter.addVariableWrite("weight", NC_DOUBLE, dims); 783 746 784 // End of definition785 netCdfWriter.endDefinition();786 787 747 // // Write variables 788 if (0 != localNbWeight) 789 { 790 netCdfWriter.writeDataIndex(src_idx, "src_idx", false, 0, &start, &count); 791 netCdfWriter.writeDataIndex(dst_idx, "dst_idx", false, 0, &start, &count); 792 netCdfWriter.writeDataIndex(weights, "weight", false, 0, &start, &count); 793 } 748 netCdfWriter.writeDataIndex(src_idx, "src_idx", true, 0, &start, &count); 749 netCdfWriter.writeDataIndex(dst_idx, "dst_idx", true, 0, &start, &count); 750 netCdfWriter.writeDataIndex(weights, "weight", true, 0, &start, &count); 794 751 795 752 netCdfWriter.closeFile(); -
XIOS/dev/branch_yushan/src/transformation/domain_algorithm_interpolate.hpp
r1014 r1037 48 48 CInterpolateDomain* interpDomain_; 49 49 bool writeToFile_; 50 bool readFromFile_;51 StdString fileToReadWrite_;52 50 53 51 // class WriteNetCdf; … … 59 57 int addVariableWrite(const StdString& name, nc_type type, 60 58 const std::vector<StdString>& dim); 61 void endDefinition();62 59 void writeDataIndex(const CArray<int,1>& data, const StdString& name, 63 60 bool collective, StdSize record, -
XIOS/dev/branch_yushan/src/transformation/generic_algorithm_transformation.cpp
r1018 r1037 11 11 #include "context_client.hpp" 12 12 #include "client_client_dht_template.hpp" 13 #include "utils.hpp"14 13 15 14 namespace xios { … … 32 31 const double& defaultValue) 33 32 { 34 int nbLocalIndex = localIndex.size(); 35 bool hasMissingValue = NumTraits<double>::isnan(defaultValue);33 int nbLocalIndex = localIndex.size(); 34 bool hasMissingValue = (0.0 != defaultValue) ? true : false; 36 35 if (hasMissingValue) 37 36 { 38 37 for (int idx = 0; idx < nbLocalIndex; ++idx) 39 38 { 40 if ( NumTraits<double>::isnan(*(dataInput + idx)))39 if (defaultValue == *(dataInput + idx)) 41 40 { 42 41 flagInitial[localIndex[idx].first] = false; -
XIOS/dev/branch_yushan/src/transformation/grid_transformation.cpp
r978 r1037 531 531 532 532 status.resize(requests.size()); 533 //printf("(%d) src/transformation/grid_transformation 1st waitall\n", clientRank); 533 534 MPI_Waitall(requests.size(), &requests[0], &status[0]); 535 //printf("(%d) src/transformation/grid_transformation 1st waitall OK\n", clientRank); 534 536 535 537 // Okie, now use the mask to identify which index source we need to send, then also signal the destination which masked index we will return … … 583 585 } 584 586 status.resize(requests.size()); 587 //printf("(%d) src/transformation/grid_transformation 2nd waitall\n", clientRank); 585 588 MPI_Waitall(requests.size(), &requests[0], &status[0]); 589 //printf("(%d) src/transformation/grid_transformation 2nd waitall OK\n", clientRank); 586 590 587 591 // Cool, now we can fill in local index of grid destination (counted for masked index) -
XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_extract_axis.cpp
r1018 r1037 58 58 const double& defaultValue) 59 59 { 60 reduction_->apply(localIndex, dataInput, dataOut, flagInitial , defaultValue);60 reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 61 61 } 62 62 -
XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_reduce_axis.cpp
r1018 r1037 90 90 const double& defaultValue) 91 91 { 92 reduction_->apply(localIndex, dataInput, dataOut, flagInitial , defaultValue);92 reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 93 93 } 94 94 -
XIOS/dev/branch_yushan/src/transformation/scalar_algorithm_reduce_domain.cpp
r1018 r1037 84 84 const double& defaultValue) 85 85 { 86 reduction_->apply(localIndex, dataInput, dataOut, flagInitial , defaultValue);86 reduction_->apply(localIndex, dataInput, dataOut, flagInitial); 87 87 } 88 88 -
XIOS/dev/branch_yushan/src/utils.hpp
r1018 r1037 257 257 return 1e-12; 258 258 } 259 static inline bool isnan(const Scalar& v) {260 return (v != v);261 }262 259 }; 263 260 -
XIOS/dev/branch_yushan/src/xml_parser.cpp
r1031 r1037 70 70 CContext::setCurrent(attributes["id"]) ; 71 71 72 bool hasctxt = CContext::has(attributes["id"]); 73 74 if(hasctxt) 75 { 76 DEBUG("The context will not be processed because it exist an other context with the same id" ); 77 continue; 78 } 72 79 73 80 if (isParseAll) 74 81 { 75 82 CContext* context = CContext::create(attributes["id"]); 83 // if (!hasctxt) group_context->addChild(context); 76 84 context->parse(node); 77 85 … … 84 92 { 85 93 CContext* context = CContext::create(*it); 94 // if (!hasctxt) group_context->addChild(context); 86 95 context->parse(node); 87 96
Note: See TracChangeset
for help on using the changeset viewer.