Changeset 1205 for XIOS/dev/branch_yushan_merged/src/node
- Timestamp:
- 07/10/17 18:17:04 (7 years ago)
- Location:
- XIOS/dev/branch_yushan_merged/src/node
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan_merged/src/node/axis.cpp
r1134 r1205 367 367 // We don't check if the mask is valid here, just if a mask has been defined at this point. 368 368 isCompressible_ = !mask.isEmpty(); 369 } 370 371 bool CAxis::zoomByIndex() 372 { 373 return (!global_zoom_index.isEmpty() && (0 != global_zoom_index.numElements())); 369 374 } 370 375 … … 463 468 size_t nZoomCount = 0; 464 469 size_t nbIndex = index.numElements(); 465 for (size_t idx = 0; idx < nbIndex; ++idx) 470 471 int end = (0 == n) ? begin : begin + n - 1; 472 int zoom_size = zoomByIndex() ? global_zoom_index.numElements() : global_zoom_n; 473 int minInd = min(index); 474 int maxInd = max(index); 475 for (size_t idx = 0; idx < zoom_size; ++idx) 476 { 477 size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx; 478 if (globalZoomIndex >= minInd && globalZoomIndex <= maxInd) ++nZoomCount; 479 } 480 481 /* for (size_t idx = 0; idx < nbIndex; ++idx) 466 482 { 467 483 size_t globalIndex = index(idx); 468 484 if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nZoomCount; 469 } 470 485 }*/ 486 471 487 CArray<size_t,1> globalIndexAxis(nbIndex); 488 for (size_t idx = 0; idx < nbIndex; ++idx) 489 { 490 globalIndexAxis(idx) = (size_t)index(idx); 491 } 492 472 493 std::vector<size_t> globalAxisZoom(nZoomCount); 473 494 nZoomCount = 0; 474 for (size_t idx = 0; idx < nbIndex; ++idx) 475 { 476 size_t globalIndex = index(idx); 477 globalIndexAxis(idx) = globalIndex; 478 if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) 479 { 480 globalAxisZoom[nZoomCount] = globalIndex; 495 for (size_t idx = 0; idx < zoom_size; ++idx) 496 { 497 size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx; 498 if (globalZoomIndex >= minInd && globalZoomIndex <= maxInd) 499 { 500 globalAxisZoom[nZoomCount] = globalZoomIndex; 481 501 ++nZoomCount; 482 502 } … … 598 618 int zoom_end = global_zoom_begin + global_zoom_n - 1; 599 619 int nb = 0; 600 for (size_t idx = 0; idx < n; ++idx)620 /* for (size_t idx = 0; idx < n; ++idx) 601 621 { 602 622 size_t globalIndex = begin + idx; 603 623 if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nb; 624 }*/ 625 626 int end = (0 == n) ? begin : begin + n - 1; 627 int zoom_size = zoomByIndex() ? global_zoom_index.numElements() : global_zoom_n; 628 for (size_t idx = 0; idx < zoom_size; ++idx) 629 { 630 size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx; 631 if (globalZoomIndex >= begin && globalZoomIndex <= end) ++nb; 604 632 } 605 633 … … 622 650 CArray<double,1> val(nb); 623 651 nb = 0; 624 for (size_t idx = 0; idx < n; ++idx)652 /* for (size_t idx = 0; idx < n; ++idx) 625 653 { 626 654 size_t globalIndex = begin + idx; … … 628 656 { 629 657 val(nb) = value(idx); 658 ++nb; 659 } 660 }*/ 661 662 for (size_t idx = 0; idx < zoom_size; ++idx) 663 { 664 size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx; 665 if (globalZoomIndex >= begin && globalZoomIndex <= end) 666 { 667 val(nb) = value(globalZoomIndex-begin); 630 668 ++nb; 631 669 } … … 933 971 const int ni = serverDimensionSizes[*itRank][orderPositionInGrid]; 934 972 const int end = begin + ni - 1; 973 const bool zoomIndex = zoomByIndex(); 935 974 936 975 msgs.push_back(CMessage()); … … 940 979 msg << global_zoom_begin.getValue() << global_zoom_n.getValue(); 941 980 msg << isCompressible_; 981 msg << zoomIndex; 982 if (zoomIndex) 983 msg << global_zoom_index.getValue(); 942 984 943 985 event.push(*itRank,1,msg); … … 959 1001 { 960 1002 int ni_srv, begin_srv, end_srv, global_zoom_begin_tmp, global_zoom_n_tmp; 1003 bool zoomIndex; 1004 CArray<int,1> zoom_index_recv; 1005 std::vector<int> zoom_index_tmp; 1006 std::vector<int>::iterator itZoomBeginSrv, itZoomEndSrv, itZoomSrv; 961 1007 962 1008 buffer >> ni_srv >> begin_srv >> end_srv; 963 1009 buffer >> global_zoom_begin_tmp >> global_zoom_n_tmp; 964 1010 buffer >> isCompressible_; 1011 buffer >> zoomIndex; 1012 if (zoomIndex) 1013 { 1014 buffer >> zoom_index_recv; 1015 global_zoom_index.reference(zoom_index_recv); 1016 zoom_index_tmp.resize(global_zoom_index.numElements()); 1017 std::copy(global_zoom_index.begin(), global_zoom_index.end(), zoom_index_tmp.begin()); 1018 std::sort(zoom_index_tmp.begin(), zoom_index_tmp.end()); 1019 itZoomBeginSrv = std::lower_bound(zoom_index_tmp.begin(), zoom_index_tmp.end(), begin_srv); 1020 itZoomEndSrv = std::upper_bound(zoom_index_tmp.begin(), zoom_index_tmp.end(), end_srv); 1021 int sz = std::distance(itZoomBeginSrv, itZoomEndSrv); 1022 zoom_index_srv.resize(sz); 1023 itZoomSrv = itZoomBeginSrv; 1024 for (int i = 0; i < sz; ++i, ++itZoomSrv) 1025 { 1026 zoom_index_srv(i) = *(itZoomSrv); 1027 } 1028 } 1029 965 1030 global_zoom_begin = global_zoom_begin_tmp; 966 1031 global_zoom_n = global_zoom_n_tmp; 967 1032 int global_zoom_end = global_zoom_begin + global_zoom_n - 1; 968 1033 969 zoom_begin_srv = global_zoom_begin > begin_srv ? global_zoom_begin : begin_srv ; 970 zoom_end_srv = global_zoom_end < end_srv ? global_zoom_end : end_srv ; 1034 zoom_begin_srv = zoomIndex ? std::distance(itZoomBeginSrv, zoom_index_tmp.begin()) 1035 : global_zoom_begin > begin_srv ? global_zoom_begin : begin_srv ; 1036 zoom_end_srv = zoomIndex ? std::distance(zoom_index_tmp.begin(), itZoomEndSrv) - 1 1037 : global_zoom_end < end_srv ? global_zoom_end : end_srv ; 971 1038 zoom_size_srv = zoom_end_srv - zoom_begin_srv + 1; 1039 1040 global_zoom_begin_srv = zoomIndex ? 0 : global_zoom_begin ; 1041 global_zoom_size_srv = zoomIndex ? zoom_index_tmp.size() : global_zoom_n; 972 1042 973 1043 if (zoom_size_srv<=0) … … 978 1048 if (n_glo == n) 979 1049 { 980 zoom_begin_srv = global_zoom_begin; 981 zoom_end_srv = global_zoom_end; //zoom_end; 982 zoom_size_srv = zoom_end_srv - zoom_begin_srv + 1; 1050 zoom_begin_srv = zoomIndex ? std::distance(itZoomBeginSrv, zoom_index_tmp.begin()) 1051 : global_zoom_begin; 1052 zoom_size_srv = zoomIndex ? zoom_index_tmp.size() 1053 : global_zoom_n; 983 1054 } 984 1055 if (hasValue) … … 1043 1114 } 1044 1115 1045 1046 1047 1116 void CAxis::duplicateTransformation(CAxis* src) 1048 1117 { -
XIOS/dev/branch_yushan_merged/src/node/axis.hpp
r1134 r1205 122 122 int zoom_begin_srv, zoom_end_srv, zoom_size_srv; 123 123 int ni_srv, begin_srv, end_srv; 124 int global_zoom_begin_srv, global_zoom_end_srv, global_zoom_size_srv; 124 125 CArray<double,1> value_srv; 125 126 CArray<double,2> bound_srv; 126 127 CArray<StdString,1> label_srv; 128 CArray<int,1> zoom_index_srv; 127 129 bool hasValue; 128 130 … … 138 140 void sendDistributedValue(); 139 141 void sendNonDistributedValue(); 142 bool zoomByIndex(); 140 143 141 144 static void recvIndex(CEventServer& event); -
XIOS/dev/branch_yushan_merged/src/node/context.cpp
r1160 r1205 14 14 #include "type.hpp" 15 15 #include "xios_spl.hpp" 16 #include "timer.hpp" 17 #include "memtrack.hpp" 18 16 19 17 20 namespace xios { … … 278 281 void CContext::setClientServerBuffer() 279 282 { 280 size_t minBufferSize = CXios::minBufferSize; 283 // Estimated minimum event size for small events (10 is an arbitrary constant just for safety) 284 const size_t minEventSize = CEventClient::headerSize + getIdServer().size() + 10 * sizeof(int); 285 // Ensure there is at least some room for 20 of such events in the buffers 286 size_t minBufferSize = std::max(CXios::minBufferSize, 20 * minEventSize); 281 287 #define DECLARE_NODE(Name_, name_) \ 282 288 if (minBufferSize < sizeof(C##Name_##Definition)) minBufferSize = sizeof(C##Name_##Definition); … … 286 292 #undef DECLARE_NODE_PAR 287 293 294 // Compute the buffer sizes needed to send the attributes and data corresponding to fields 288 295 std::map<int, StdSize> maxEventSize; 289 296 std::map<int, StdSize> bufferSize = getAttributesBufferSize(maxEventSize); … … 294 301 if (it->second > bufferSize[it->first]) bufferSize[it->first] = it->second; 295 302 303 // Apply the buffer size factor and check that we are above the minimum buffer size 296 304 ite = bufferSize.end(); 297 305 for (it = bufferSize.begin(); it != ite; ++it) … … 301 309 } 302 310 303 // We consider that the minimum buffer size is also the minimum event size 304 ite = maxEventSize.end(); 305 for (it = maxEventSize.begin(); it != ite; ++it) 306 if (it->second < minBufferSize) it->second = minBufferSize; 307 311 // Leaders will have to send some control events so ensure there is some room for those in the buffers 308 312 if (client->isServerLeader()) 309 313 { 310 314 const std::list<int>& ranks = client->getRanksServerLeader(); 311 315 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 312 if (!bufferSize.count(*itRank)) bufferSize[*itRank] = maxEventSize[*itRank] = minBufferSize; 316 { 317 if (!bufferSize.count(*itRank)) 318 { 319 bufferSize[*itRank] = minBufferSize; 320 maxEventSize[*itRank] = minEventSize; 321 } 322 } 313 323 } 314 324 … … 401 411 void CContext::closeDefinition(void) 402 412 { 413 CTimer::get("Context : close definition").resume() ; 403 414 // There is nothing client need to send to server 404 415 if (hasClient) … … 454 465 startPrefetchingOfEnabledReadModeFiles(); 455 466 } 467 CTimer::get("Context : close definition").suspend() ; 456 468 } 457 469 … … 1206 1218 void CContext::updateCalendar(int step) 1207 1219 { 1220 #pragma omp critical (_output) 1221 {info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl;} 1208 1222 calendar->update(step); 1209 1210 1223 #pragma omp critical (_output) 1224 {info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl;} 1225 #ifdef XIOS_MEMTRACK_LIGHT 1226 #pragma omp critical (_output) 1227 {info(50) << " Current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ;} 1228 #endif 1211 1229 if (hasClient) 1212 1230 { … … 1255 1273 CContext* context = CObjectFactory::CreateObject<CContext>(id).get(); 1256 1274 getRoot(); 1257 //if (!hasctxt) CGroupFactory::AddChild(root, context->getShared());1258 1275 if (!hasctxt) CGroupFactory::AddChild(*root_ptr, context->getShared()); 1259 1276 -
XIOS/dev/branch_yushan_merged/src/node/field.cpp
r1203 r1205 26 26 namespace xios{ 27 27 28 /// ////////////////////// D finitions ////////////////////// ///28 /// ////////////////////// Définitions ////////////////////// /// 29 29 30 30 CField::CField(void) … … 125 125 void CField::sendUpdateData(const CArray<double,1>& data) 126 126 { 127 CTimer::get(" XIOS Send Data").resume();127 CTimer::get("Field : send data").resume(); 128 128 129 129 CContext* context = CContext::getCurrent(); … … 177 177 } 178 178 179 CTimer::get(" XIOS Send Data").suspend();179 CTimer::get("Field : send data").suspend(); 180 180 } 181 181 … … 187 187 list<CEventServer::SSubEvent>::iterator it; 188 188 string fieldId; 189 189 CTimer::get("Field : recv data").resume(); 190 190 for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it) 191 191 { … … 197 197 } 198 198 get(fieldId)->recvUpdateData(ranks,buffers); 199 CTimer::get("Field : recv data").suspend(); 199 200 } 200 201 … … 794 795 if (!areAllReferenceSolved) solveAllReferenceEnabledField(false); 795 796 797 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 798 const double defaultValue = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 799 796 800 // Start by building a filter which can provide the field's instant data 797 801 if (!instantDataFilter) … … 810 814 if (grid && grid != gridRef && grid->hasTransform()) 811 815 { 812 bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 813 double defaultValue = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 814 std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, hasMissingValue, defaultValue); 816 std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, detectMissingValues, defaultValue); 815 817 816 818 filter->connectOutput(filters.first, 0); … … 828 830 instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 829 831 freq_offset.isEmpty() ? NoneDu : freq_offset, 830 true)); 832 true, 833 detectMissingValues, defaultValue)); 831 834 else // The data might be passed from the model 832 835 { 833 bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 834 double defaultValue = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 836 if (check_if_active.isEmpty()) check_if_active = false; 835 837 instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 836 ignoreMissingValue, defaultValue)); } 838 detectMissingValues, defaultValue)); 839 } 837 840 } 838 841 … … 842 845 if (!read_access.isEmpty() && read_access) 843 846 { 844 storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid)); 847 storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid, 848 detectMissingValues, defaultValue)); 845 849 instantDataFilter->connectOutput(storeFilter, 0); 846 850 } … … 903 907 if (!selfReferenceFilter) 904 908 { 909 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 910 const double defaultValue = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 911 905 912 if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 906 913 { … … 908 915 serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 909 916 freq_offset.isEmpty() ? NoneDu : freq_offset, 910 true)); 917 true, 918 detectMissingValues, defaultValue)); 911 919 912 920 selfReferenceFilter = serverSourceFilter; … … 922 930 if (!clientSourceFilter) 923 931 { 924 bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 925 double defaultValue = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 932 if (check_if_active.isEmpty()) check_if_active = false; 926 933 clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 927 ignoreMissingValue, defaultValue));934 detectMissingValues, defaultValue)); 928 935 } 929 936 … … 959 966 freq_offset.setValue(NoneDu); 960 967 961 const bool ignoreMissingValue= (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);962 968 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 969 963 970 boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 964 971 CContext::getCurrent()->getCalendar()->getInitDate(), 965 972 freq_op, freq_offset, outFreq, 966 ignoreMissingValue, ignoreMissingValue? default_value : 0.0));973 detectMissingValues, detectMissingValues ? default_value : 0.0)); 967 974 instantDataFilter->connectOutput(temporalFilter, 0); 968 975 … … 999 1006 if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu); 1000 1007 1001 const bool ignoreMissingValue= (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);1008 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1002 1009 1003 1010 boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 1004 1011 CContext::getCurrent()->getCalendar()->getInitDate(), 1005 1012 freq_op, freq_offset, outFreq, 1006 ignoreMissingValue, ignoreMissingValue? default_value : 0.0));1013 detectMissingValues, detectMissingValues ? default_value : 0.0)); 1007 1014 selfReferenceFilter->connectOutput(temporalFilter, 0); 1008 1015 return temporalFilter ; -
XIOS/dev/branch_yushan_merged/src/node/field_impl.hpp
r1007 r1205 19 19 { 20 20 if (clientSourceFilter) 21 clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data); 21 { 22 if (!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/branch_yushan_merged/src/node/file.cpp
r1172 r1205 16 16 #include "context_client.hpp" 17 17 #include "mpi.hpp" 18 #include "timer.hpp" 18 19 19 20 namespace xios { … … 274 275 if (mode.isEmpty() || mode.getValue() == mode_attr::write) 275 276 { 277 CTimer::get("Files : create headers").resume(); 276 278 if (!isOpen) createHeader(); 279 CTimer::get("Files : create headers").suspend(); 277 280 checkSync(); 278 281 } 279 282 else 280 283 { 284 CTimer::get("Files : open headers").resume(); 281 285 if (!isOpen) openInReadMode(); 286 CTimer::get("Files : open headers").suspend(); 282 287 } 283 288 checkSplit(); … … 395 400 if (!split_freq.isEmpty()) 396 401 { 397 CDate splitEnd = lastSplit + split_freq - 1 * Second; 402 CDate split_start ; 403 CDate splitEnd ; 404 if (!split_start_offset.isEmpty()) split_start=lastSplit + split_start_offset ; 405 else split_start=lastSplit ; 406 407 splitEnd = lastSplit + split_freq ; 408 if (!split_last_date.isEmpty()) 409 { 410 CDate splitLastDate=CDate::FromString(split_last_date,*CContext::getCurrent()->getCalendar()) ; 411 if( splitLastDate < splitEnd) splitEnd=splitLastDate ; 412 } 413 414 if (!split_end_offset.isEmpty()) splitEnd = splitEnd + split_end_offset; 415 else splitEnd = splitEnd - 1 * Second; 398 416 399 417 string splitFormat; … … 410 428 411 429 oss << firstPart ; 412 if (hasStartDate) oss << lastSplit.getStr(splitFormat) ;430 if (hasStartDate) oss << split_start.getStr(splitFormat) ; 413 431 oss << middlePart ; 414 432 if (hasEndDate) oss << splitEnd.getStr(splitFormat); -
XIOS/dev/branch_yushan_merged/src/node/grid.cpp
r1134 r1205 1253 1253 std::vector<CAxis*> axisList = getAxis(); 1254 1254 std::vector<int> nZoomBegin(ssize), nZoomSize(ssize), nGlob(ssize), nZoomBeginGlobal(ssize); 1255 std::vector<CArray<int,1> > globalZoomIndex(numElement); 1255 1256 for (int i = 0; i < numElement; ++i) 1256 1257 { … … 1266 1267 nZoomBeginGlobal[indexMap[i] + 1] = domainList[domainId]->global_zoom_jbegin; 1267 1268 nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo; 1269 1270 { 1271 int count = 0; 1272 globalZoomIndex[i].resize(nZoomSize[indexMap[i]]*nZoomSize[indexMap[i]+1]); 1273 for (int jdx = 0; jdx < nZoomSize[indexMap[i]+1]; ++jdx) 1274 for (int idx = 0; idx < nZoomSize[indexMap[i]]; ++idx) 1275 { 1276 globalZoomIndex[i](count) = (nZoomBegin[indexMap[i]] + idx) + (nZoomBegin[indexMap[i]+1] + jdx) * nGlob[indexMap[i]]; 1277 ++count; 1278 } 1279 } 1268 1280 ++domainId; 1269 1281 } … … 1272 1284 nZoomBegin[indexMap[i]] = axisList[axisId]->zoom_begin_srv; 1273 1285 nZoomSize[indexMap[i]] = axisList[axisId]->zoom_size_srv; 1274 nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->global_zoom_begin ;1286 nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->global_zoom_begin_srv; 1275 1287 nGlob[indexMap[i]] = axisList[axisId]->n_glo; 1288 if (!axisList[axisId]->global_zoom_index.isEmpty()) 1289 { 1290 globalZoomIndex[i].reference(axisList[axisId]->zoom_index_srv); 1291 } 1292 else 1293 { 1294 globalZoomIndex[i].resize(nZoomSize[indexMap[i]]); 1295 for (int idx = 0; idx < nZoomSize[indexMap[i]]; ++idx) 1296 globalZoomIndex[i](idx) = nZoomBegin[indexMap[i]] + idx; 1297 } 1298 1276 1299 ++axisId; 1277 1300 } … … 1282 1305 nZoomBeginGlobal[indexMap[i]] = 0; 1283 1306 nGlob[indexMap[i]] = 1; 1307 globalZoomIndex[i].resize(1); 1308 globalZoomIndex[i](0) = 0; 1284 1309 ++scalarId; 1285 1310 } … … 1289 1314 dataSize *= nZoomSize[i]; 1290 1315 1291 serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize, 1292 nZoomBeginGlobal, nGlob); 1316 /* serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize, 1317 nZoomBeginGlobal, nGlob);*/ 1318 serverDistribution_ = new CDistributionServer(server->intraCommRank, 1319 globalZoomIndex, axis_domain_order, 1320 nZoomBegin, nZoomSize, nZoomBeginGlobal, nGlob); 1293 1321 } 1294 1322 -
XIOS/dev/branch_yushan_merged/src/node/zoom_axis.cpp
r836 r1205 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.