Changeset 1156
- Timestamp:
- 06/06/17 15:52:13 (7 years ago)
- Location:
- XIOS/dev/branch_yushan_merged
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan_merged/arch/arch-local.env
r1134 r1156 3 3 export HDF5_LIB_DIR=$HOME/LIB/hdf5-1.8.16/hdf5/lib 4 4 5 export NETCDF_INC_DIR= /usr/local/include6 export NETCDF_LIB_DIR= /usr/local/lib5 export NETCDF_INC_DIR=$HOME/LIB/netcdf-fortran-4.4.3/fortran 6 export NETCDF_LIB_DIR=$HOME/LIB/netcdf-fortran-4.4.3/fortran 7 7 -
XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_declaration.hpp
r1134 r1156 59 59 extern ep_lib::MPI_Status MPI_STATUS_IGNORE; 60 60 extern ep_lib::MPI_Request MPI_REQUEST_NULL; 61 //extern ep_lib::MPI_Info MPI_INFO_NULL;61 extern ep_lib::MPI_Info MPI_INFO_NULL; 62 62 63 63 #endif // EP_DECLARATION_HPP_INCLUDED -
XIOS/dev/branch_yushan_merged/src/client.cpp
r1134 r1156 28 28 StdOFStream CClient::m_errorStream; 29 29 30 StdOFStream CClient::array_infoStream[1 0];30 StdOFStream CClient::array_infoStream[16]; 31 31 32 32 void CClient::initialize(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm) … … 52 52 } 53 53 CTimer::get("XIOS").resume() ; 54 CTimer::get("XIOS init ").resume() ;54 CTimer::get("XIOS init/finalize").resume() ; 55 55 boost::hash<string> hashString ; 56 56 … … 151 151 152 152 CTimer::get("XIOS").resume() ; 153 CTimer::get("XIOS init ").resume() ;153 CTimer::get("XIOS init/finalize").resume() ; 154 154 155 155 if (CXios::usingServer) … … 269 269 MPI_Comm_free(&intraComm); 270 270 271 CTimer::get("XIOS finalize").suspend() ;271 CTimer::get("XIOS init/finalize").suspend() ; 272 272 CTimer::get("XIOS").suspend() ; 273 273 … … 283 283 /* #pragma omp critical (_output) 284 284 { 285 report(0) <<" Performance report : Whole time from XIOS init and finalize: "<< CTimer::get("XIOS init/finalize").getCumulatedTime()<<" s"<<endl ; 285 286 report(0) <<" Performance report : total time spent for XIOS : "<< CTimer::get("XIOS").getCumulatedTime()<<" s"<<endl ; 286 287 report(0)<< " Performance report : time spent for waiting free buffer : "<< CTimer::get("Blocking time").getCumulatedTime()<<" s"<<endl ; … … 290 291 report(0)<< " Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 291 292 report(0)<< " Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ; 292 } 293 report(100)<<CTimer::getAllCumulatedTime()<<endl ; 294 } 293 295 */ 294 296 } -
XIOS/dev/branch_yushan_merged/src/client.hpp
r1134 r1156 58 58 #pragma omp threadprivate(m_errorStream) 59 59 60 static StdOFStream array_infoStream[1 0];60 static StdOFStream array_infoStream[16]; 61 61 62 62 static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); -
XIOS/dev/branch_yushan_merged/src/config/file_attribute.conf
r1096 r1156 14 14 DECLARE_ENUM2(format, netcdf4, netcdf4_classic) 15 15 DECLARE_ENUM2(convention, CF, UGRID) 16 DECLARE_ATTRIBUTE(StdString, convention_str) 16 17 DECLARE_ENUM2(par_access, collective, independent) 17 18 DECLARE_ATTRIBUTE(bool, append) -
XIOS/dev/branch_yushan_merged/src/cxios.cpp
r1134 r1156 163 163 delete globalRegistry ; 164 164 } 165 CClient::closeInfoStream();166 167 165 168 166 #ifdef XIOS_MEMTRACK 167 168 #ifdef XIOS_MEMTRACK_LIGHT 169 report(10) << " Memory report : current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 170 report(10) << " Memory report : maximum memory used by XIOS : "<< MemTrack::getMaxMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 171 #endif 172 173 #ifdef XIOS_MEMTRACK_FULL 169 174 MemTrack::TrackListMemoryUsage() ; 170 175 MemTrack::TrackDumpBlocks(); 176 #endif 177 178 CClient::closeInfoStream(); 179 171 180 #endif 172 181 } … … 228 237 delete globalRegistry ; 229 238 } 230 231 239 CServer::finalize(); 232 240 241 #ifdef XIOS_MEMTRACK 242 243 #ifdef XIOS_MEMTRACK_LIGHT 244 #pragma omp critical (_output) 245 { 246 report(10) << " Memory report : current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 247 report(10) << " Memory report : maximum memory used by XIOS : "<< MemTrack::getMaxMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 248 } 249 #endif 250 251 #ifdef XIOS_MEMTRACK_FULL 252 MemTrack::TrackListMemoryUsage() ; 253 MemTrack::TrackDumpBlocks(); 254 #endif 255 #endif 233 256 CServer::closeInfoStream(); 234 257 } -
XIOS/dev/branch_yushan_merged/src/io/nc4_data_output.cpp
r1138 r1156 11 11 #include "netCdfException.hpp" 12 12 #include "exception.hpp" 13 #include "timer.hpp" 13 14 #include "uuid.hpp" 14 15 // mpi.hpp … … 1833 1834 singleDomain = (file->nbDomains == 1); 1834 1835 1836 StdString conv_str ; 1837 if (file->convention_str.isEmpty()) 1838 { 1839 if (SuperClassWriter::useCFConvention) conv_str="CF-1.6" ; 1840 else conv_str="UGRID" ; 1841 } 1842 else conv_str=file->convention_str ; 1843 1835 1844 try 1836 1845 { 1837 if (SuperClassWriter::useCFConvention) 1838 this->writeFileAttributes(filename, description, 1839 StdString("CF-1.6"), 1840 StdString("An IPSL model"), 1841 this->getTimeStamp()); 1842 else 1843 this->writeFileAttributes(filename, description, 1844 StdString("UGRID"), 1845 StdString("An IPSL model"), 1846 this->getTimeStamp()); 1847 1846 this->writeFileAttributes(filename, description, 1847 conv_str, 1848 StdString("An IPSL model"), 1849 this->getTimeStamp()); 1848 1850 1849 1851 if (!appendMode) … … 1990 1992 CGrid* grid = field->grid; 1991 1993 1992 if (field->getNStep()<1) return ; 1994 if (field->getNStep()<1) 1995 { 1996 return; 1997 } 1993 1998 1994 1999 if (!grid->doGridHaveDataToWrite()) 1995 if (SuperClass::type == MULTI_FILE || !isCollective) return; 1996 2000 if (SuperClass::type == MULTI_FILE || !isCollective) 2001 { 2002 return; 2003 } 2004 2005 1997 2006 StdString fieldid = field->getFieldOutputName(); 1998 2007 … … 2119 2128 case (MULTI_FILE) : 2120 2129 { 2130 CTimer::get("Files : writing data").resume(); 2121 2131 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1); 2132 CTimer::get("Files : writing data").suspend(); 2122 2133 if (wtime) 2123 2134 { 2135 CTimer::get("Files : writing time axis").resume(); 2124 2136 if ( wtimeData) 2125 2137 { 2126 SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2127 SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2128 } 2138 // SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2139 // SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2140 SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 2141 SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 2142 } 2129 2143 if (wtimeCounter) 2130 2144 { 2131 SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2132 if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2145 // SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2146 // if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2147 SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 2148 if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 2133 2149 } 2150 CTimer::get("Files : writing time axis").suspend(); 2134 2151 } 2135 2152 break; … … 2257 2274 } 2258 2275 2276 2277 CTimer::get("Files : writing data").resume(); 2259 2278 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1, &start, &count); 2279 CTimer::get("Files : writing data").suspend(); 2280 2260 2281 if (wtime) 2261 2282 { 2283 CTimer::get("Files : writing time axis").resume(); 2262 2284 if ( wtimeData) 2263 2285 { 2264 SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2265 SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2286 // SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2287 // SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2288 SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 2289 SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 2266 2290 } 2267 2291 if (wtimeCounter) 2268 2292 { 2269 SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2270 if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2293 // SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2294 // if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2295 SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 2296 if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 2297 2271 2298 } 2299 CTimer::get("Files : writing time axis").suspend(); 2272 2300 } 2273 2301 -
XIOS/dev/branch_yushan_merged/src/io/onetcdf4.cpp
r1138 r1156 6 6 #include "netCdfInterface.hpp" 7 7 #include "netCdfException.hpp" 8 #include "timer.hpp" 8 9 // mpi_std.hpp 9 10 … … 54 55 if (!append || !std::ifstream(filename.c_str())) 55 56 { 57 CTimer::get("Files : create").resume(); 56 58 if (wmpi) 57 59 //CNetCdfInterface::createPar(filename, mode, static_cast<MPI_Comm>(comm->mpi_comm), MPI_INFO_NULL_STD, this->ncidp); … … 59 61 else 60 62 CNetCdfInterface::create(filename, mode, this->ncidp); 61 63 CTimer::get("Files : create").suspend(); 64 62 65 this->appendMode = false; 63 66 } … … 65 68 { 66 69 mode |= NC_WRITE; 70 CTimer::get("Files : open").resume(); 67 71 if (wmpi) 68 72 //CNetCdfInterface::openPar(filename, mode, static_cast<MPI_Comm>(comm->mpi_comm), MPI_INFO_NULL_STD, this->ncidp); … … 70 74 else 71 75 CNetCdfInterface::open(filename, mode, this->ncidp); 72 76 CTimer::get("Files : open").suspend(); 73 77 this->appendMode = true; 74 78 } … … 84 88 void CONetCDF4::close() 85 89 { 90 CTimer::get("Files : close").resume(); 86 91 CNetCdfInterface::close(this->ncidp); 92 CTimer::get("Files : close").suspend(); 87 93 } 88 94 … … 559 565 560 566 this->getWriteDataInfos(name, 0, array_size, sstart, scount, NULL, NULL); 567 561 568 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 569 562 570 } 563 571 … … 585 593 586 594 this->getWriteDataInfos(name, record, array_size, sstart, scount, NULL, NULL); 587 if (using_netcdf_internal)588 {589 if (!isRoot)590 {591 sstart[0] = sstart[0] + 1;592 scount[0] = 0;593 }594 }595 595 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 596 596 } 597 597 598 void CONetCDF4::writeTimeAxisDataBounds(const CArray<double, 1>& data, const StdString& name, 599 bool collective, StdSize record, bool isRoot) 600 { 601 int grpid = this->getCurrentGroup(); 602 int varid = this->getVariable(name); 603 604 map<int,size_t>::iterator it=timeAxis.find(varid); 605 if (it == timeAxis.end()) timeAxis[varid] = record; 606 else 607 { 608 if (it->second >= record) return; 609 else it->second =record; 610 } 611 612 StdSize array_size = 1; 613 std::vector<StdSize> sstart, scount; 614 615 if (this->wmpi && collective) 616 CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 617 if (this->wmpi && !collective) 618 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 619 620 this->getWriteDataInfos(name, record, array_size, sstart, scount, NULL, NULL); 621 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 622 } 623 624 598 625 //--------------------------------------------------------------- 599 626 -
XIOS/dev/branch_yushan_merged/src/io/onetcdf4.hpp
r1138 r1156 73 73 void writeTimeAxisData(const CArray<double,1>& data, const StdString& name, 74 74 bool collective, StdSize record, bool Isroot); 75 void writeTimeAxisDataBounds(const CArray<double,1>& data, const StdString& name, 76 bool collective, StdSize record, bool Isroot); 75 77 /// Accesseur /// 76 78 const CONetCDF4Path& getCurrentPath(void) const; -
XIOS/dev/branch_yushan_merged/src/io/onetcdf4_impl.hpp
r1138 r1156 25 25 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 26 26 27 CTimer::get("Files : get data infos").resume(); 27 28 this->getWriteDataInfos 28 29 (name, record, array_size, sstart, scount, start, count); 30 CTimer::get("Files : get data infos").suspend(); 31 29 32 if (data.numElements() != array_size) 30 33 { … … 54 57 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 55 58 56 this->getWriteDataInfos 57 (name, record, array_size, sstart, scount, start, count); 59 CTimer::get("CONetCDF4::writeData getWriteDataInfos").resume(); 60 this->getWriteDataInfos(name, record, array_size, sstart, scount, start, count); 61 CTimer::get("CONetCDF4::writeData getWriteDataInfos").suspend(); 62 58 63 if (data.numElements()*stringArrayLen != array_size) 59 64 { … … 72 77 PtrArrayStr[it->size()]='\0' ; 73 78 } 79 CTimer::get("CONetCDF4::writeData writeData_").resume(); 74 80 this->writeData_(grpid, varid, sstart, scount, ArrayStr); 81 CTimer::get("CONetCDF4::writeData writeData_").suspend(); 75 82 delete [] ArrayStr ; 76 83 } -
XIOS/dev/branch_yushan_merged/src/log.cpp
r1134 r1156 7 7 { 8 8 9 std::filebuf* info_FB[1 0];9 std::filebuf* info_FB[16]; 10 10 11 11 -
XIOS/dev/branch_yushan_merged/src/log.hpp
r1134 r1156 19 19 { 20 20 omp_init_lock( &mutex ); 21 for(int i=0; i<1 0; i++)21 for(int i=0; i<16; i++) 22 22 strBuf_array[i] = sBuff; 23 23 } … … 61 61 string name ; 62 62 std::streambuf* strBuf_; 63 std::streambuf* strBuf_array[1 0];63 std::streambuf* strBuf_array[16]; 64 64 omp_lock_t mutex; 65 65 }; … … 70 70 71 71 72 extern std::filebuf* info_FB[1 0];72 extern std::filebuf* info_FB[16]; 73 73 74 74 -
XIOS/dev/branch_yushan_merged/src/memtrack.cpp
r1134 r1156 52 52 { 53 53 void addr2line(const char *file_name, char** addr, int naddr) ; 54 #ifdef XIOS_MEMTRACK_LIGHT 55 void addr2line(const char *file_name, char** addr, int naddr) {} 56 #endif 54 57 } 55 58 /* ------------------------------------------------------------ */ … … 59 62 namespace MemTrack 60 63 { 64 size_t currentMemorySize=0 ; 65 size_t maxMemorySize=0 ; 66 67 size_t getCurrentMemorySize(void) {return currentMemorySize; } 68 size_t getMaxMemorySize(void) {return maxMemorySize ; } 61 69 62 70 /* ------------------------------------------------------------ */ … … 376 384 // Get the offset to the user chunk and return it. 377 385 UserChunk *pUser = GetUserAddress(pProlog); 386 387 currentMemorySize += size ; 388 if (currentMemorySize>maxMemorySize) maxMemorySize=currentMemorySize ; 378 389 379 390 return pUser; … … 401 412 // Unlink the block header from the list and destroy it. 402 413 BlockHeader *pBlockHeader = GetHeaderAddress(pProlog); 414 currentMemorySize-=pBlockHeader->GetRequestedSize(); 403 415 BlockHeader::RemoveNode(pBlockHeader); 404 416 pBlockHeader->~BlockHeader(); -
XIOS/dev/branch_yushan_merged/src/memtrack.hpp
r501 r1156 61 61 void TrackDumpBlocks(); 62 62 void TrackListMemoryUsage(); 63 63 size_t getCurrentMemorySize(void) ; 64 size_t getMaxMemorySize(void) ; 64 65 /* ---------------------------------------- operator * (MemStamp, ptr) */ 65 66 -
XIOS/dev/branch_yushan_merged/src/node/context.cpp
r1146 r1156 14 14 #include "type.hpp" 15 15 #include "xios_spl.hpp" 16 #include "timer.hpp" 17 #include "memtrack.hpp" 16 18 17 19 … … 402 404 void CContext::closeDefinition(void) 403 405 { 406 CTimer::get("Context : close definition").resume() ; 404 407 // There is nothing client need to send to server 405 408 if (hasClient) … … 455 458 startPrefetchingOfEnabledReadModeFiles(); 456 459 } 460 CTimer::get("Context : close definition").suspend() ; 457 461 } 458 462 … … 1208 1212 { 1209 1213 calendar->update(step); 1210 1214 #ifdef XIOS_MEMTRACK_LIGHT 1215 info(50) << " Current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ; 1216 #endif 1211 1217 if (hasClient) 1212 1218 { -
XIOS/dev/branch_yushan_merged/src/node/field.cpp
r1155 r1156 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 -
XIOS/dev/branch_yushan_merged/src/node/file.cpp
r1153 r1156 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(); -
XIOS/dev/branch_yushan_merged/src/server.cpp
r1146 r1156 163 163 report(0)<<"Performance report : Time spent in processing events : "<<CTimer::get("Process events").getCumulatedTime()<<endl ; 164 164 report(0)<<"Performance report : Ratio : "<<CTimer::get("Process events").getCumulatedTime()/CTimer::get("XIOS server").getCumulatedTime()*100.<<"%"<<endl ; 165 report(100)<<CTimer::getAllCumulatedTime()<<endl ; 165 166 } 166 167 -
XIOS/dev/branch_yushan_merged/src/timer.cpp
r1134 r1156 3 3 #include <string> 4 4 #include <map> 5 #include <iostream> 6 #include <sstream> 5 7 #include "tracer.hpp" 6 8 … … 66 68 return it->second; 67 69 } 70 71 string CTimer::getAllCumulatedTime(void) 72 { 73 std::ostringstream strOut ; 74 for(std::map<std::string,CTimer>::iterator it=allTimer.begin();it!=allTimer.end();++it) 75 strOut<<"Timer : "<<it->first<<" --> cumulated time : "<<it->second.getCumulatedTime()<<std::endl ; 76 return strOut.str() ; 77 } 68 78 } -
XIOS/dev/branch_yushan_merged/src/timer.hpp
r1134 r1156 27 27 static double getTime(void); 28 28 static CTimer& get(std::string name); 29 static std::string getAllCumulatedTime(void) ; 29 30 }; 30 31 } -
XIOS/dev/branch_yushan_merged/src/transformation/Functions/average_reduction.cpp
r1076 r1156 39 39 int nbLocalIndex = localIndex.size(); 40 40 int currentlocalIndex = 0; 41 double currentWeight = 0.0; 42 43 dataOut=std::numeric_limits<double>::quiet_NaN(); 41 double currentWeight = 0.0; 44 42 45 43 for (int idx = 0; idx < nbLocalIndex; ++idx) … … 59 57 weights_(currentlocalIndex) += 1.0; 60 58 } 59 } 60 else 61 { 62 if (flagInitial[currentlocalIndex]) 63 dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 61 64 } 62 65 } -
XIOS/dev/branch_yushan_merged/src/transformation/Functions/max_reduction.cpp
r1076 r1156 36 36 { 37 37 int nbLocalIndex = localIndex.size(); 38 int currentlocalIndex = 0; 39 dataOut=std::numeric_limits<double>::quiet_NaN(); 38 int currentlocalIndex = 0; 40 39 for (int idx = 0; idx < nbLocalIndex; ++idx) 41 40 { … … 52 51 dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 53 52 } 53 } 54 else 55 { 56 if (flagInitial[currentlocalIndex]) 57 dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 54 58 } 55 59 } -
XIOS/dev/branch_yushan_merged/src/transformation/Functions/min_reduction.cpp
r1076 r1156 36 36 { 37 37 int nbLocalIndex = localIndex.size(); 38 int currentlocalIndex = 0; 39 dataOut=std::numeric_limits<double>::quiet_NaN(); 38 int currentlocalIndex = 0; 40 39 for (int idx = 0; idx < nbLocalIndex; ++idx) 41 40 { … … 52 51 dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 53 52 } 53 } 54 else 55 { 56 if (flagInitial[currentlocalIndex]) 57 dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 54 58 } 55 59 } -
XIOS/dev/branch_yushan_merged/src/transformation/Functions/sum_reduction.cpp
r1076 r1156 36 36 { 37 37 int nbLocalIndex = localIndex.size(); 38 int currentlocalIndex = 0; 39 40 dataOut=std::numeric_limits<double>::quiet_NaN(); 38 int currentlocalIndex = 0; 41 39 42 40 for (int idx = 0; idx < nbLocalIndex; ++idx) … … 54 52 dataOut(currentlocalIndex) += *(dataInput + idx); 55 53 } 54 } 55 else 56 { 57 if (flagInitial[currentlocalIndex]) 58 dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 56 59 } 57 60 } -
XIOS/dev/branch_yushan_merged/src/transformation/generic_algorithm_transformation.cpp
r1104 r1156 45 45 { 46 46 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 47 } 48 } 49 50 // for (int idx = 0; idx < nbLocalIndex; ++idx) 51 // { 52 // if (!flagInitial[localIndex[idx].first]) 53 // dataOut(localIndex[idx].first) = defaultValue; 54 // } 47 flagInitial[localIndex[idx].first] = true; // Reset flag to indicate not all data source are nan 48 } 49 } 50 51 // If all data source are nan then data destination must be nan 52 for (int idx = 0; idx < nbLocalIndex; ++idx) 53 { 54 if (!flagInitial[localIndex[idx].first]) 55 dataOut(localIndex[idx].first) = defaultValue; 56 } 55 57 } 56 58 else
Note: See TracChangeset
for help on using the changeset viewer.