Changeset 1201 for XIOS/dev/dev_olga/src/node
- Timestamp:
- 07/07/17 18:17:49 (7 years ago)
- Location:
- XIOS/dev/dev_olga/src/node
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/node/axis.hpp
r1158 r1201 123 123 int zoom_begin_srv, zoom_end_srv, zoom_size_srv; 124 124 int ni_srv, begin_srv, end_srv; 125 int global_zoom_begin_srv, global_zoom_end_srv, global_zoom_size_srv; 125 126 CArray<double,1> value_srv; 126 127 CArray<double,2> bound_srv; 127 128 CArray<StdString,1> label_srv; 129 CArray<int,1> zoom_index_srv; 128 130 bool hasValue; 129 131 CArray<int,1> globalDimGrid; … … 144 146 void computeConnectedServer(const std::vector<int>& globalDim, int orderPositionInGrid, 145 147 CServerDistributionDescription::ServerDistributionType distType); 148 bool zoomByIndex(); 146 149 147 150 void sendNonDistributedAttributes(void); -
XIOS/dev/dev_olga/src/node/calendar_wrapper.cpp
r1158 r1201 7 7 namespace xios { 8 8 9 /// ////////////////////// D finitions ////////////////////// ///9 /// ////////////////////// Définitions ////////////////////// /// 10 10 11 11 CCalendarWrapper::CCalendarWrapper(void) -
XIOS/dev/dev_olga/src/node/context.cpp
r1194 r1201 291 291 void CContext::setClientServerBuffer(CContextClient* contextClient) 292 292 { 293 size_t minBufferSize = CXios::minBufferSize; 293 // Estimated minimum event size for small events (10 is an arbitrary constant just for safety) 294 const size_t minEventSize = CEventClient::headerSize + getIdServer().size() + 10 * sizeof(int); 295 296 // Ensure there is at least some room for 20 of such events in the buffers 297 size_t minBufferSize = std::max(CXios::minBufferSize, 20 * minEventSize); 298 294 299 #define DECLARE_NODE(Name_, name_) \ 295 300 if (minBufferSize < sizeof(C##Name_##Definition)) minBufferSize = sizeof(C##Name_##Definition); … … 299 304 #undef DECLARE_NODE_PAR 300 305 306 // Compute the buffer sizes needed to send the attributes and data corresponding to fields 301 307 std::map<int, StdSize> maxEventSize; 302 308 std::map<int, StdSize> bufferSize = getAttributesBufferSize(maxEventSize, contextClient); … … 307 313 if (it->second > bufferSize[it->first]) bufferSize[it->first] = it->second; 308 314 315 // Apply the buffer size factor and check that we are above the minimum buffer size 309 316 ite = bufferSize.end(); 310 317 for (it = bufferSize.begin(); it != ite; ++it) … … 314 321 } 315 322 316 // We consider that the minimum buffer size is also the minimum event size 317 ite = maxEventSize.end(); 318 for (it = maxEventSize.begin(); it != ite; ++it) 319 if (it->second < minBufferSize) it->second = minBufferSize; 320 323 // Leaders will have to send some control events so ensure there is some room for those in the buffers 321 324 if (contextClient->isServerLeader()) 322 325 { 323 326 const std::list<int>& ranks = contextClient->getRanksServerLeader(); 324 327 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 325 if (!bufferSize.count(*itRank)) bufferSize[*itRank] = maxEventSize[*itRank] = minBufferSize; 328 { 329 if (!bufferSize.count(*itRank)) 330 { 331 bufferSize[*itRank] = minBufferSize; 332 maxEventSize[*itRank] = minEventSize; 333 } 334 } 326 335 } 327 336 contextClient->setBufferSize(bufferSize, maxEventSize); -
XIOS/dev/dev_olga/src/node/domain.cpp
r1173 r1201 2463 2463 } 2464 2464 2465 i_index.resize(nbIndGlob); 2466 j_index.resize(nbIndGlob); 2467 2465 2468 globalLocalIndexMap_.rehash(std::ceil(nbIndGlob/globalLocalIndexMap_.max_load_factor())); 2466 i_index.resize(nbIndGlob);2467 j_index.resize(nbIndGlob);2468 2469 nbIndGlob = 0; 2469 2470 for (i = 0; i < nbReceived; ++i) … … 2473 2474 { 2474 2475 index = tmp(ind); 2475 if (0 == globalLocalIndexMap_.count(index)) 2476 { 2477 i_index(nbIndGlob) = index % ni_glo; 2478 j_index(nbIndGlob) = index / ni_glo; 2479 globalLocalIndexMap_[index] = nbIndGlob; 2480 ++nbIndGlob; 2481 } 2476 i_index(nbIndGlob) = index % ni_glo; 2477 j_index(nbIndGlob) = index / ni_glo; 2478 globalLocalIndexMap_[index] = nbIndGlob; 2479 ++nbIndGlob; 2482 2480 } 2483 2481 } 2484 2485 i_index.resizeAndPreserve(nbIndGlob);2486 j_index.resizeAndPreserve(nbIndGlob);2487 2482 } 2488 2483 … … 2635 2630 void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers) 2636 2631 { 2637 int nbReceived = rankBuffers.size(), i, ind, index , lInd;2632 int nbReceived = rankBuffers.size(), i, ind, index; 2638 2633 if (nbReceived != recvClientRanks_.size()) 2639 ERROR("void CDomain::recv Mask(std::map<int, CBufferIn*>& rankBuffers)",2634 ERROR("void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers)", 2640 2635 << "The number of sending clients is not correct." 2641 2636 << "Expected number: " << recvClientRanks_.size() << " but received " << nbReceived); … … 2655 2650 } 2656 2651 2657 if (nbMaskInd != globalLocalIndexMap_.size())2658 info (0) << "If the domain " << this->getDomainOutputName() <<" does not have overlapped region between processes."2659 << "Something shouble be wrong with mask index "<< std::endl;2660 2661 nbMaskInd = globalLocalIndexMap_.size();2662 2652 mask_1d.resize(nbMaskInd); 2663 2653 nbMaskInd = 0; 2664 2654 for (i = 0; i < nbReceived; ++i) 2665 2655 { 2666 CArray<int,1>& tmpInd = indGlob_[recvClientRanks_[i]];2667 2656 CArray<bool,1>& tmp = recvMaskValue[i]; 2668 2657 for (ind = 0; ind < tmp.numElements(); ++ind) 2669 2658 { 2670 lInd = globalLocalIndexMap_[size_t(tmpInd(ind))];2671 mask_1d(lInd) = tmp(ind);2659 mask_1d(nbMaskInd) = tmp(ind); 2660 ++nbMaskInd; 2672 2661 } 2673 2662 } … … 2728 2717 2729 2718 if (nbLonInd != globalLocalIndexMap_.size()) 2730 info (0) << "If the domain " << this->getDomainOutputName() <<" does not have overlapped region between processes." 2731 << "Something shouble be wrong with longitude index "<< std::endl; 2732 2733 nbLonInd = globalLocalIndexMap_.size(); 2719 info (0) << "Something wrong with longitude index "<< std::endl; 2720 2734 2721 lonvalue.resize(nbLonInd); 2735 2722 if (hasBounds) … … 2812 2799 2813 2800 if (nbLatInd != globalLocalIndexMap_.size()) 2814 info (0) << "If the domain " << this->getDomainOutputName() <<" does not have overlapped region between processes." 2815 << "Something shouble be wrong with latitude index "<< std::endl; 2816 2817 nbLatInd = globalLocalIndexMap_.size(); 2801 info (0) << "Something wrong with latitude index "<< std::endl; 2802 2818 2803 latvalue.resize(nbLatInd); 2819 2804 if (hasBounds) … … 2885 2870 } 2886 2871 2872 int nbAreaInd = 0; 2873 for (i = 0; i < nbReceived; ++i) 2874 { 2875 nbAreaInd += recvAreaValue[i].numElements(); 2876 } 2877 2878 if (nbAreaInd != globalLocalIndexMap_.size()) 2879 info (0) << "Something wrong with latitude index "<< std::endl; 2880 2887 2881 if (hasArea) 2888 2882 { 2889 int nbAreaInd = 0;2890 for (i = 0; i < nbReceived; ++i)2891 {2892 nbAreaInd += recvAreaValue[i].numElements();2893 }2894 2895 if (nbAreaInd != globalLocalIndexMap_.size())2896 info (0) << "If the domain " << this->getDomainOutputName() <<" does not have overlapped region between processes."2897 << "Something shouble be wrong with area index "<< std::endl;2898 2899 nbAreaInd = globalLocalIndexMap_.size();2900 2883 areavalue.resize(nbAreaInd); 2901 2884 nbAreaInd = 0; … … 3005 2988 { 3006 2989 lInd = globalLocalIndexMap_[size_t(tmpInd(ind))]; 3007 dataIIndex(lInd) = (-1 == dataIIndex(lInd)) ? tmpI(ind) : dataIIndex(lInd); // Only fill in dataIndex if there is no data3008 dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd);2990 dataIIndex(lInd) = tmpI(ind); 2991 dataJIndex(lInd) = tmpJ(ind); 3009 2992 } 3010 2993 } -
XIOS/dev/dev_olga/src/node/field.cpp
r1166 r1201 131 131 132 132 CContext* context = CContext::getCurrent(); 133 CContextClient* client = (!context->hasServer) ? context->client : this->file->getContextClient(); 134 135 CEventClient event(getType(), EVENT_ID_UPDATE_DATA); 136 137 map<int, CArray<int,1> >::iterator it; 138 list<CMessage> list_msg; 139 list<CArray<double,1> > list_data; 140 141 if (!grid->doGridHaveDataDistributed()) 133 CContextClient* client = (!context->hasServer) ? context->client : this->file->getContextClient(); 134 135 CEventClient event(getType(), EVENT_ID_UPDATE_DATA); 136 137 map<int, CArray<int,1> >::iterator it; 138 list<CMessage> list_msg; 139 list<CArray<double,1> > list_data; 140 141 if (!grid->doGridHaveDataDistributed()) 142 { 143 if (client->isServerLeader()) 144 { 145 for (it = grid->storeIndex_toSrv.begin(); it != grid->storeIndex_toSrv.end(); it++) 146 { 147 int rank = it->first; 148 CArray<int,1>& index = it->second; 149 150 list_msg.push_back(CMessage()); 151 list_data.push_back(CArray<double,1>(index.numElements())); 152 153 CArray<double,1>& data_tmp = list_data.back(); 154 for (int n = 0; n < data_tmp.numElements(); n++) data_tmp(n) = data(index(n)); 155 156 list_msg.back() << getId() << data_tmp; 157 event.push(rank, 1, list_msg.back()); 158 } 159 client->sendEvent(event); 160 } 161 else client->sendEvent(event); 162 } 163 else 164 { 165 for (it = grid->storeIndex_toSrv.begin(); it != grid->storeIndex_toSrv.end(); it++) 142 166 { 143 if (client->isServerLeader()) 144 { 145 for (it = grid->storeIndex_toSrv.begin(); it != grid->storeIndex_toSrv.end(); it++) 146 { 147 int rank = it->first; 148 CArray<int,1>& index = it->second; 149 150 list_msg.push_back(CMessage()); 151 list_data.push_back(CArray<double,1>(index.numElements())); 152 153 CArray<double,1>& data_tmp = list_data.back(); 154 for (int n = 0; n < data_tmp.numElements(); n++) data_tmp(n) = data(index(n)); 155 156 list_msg.back() << getId() << data_tmp; 157 event.push(rank, 1, list_msg.back()); 158 } 159 client->sendEvent(event); 160 } 161 else client->sendEvent(event); 162 } 163 else 164 { 165 for (it = grid->storeIndex_toSrv.begin(); it != grid->storeIndex_toSrv.end(); it++) 166 { 167 int rank = it->first; 168 CArray<int,1>& index = it->second; 169 170 list_msg.push_back(CMessage()); 171 list_data.push_back(CArray<double,1>(index.numElements())); 172 173 CArray<double,1>& data_tmp = list_data.back(); 174 for (int n = 0; n < data_tmp.numElements(); n++) data_tmp(n) = data(index(n)); 175 176 list_msg.back() << getId() << data_tmp; 177 event.push(rank, grid->nbSenders[0][rank], list_msg.back()); 178 } 179 client->sendEvent(event); 180 } 167 int rank = it->first; 168 CArray<int,1>& index = it->second; 169 170 list_msg.push_back(CMessage()); 171 list_data.push_back(CArray<double,1>(index.numElements())); 172 173 CArray<double,1>& data_tmp = list_data.back(); 174 for (int n = 0; n < data_tmp.numElements(); n++) data_tmp(n) = data(index(n)); 175 176 list_msg.back() << getId() << data_tmp; 177 event.push(rank, grid->nbSenders[0][rank], list_msg.back()); 178 } 179 client->sendEvent(event); 180 } 181 181 182 182 CTimer::get("Field : send data").suspend(); … … 276 276 { 277 277 CContext* context = CContext::getCurrent(); 278 // CContextClient* client = context->client; 278 279 CContextClient* client = (!context->hasServer) ? context->client : this->file->getContextClient(); 279 280 280 281 281 lastDataRequestedFromServer = tsDataRequested; … … 336 336 CContext* context = CContext::getCurrent(); 337 337 CContextClient* client = context->client; 338 // CContextClient* client = (!context->hasServer) ? context->client : this->file->getContextClient(); 338 339 339 340 CEventClient event(getType(), EVENT_ID_READ_DATA_READY); … … 854 855 { 855 856 if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform(); 857 858 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 859 const double defaultValue = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 860 856 861 CContext* context = CContext::getCurrent(); 857 862 bool hasWriterServer = context->hasServer && !context->hasClient; … … 906 911 if (grid && grid != gridRef && grid->hasTransform()) 907 912 { 908 bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 909 double defaultValue = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 910 std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, hasMissingValue, defaultValue); 913 std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, detectMissingValues, defaultValue); 911 914 912 915 filter->connectOutput(filters.first, 0); … … 924 927 instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 925 928 freq_offset.isEmpty() ? NoneDu : freq_offset, 926 true)); 929 true, 930 detectMissingValues, defaultValue)); 927 931 else // The data might be passed from the model 928 932 { 929 bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 930 double defaultValue = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 933 if (check_if_active.isEmpty()) check_if_active = false; 931 934 instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 932 ignoreMissingValue, defaultValue));935 detectMissingValues, defaultValue)); 933 936 } 934 937 } … … 937 940 if (enableOutput && !storeFilter && !fileWriterFilter) 938 941 { 939 if (!read_access.isEmpty() && read_access) 940 { 941 storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid)); 942 instantDataFilter->connectOutput(storeFilter, 0); 943 } 944 945 if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write)) 946 { 947 fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 948 getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0); 949 } 942 storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid, 943 detectMissingValues, defaultValue)); 944 instantDataFilter->connectOutput(storeFilter, 0); 945 } 946 947 if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write)) 948 { 949 fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 950 getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0); 950 951 } 951 952 } … … 1001 1002 if (!selfReferenceFilter) 1002 1003 { 1004 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1005 const double defaultValue = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 1006 1003 1007 if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 1004 1008 { … … 1006 1010 serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 1007 1011 freq_offset.isEmpty() ? NoneDu : freq_offset, 1008 true)); 1012 true, 1013 detectMissingValues, defaultValue)); 1014 1009 1015 selfReferenceFilter = serverSourceFilter; 1010 1016 } … … 1019 1025 if (!clientSourceFilter) 1020 1026 { 1021 bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1022 double defaultValue = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 1027 if (check_if_active.isEmpty()) check_if_active = false; 1023 1028 clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 1024 ignoreMissingValue, defaultValue));1029 detectMissingValues, defaultValue)); 1025 1030 } 1026 1031 … … 1056 1061 freq_offset.setValue(NoneDu); 1057 1062 1058 const bool ignoreMissingValue= (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);1059 1063 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1064 1060 1065 boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 1061 1066 CContext::getCurrent()->getCalendar()->getInitDate(), 1062 1067 freq_op, freq_offset, outFreq, 1063 ignoreMissingValue, ignoreMissingValue? default_value : 0.0));1068 detectMissingValues, detectMissingValues ? default_value : 0.0)); 1064 1069 instantDataFilter->connectOutput(temporalFilter, 0); 1065 1070 … … 1096 1101 if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu); 1097 1102 1098 const bool ignoreMissingValue= (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);1103 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1099 1104 1100 1105 boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 1101 1106 CContext::getCurrent()->getCalendar()->getInitDate(), 1102 1107 freq_op, freq_offset, outFreq, 1103 ignoreMissingValue, ignoreMissingValue? default_value : 0.0));1108 detectMissingValues, detectMissingValues ? default_value : 0.0)); 1104 1109 selfReferenceFilter->connectOutput(temporalFilter, 0); 1105 1110 return temporalFilter ; -
XIOS/dev/dev_olga/src/node/field_impl.hpp
r1021 r1201 19 19 { 20 20 if (clientSourceFilter) 21 clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data); 21 { 22 if (check_if_active.isEmpty() || (!check_if_active.isEmpty() && (!check_if_active) || isActive(true))) 23 clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data); 24 } 22 25 else if (instantDataFilter) 23 26 ERROR("void CField::setData(const CArray<double, N>& _data)", -
XIOS/dev/dev_olga/src/node/file.cpp
r1158 r1201 425 425 if (!split_freq.isEmpty()) 426 426 { 427 CDate splitEnd = lastSplit + split_freq - 1 * Second; 427 CDate split_start ; 428 CDate splitEnd ; 429 if (!split_start_offset.isEmpty()) split_start=lastSplit + split_start_offset ; 430 else split_start=lastSplit ; 431 432 splitEnd = lastSplit + split_freq ; 433 if (!split_last_date.isEmpty()) 434 { 435 CDate splitLastDate=CDate::FromString(split_last_date,*CContext::getCurrent()->getCalendar()) ; 436 if( splitLastDate < splitEnd) splitEnd=splitLastDate ; 437 } 438 439 if (!split_end_offset.isEmpty()) splitEnd = splitEnd + split_end_offset; 440 else splitEnd = splitEnd - 1 * Second; 428 441 429 442 string splitFormat; … … 440 453 441 454 oss << firstPart ; 442 if (hasStartDate) oss << lastSplit.getStr(splitFormat) ;455 if (hasStartDate) oss << split_start.getStr(splitFormat) ; 443 456 oss << middlePart ; 444 457 if (hasEndDate) oss << splitEnd.getStr(splitFormat); -
XIOS/dev/dev_olga/src/node/grid.cpp
r1178 r1201 287 287 nbSrvPools = 1; 288 288 for (int p = 0; p < nbSrvPools; ++p) 289 { 290 if (context->hasClient && this->isChecked && doSendingIndex && !isIndexSent) 291 { 292 if (isScalarGrid()) 293 sendIndexScalarGrid(); 294 else 295 sendIndex(); 296 this->isIndexSent = true; 289 { 290 if (isScalarGrid()) 291 { 292 if (context->hasClient) 293 if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndexScalarGrid(); this->isIndexSent = true; } 294 295 if (this->isChecked) continue; 296 297 if (context->hasClient) 298 { 299 this->computeIndexScalarGrid(); 300 } 301 302 if (!(this->hasTransform() && !this->isTransformed())) 303 this->isChecked = true; 304 continue; 297 305 } 298 306 299 // Not sure about this 300 //if (!(this->hasTransform() && !this->isTransformed())) 301 // this->isChecked = true; 302 //return; 307 if (context->hasClient) 308 { 309 if (this->isChecked && doSendingIndex && !isIndexSent) 310 {sendIndex(); this->isIndexSent = true;} 311 } 303 312 } 304 313 … … 537 546 if (computedWrittenIndex_) return; 538 547 computedWrittenIndex_ = true; 539 540 if (isScalarGrid())541 {542 size_t nbWritten = 1;543 int writtenIndex = 0;544 545 localIndexToWriteOnClient.resize(nbWritten);546 localIndexToWriteOnServer.resize(nbWritten);547 localIndexToWriteOnServer(0) = writtenIndex;548 localIndexToWriteOnClient(0) = writtenIndex;549 550 return;551 }552 548 553 549 size_t nbWritten = 0, indGlo; … … 750 746 { 751 747 CContext* context = CContext::getCurrent(); 752 if (isScalarGrid()) 748 computeClientIndex(); 749 if (context->hasClient) 753 750 { 754 computeClientIndexScalarGrid(); 755 if (context->hasClient) 756 { 757 computeConnectedClientsScalarGrid(); 758 } 759 } 760 else 761 { 762 computeClientIndex(); 763 if (context->hasClient) 764 { 765 computeConnectedClients(); 766 } 751 computeConnectedClients(); 767 752 } 768 753 } … … 1186 1171 } 1187 1172 1188 void CGrid::computeClientIndexScalarGrid() 1189 { 1190 CContext* context = CContext::getCurrent(); 1191 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; // This should be changed soon 1192 for (int p = 0; p < nbSrvPools; ++p) 1193 { 1194 CContextClient* client = (context->hasServer) ? (context->hasClient ? context->clientPrimServer[p] : context->client) 1195 : context->client; 1196 1197 storeIndex_client.resize(1); 1198 storeIndex_client(0) = 0; 1199 1200 if (0 != serverDistribution_) 1201 { 1202 map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient.begin(), 1203 ite = outGlobalIndexFromClient.end(), it; 1204 for (it = itb; it != ite; ++it) 1205 { 1206 int rank = it->first; 1207 CArray<size_t,1>& globalIndex = outGlobalIndexFromClient[rank]; 1208 outLocalIndexStoreOnClient.insert(make_pair(rank, CArray<size_t,1>(globalIndex.numElements()))); 1209 CArray<size_t,1>& localIndex = outLocalIndexStoreOnClient[rank]; 1210 if (1 != globalIndex.numElements()) 1211 ERROR("void CGrid::computeClientIndexScalarGrid()", 1212 << "Something wrong happened. " 1213 << "Number of received global index on scalar grid should equal to 1" 1214 << "Number of received global index " << globalIndex.numElements() << "."); 1215 1216 localIndex(0) = globalIndex(0); 1217 } 1218 } 1219 } 1220 } 1221 1222 void CGrid::computeConnectedClientsScalarGrid() 1173 void CGrid::computeIndexScalarGrid() 1223 1174 { 1224 1175 CContext* context = CContext::getCurrent(); … … 1230 1181 for (int p = 0; p < nbSrvPools; ++p) 1231 1182 { 1232 CContextClient* client = (context->hasServer) ? (context->hasClient ? context->clientPrimServer[p] : context->client) 1233 : context->client; 1183 CContextClient* client = context->hasServer ? context->clientPrimServer[p] : context->client; 1184 1185 storeIndex_client.resize(1); 1186 storeIndex_client(0) = 0; 1234 1187 1235 1188 connectedServerRank_[p].clear(); 1236 1189 1237 if (client->isServerLeader()) 1238 { 1239 const std::list<int>& ranks = client->getRanksServerLeader(); 1240 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 1241 { 1242 int rank = *itRank; 1243 int nb = 1; 1190 if (0 == client->clientRank) 1191 { 1192 for (int rank = 0; rank < client->serverSize; ++rank) 1193 { 1244 1194 connectedServerRank_[p].push_back(rank); 1245 connectedDataSize_[p][rank] = nb; 1246 nbSenders[p][rank] = nb; 1247 } 1248 } 1249 else 1250 { 1251 const std::list<int>& ranks = client->getRanksServerNotLeader(); 1252 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 1253 { 1254 int rank = *itRank; 1255 int nb = 1; 1256 connectedServerRank_[p].push_back(rank); 1257 connectedDataSize_[p][rank] = nb; 1258 nbSenders[p][rank] = nb; 1259 } 1260 } 1261 1195 connectedDataSize_[p][rank] = 1; 1196 nbSenders[p][rank] = 1; 1197 } 1198 } 1262 1199 isDataDistributed_ = false; 1263 1200 } -
XIOS/dev/dev_olga/src/node/grid.hpp
r1178 r1201 278 278 void computeClientIndex(); 279 279 void computeConnectedClients(); 280 void computeClientIndexScalarGrid();281 void computeConnectedClientsScalarGrid();282 280 283 281 private: -
XIOS/dev/dev_olga/src/node/zoom_axis.cpp
r836 r1201 46 46 axisGlobalSize = axisDest->n_glo.getValue(); 47 47 48 begin = (this->begin.isEmpty()) ? 0 : this->begin.getValue(); 49 n = (this->n.isEmpty()) ? axisGlobalSize : this->n.getValue(); 50 end = begin+n-1; 48 bool zoomByIndex = !this->index.isEmpty() && (0 != this->index.numElements()); 49 50 if (zoomByIndex) 51 { 52 begin = min(this->index); 53 end = max(this->index); 54 n = end - begin + 1; 55 } 56 else 57 { 58 begin = (this->begin.isEmpty()) ? 0 : this->begin.getValue(); 59 n = (this->n.isEmpty()) ? axisGlobalSize : this->n.getValue(); 60 end = begin+n-1; 61 } 51 62 52 63 if (begin < 0 || begin > axisGlobalSize - 1 || end < 0 || end > axisGlobalSize - 1 … … 55 66 << "One or more attributes among 'begin' (" << begin << "), 'end' (" << end << "), 'n' (" << n << ") " 56 67 << "of axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified"); 68 69 if (zoomByIndex && (!this->begin.isEmpty() || !this->n.isEmpty())) 70 ERROR("CZoomAxis::checkValid(CAxis* axisDest)", 71 << "Only one type of zoom is accepted. Define zoom by index with global_zoom_index or define zoom with begin and n. " 72 << "Axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified"); 57 73 58 74 this->begin.setValue(begin);
Note: See TracChangeset
for help on using the changeset viewer.