Changeset 1160
- Timestamp:
- 06/06/17 19:06:45 (8 years ago)
- Location:
- XIOS/dev/branch_yushan_merged
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan_merged/arch/arch-local.env
r1156 r1160 3 3 export HDF5_LIB_DIR=$HOME/LIB/hdf5-1.8.16/hdf5/lib 4 4 5 export NETCDF_INC_DIR= $HOME/LIB/netcdf-fortran-4.4.3/fortran6 export NETCDF_LIB_DIR= $HOME/LIB/netcdf-fortran-4.4.3/fortran5 export NETCDF_INC_DIR=/usr/local/include 6 export NETCDF_LIB_DIR=/usr/local/lib 7 7 -
XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_declaration.hpp
r1156 r1160 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
r1157 r1160 28 28 StdOFStream CClient::m_errorStream; 29 29 30 StdOFStream CClient::array_infoStream[1 6];30 StdOFStream CClient::array_infoStream[10]; 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 /finalize").resume() ;54 CTimer::get("XIOS init").resume() ; 55 55 boost::hash<string> hashString ; 56 56 … … 151 151 152 152 CTimer::get("XIOS").resume() ; 153 CTimer::get("XIOS init /finalize").resume() ;153 CTimer::get("XIOS init").resume() ; 154 154 155 155 if (CXios::usingServer) … … 269 269 MPI_Comm_free(&intraComm); 270 270 271 CTimer::get("XIOS init/finalize").suspend() ;271 CTimer::get("XIOS 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 ;286 285 report(0) <<" Performance report : total time spent for XIOS : "<< CTimer::get("XIOS").getCumulatedTime()<<" s"<<endl ; 287 286 report(0)<< " Performance report : time spent for waiting free buffer : "<< CTimer::get("Blocking time").getCumulatedTime()<<" s"<<endl ; … … 291 290 report(0)<< " Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 292 291 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 ; 293 report(100)<<CTimer::getAllCumulatedTime()<<endl ;294 292 } 295 293 */ -
XIOS/dev/branch_yushan_merged/src/client.hpp
r1156 r1160 58 58 #pragma omp threadprivate(m_errorStream) 59 59 60 static StdOFStream array_infoStream[1 6];60 static StdOFStream array_infoStream[10]; 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
r1156 r1160 14 14 DECLARE_ENUM2(format, netcdf4, netcdf4_classic) 15 15 DECLARE_ENUM2(convention, CF, UGRID) 16 DECLARE_ATTRIBUTE(StdString, convention_str)17 16 DECLARE_ENUM2(par_access, collective, independent) 18 17 DECLARE_ATTRIBUTE(bool, append) -
XIOS/dev/branch_yushan_merged/src/cxios.cpp
r1157 r1160 163 163 delete globalRegistry ; 164 164 } 165 CClient::closeInfoStream(); 166 167 165 168 #ifdef XIOS_MEMTRACK 166 167 #ifdef XIOS_MEMTRACK_LIGHT168 #pragma omp critical (_output)169 report(10) << " Memory report : current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ;170 #pragma omp critical (_output)171 report(10) << " Memory report : maximum memory used by XIOS : "<< MemTrack::getMaxMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ;172 #endif173 174 #ifdef XIOS_MEMTRACK_FULL175 169 176 170 #ifdef XIOS_MEMTRACK_LIGHT … … 182 176 MemTrack::TrackListMemoryUsage() ; 183 177 MemTrack::TrackDumpBlocks(); 184 #endif185 186 CClient::closeInfoStream();187 188 178 #endif 189 179 } … … 245 235 delete globalRegistry ; 246 236 } 237 247 238 CServer::finalize(); 248 249 CServer::finalize(); 250 #ifdef XIOS_MEMTRACK 251 252 #ifdef XIOS_MEMTRACK_LIGHT 253 #pragma omp critical (_output) 254 report(10) << " Memory report : current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 255 #pragma omp critical (_output) 256 report(10) << " Memory report : maximum memory used by XIOS : "<< MemTrack::getMaxMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 257 #endif 258 259 #ifdef XIOS_MEMTRACK_FULL 260 MemTrack::TrackListMemoryUsage() ; 261 MemTrack::TrackDumpBlocks(); 262 #endif 263 264 #endif 239 265 240 CServer::closeInfoStream(); 266 241 } -
XIOS/dev/branch_yushan_merged/src/io/nc4_data_output.cpp
r1157 r1160 11 11 #include "netCdfException.hpp" 12 12 #include "exception.hpp" 13 #include "timer.hpp"14 13 #include "uuid.hpp" 15 14 // mpi.hpp … … 1833 1832 1834 1833 singleDomain = (file->nbDomains == 1); 1835 StdString conv_str ;1836 if (file->convention_str.isEmpty())1837 {1838 if (SuperClassWriter::useCFConvention) conv_str="CF-1.6" ;1839 else conv_str="UGRID" ;1840 }1841 else conv_str=file->convention_str ;1842 1843 1844 1834 try 1845 1835 { 1846 this->writeFileAttributes(filename, description, 1847 conv_str, 1848 StdString("An IPSL model"), 1849 this->getTimeStamp()); 1836 if (SuperClassWriter::useCFConvention) 1837 this->writeFileAttributes(filename, description, 1838 StdString("CF-1.6"), 1839 StdString("An IPSL model"), 1840 this->getTimeStamp()); 1841 else 1842 this->writeFileAttributes(filename, description, 1843 StdString("UGRID"), 1844 StdString("An IPSL model"), 1845 this->getTimeStamp()); 1846 1850 1847 1851 1848 if (!appendMode) … … 1992 1989 CGrid* grid = field->grid; 1993 1990 1994 if (field->getNStep()<1) 1995 { 1996 return; 1997 } 1991 if (field->getNStep()<1) return ; 1998 1992 1999 1993 if (!grid->doGridHaveDataToWrite()) 2000 if (SuperClass::type == MULTI_FILE || !isCollective) 2001 { 2002 return; 2003 } 2004 2005 1994 if (SuperClass::type == MULTI_FILE || !isCollective) return; 1995 2006 1996 StdString fieldid = field->getFieldOutputName(); 2007 1997 … … 2128 2118 case (MULTI_FILE) : 2129 2119 { 2130 CTimer::get("Files : writing data").resume();2131 2120 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1); 2132 CTimer::get("Files : writing data").suspend();2133 2121 if (wtime) 2134 2122 { 2135 CTimer::get("Files : writing time axis").resume();2136 2123 if ( wtimeData) 2137 2124 { 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 } 2125 SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2126 SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2127 } 2143 2128 if (wtimeCounter) 2144 2129 { 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); 2130 SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2131 if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2149 2132 } 2150 CTimer::get("Files : writing time axis").suspend();2151 2133 } 2152 2134 break; … … 2274 2256 } 2275 2257 2276 CTimer::get("Files : writing data").resume();2277 2258 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1, &start, &count); 2278 CTimer::get("Files : writing data").suspend();2279 2280 2259 if (wtime) 2281 2260 { 2282 CTimer::get("Files : writing time axis").resume();2283 2261 if ( wtimeData) 2284 2262 { 2285 // SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2286 // SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2287 SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 2288 SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 2263 SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2264 SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2289 2265 } 2290 2266 if (wtimeCounter) 2291 2267 { 2292 // SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2293 // if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2294 SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 2295 if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 2296 2268 SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2269 if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2297 2270 } 2298 CTimer::get("Files : writing time axis").suspend();2299 2271 } 2300 2272 -
XIOS/dev/branch_yushan_merged/src/io/onetcdf4.cpp
r1157 r1160 6 6 #include "netCdfInterface.hpp" 7 7 #include "netCdfException.hpp" 8 #include "timer.hpp"9 8 // mpi_std.hpp 10 9 … … 55 54 if (!append || !std::ifstream(filename.c_str())) 56 55 { 57 CTimer::get("Files : create").resume();58 56 if (wmpi) 59 57 CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL_STD, this->ncidp); 60 58 else 61 59 CNetCdfInterface::create(filename, mode, this->ncidp); 62 CTimer::get("Files : create").suspend(); 63 60 64 61 this->appendMode = false; 65 62 } … … 67 64 { 68 65 mode |= NC_WRITE; 69 CTimer::get("Files : open").resume();70 66 if (wmpi) 71 67 //CNetCdfInterface::openPar(filename, mode, static_cast<MPI_Comm>(comm->mpi_comm), MPI_INFO_NULL_STD, this->ncidp); … … 73 69 else 74 70 CNetCdfInterface::open(filename, mode, this->ncidp); 75 CTimer::get("Files : open").suspend(); 71 76 72 this->appendMode = true; 77 73 } … … 87 83 void CONetCDF4::close() 88 84 { 89 CTimer::get("Files : close").resume();90 85 CNetCdfInterface::close(this->ncidp); 91 CTimer::get("Files : close").suspend();92 86 } 93 87 … … 564 558 565 559 this->getWriteDataInfos(name, 0, array_size, sstart, scount, NULL, NULL); 566 567 560 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 568 569 561 } 570 562 … … 592 584 593 585 this->getWriteDataInfos(name, record, array_size, sstart, scount, NULL, NULL); 586 if (using_netcdf_internal) 587 { 588 if (!isRoot) 589 { 590 sstart[0] = sstart[0] + 1; 591 scount[0] = 0; 592 } 593 } 594 594 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 595 595 } 596 596 597 void CONetCDF4::writeTimeAxisDataBounds(const CArray<double, 1>& data, const StdString& name,598 bool collective, StdSize record, bool isRoot)599 {600 int grpid = this->getCurrentGroup();601 int varid = this->getVariable(name);602 603 map<int,size_t>::iterator it=timeAxis.find(varid);604 if (it == timeAxis.end()) timeAxis[varid] = record;605 else606 {607 if (it->second >= record) return;608 else it->second =record;609 }610 611 StdSize array_size = 1;612 std::vector<StdSize> sstart, scount;613 614 if (this->wmpi && collective)615 CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE);616 if (this->wmpi && !collective)617 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT);618 619 this->getWriteDataInfos(name, record, array_size, sstart, scount, NULL, NULL);620 this->writeData_(grpid, varid, sstart, scount, data.dataFirst());621 }622 623 624 597 //--------------------------------------------------------------- 625 598 -
XIOS/dev/branch_yushan_merged/src/io/onetcdf4.hpp
r1156 r1160 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);77 75 /// Accesseur /// 78 76 const CONetCDF4Path& getCurrentPath(void) const; -
XIOS/dev/branch_yushan_merged/src/io/onetcdf4_impl.hpp
r1157 r1160 25 25 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 26 26 27 CTimer::get("Files : get data infos").resume();28 27 this->getWriteDataInfos 29 28 (name, record, array_size, sstart, scount, start, count); 30 CTimer::get("Files : get data infos").suspend();31 32 29 if (data.numElements() != array_size) 33 30 { … … 57 54 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 58 55 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(); 56 this->getWriteDataInfos 57 (name, record, array_size, sstart, scount, start, count); 62 58 if (data.numElements()*stringArrayLen != array_size) 63 59 { … … 76 72 PtrArrayStr[it->size()]='\0' ; 77 73 } 78 CTimer::get("CONetCDF4::writeData writeData_").resume();79 74 this->writeData_(grpid, varid, sstart, scount, ArrayStr); 80 CTimer::get("CONetCDF4::writeData writeData_").suspend();81 75 delete [] ArrayStr ; 82 76 } -
XIOS/dev/branch_yushan_merged/src/log.cpp
r1156 r1160 7 7 { 8 8 9 std::filebuf* info_FB[1 6];9 std::filebuf* info_FB[10]; 10 10 11 11 -
XIOS/dev/branch_yushan_merged/src/log.hpp
r1156 r1160 19 19 { 20 20 omp_init_lock( &mutex ); 21 for(int i=0; i<1 6; i++)21 for(int i=0; i<10; i++) 22 22 strBuf_array[i] = sBuff; 23 23 } … … 61 61 string name ; 62 62 std::streambuf* strBuf_; 63 std::streambuf* strBuf_array[1 6];63 std::streambuf* strBuf_array[10]; 64 64 omp_lock_t mutex; 65 65 }; … … 70 70 71 71 72 extern std::filebuf* info_FB[1 6];72 extern std::filebuf* info_FB[10]; 73 73 74 74 -
XIOS/dev/branch_yushan_merged/src/memtrack.cpp
r1156 r1160 52 52 { 53 53 void addr2line(const char *file_name, char** addr, int naddr) ; 54 #ifdef XIOS_MEMTRACK_LIGHT55 void addr2line(const char *file_name, char** addr, int naddr) {}56 #endif57 54 } 58 55 /* ------------------------------------------------------------ */ … … 62 59 namespace MemTrack 63 60 { 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 ; }69 61 70 62 /* ------------------------------------------------------------ */ … … 384 376 // Get the offset to the user chunk and return it. 385 377 UserChunk *pUser = GetUserAddress(pProlog); 386 387 currentMemorySize += size ;388 if (currentMemorySize>maxMemorySize) maxMemorySize=currentMemorySize ;389 378 390 379 return pUser; … … 412 401 // Unlink the block header from the list and destroy it. 413 402 BlockHeader *pBlockHeader = GetHeaderAddress(pProlog); 414 currentMemorySize-=pBlockHeader->GetRequestedSize();415 403 BlockHeader::RemoveNode(pBlockHeader); 416 404 pBlockHeader->~BlockHeader(); -
XIOS/dev/branch_yushan_merged/src/memtrack.hpp
r1156 r1160 61 61 void TrackDumpBlocks(); 62 62 void TrackListMemoryUsage(); 63 size_t getCurrentMemorySize(void) ; 64 size_t getMaxMemorySize(void) ; 63 65 64 /* ---------------------------------------- operator * (MemStamp, ptr) */ 66 65 -
XIOS/dev/branch_yushan_merged/src/node/context.cpp
r1157 r1160 14 14 #include "type.hpp" 15 15 #include "xios_spl.hpp" 16 #include "timer.hpp"17 #include "memtrack.hpp"18 16 19 17 namespace xios { … … 403 401 void CContext::closeDefinition(void) 404 402 { 405 CTimer::get("Context : close definition").resume() ;406 403 // There is nothing client need to send to server 407 404 if (hasClient) … … 457 454 startPrefetchingOfEnabledReadModeFiles(); 458 455 } 459 CTimer::get("Context : close definition").suspend() ;460 456 } 461 457 … … 1211 1207 { 1212 1208 calendar->update(step); 1213 #ifdef XIOS_MEMTRACK_LIGHT 1214 #pragma omp critical (_output) 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 1209 1217 1210 1218 1211 if (hasClient) -
XIOS/dev/branch_yushan_merged/src/node/field.cpp
r1157 r1160 125 125 void CField::sendUpdateData(const CArray<double,1>& data) 126 126 { 127 CTimer::get("XIOS send data").resume();127 CTimer::get("XIOS 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("XIOS Send Data").suspend(); 180 180 } 181 181 … … 187 187 list<CEventServer::SSubEvent>::iterator it; 188 188 string fieldId; 189 CTimer::get("Field : recv data").resume(); 189 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();200 199 } 201 200 -
XIOS/dev/branch_yushan_merged/src/node/file.cpp
r1156 r1160 16 16 #include "context_client.hpp" 17 17 #include "mpi.hpp" 18 #include "timer.hpp"19 18 20 19 namespace xios { … … 275 274 if (mode.isEmpty() || mode.getValue() == mode_attr::write) 276 275 { 277 CTimer::get("Files : create headers").resume();278 276 if (!isOpen) createHeader(); 279 CTimer::get("Files : create headers").suspend();280 277 checkSync(); 281 278 } 282 279 else 283 280 { 284 CTimer::get("Files : open headers").resume();285 281 if (!isOpen) openInReadMode(); 286 CTimer::get("Files : open headers").suspend();287 282 } 288 283 checkSplit(); -
XIOS/dev/branch_yushan_merged/src/server.cpp
r1156 r1160 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 ;166 165 } 167 166 -
XIOS/dev/branch_yushan_merged/src/timer.cpp
r1157 r1160 3 3 #include <string> 4 4 #include <map> 5 #include <iostream>6 #include <sstream>7 5 #include "tracer.hpp" 8 6 #include <iostream> … … 71 69 } 72 70 73 string CTimer::getAllCumulatedTime(void)74 {75 if(allTimer_ptr == 0) allTimer_ptr = new std::map<std::string,CTimer>;76 77 std::ostringstream strOut ;78 for(std::map<std::string,CTimer>::iterator it=(*allTimer_ptr).begin();it!=(*allTimer_ptr).end();++it)79 strOut<<"Timer : "<<it->first<<" --> cumulated time : "<<it->second.getCumulatedTime()<<std::endl ;80 return strOut.str() ;81 }82 83 71 } -
XIOS/dev/branch_yushan_merged/src/timer.hpp
r1156 r1160 27 27 static double getTime(void); 28 28 static CTimer& get(std::string name); 29 static std::string getAllCumulatedTime(void) ;30 29 }; 31 30 } -
XIOS/dev/branch_yushan_merged/src/transformation/Functions/average_reduction.cpp
r1157 r1160 39 39 int nbLocalIndex = localIndex.size(); 40 40 int currentlocalIndex = 0; 41 double currentWeight = 0.0; 41 double currentWeight = 0.0; 42 42 43 dataOut=std::numeric_limits<double>::quiet_NaN(); 43 44 44 45 for (int idx = 0; idx < nbLocalIndex; ++idx) … … 58 59 weights_(currentlocalIndex) += 1.0; 59 60 } 60 }61 else62 {63 if (flagInitial[currentlocalIndex])64 dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();65 61 } 66 62 } -
XIOS/dev/branch_yushan_merged/src/transformation/Functions/max_reduction.cpp
r1157 r1160 37 37 int nbLocalIndex = localIndex.size(); 38 38 int currentlocalIndex = 0; 39 39 dataOut=std::numeric_limits<double>::quiet_NaN(); 40 40 for (int idx = 0; idx < nbLocalIndex; ++idx) 41 41 { … … 52 52 dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 53 53 } 54 }55 else56 {57 if (flagInitial[currentlocalIndex])58 dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();59 54 } 60 55 } -
XIOS/dev/branch_yushan_merged/src/transformation/Functions/min_reduction.cpp
r1157 r1160 37 37 int nbLocalIndex = localIndex.size(); 38 38 int currentlocalIndex = 0; 39 39 dataOut=std::numeric_limits<double>::quiet_NaN(); 40 40 for (int idx = 0; idx < nbLocalIndex; ++idx) 41 41 { … … 52 52 dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 53 53 } 54 }55 else56 {57 if (flagInitial[currentlocalIndex])58 dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();59 54 } 60 55 } -
XIOS/dev/branch_yushan_merged/src/transformation/Functions/sum_reduction.cpp
r1157 r1160 37 37 int nbLocalIndex = localIndex.size(); 38 38 int currentlocalIndex = 0; 39 40 dataOut=std::numeric_limits<double>::quiet_NaN(); 39 41 40 42 for (int idx = 0; idx < nbLocalIndex; ++idx) … … 52 54 dataOut(currentlocalIndex) += *(dataInput + idx); 53 55 } 54 }55 else56 {57 if (flagInitial[currentlocalIndex])58 dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();59 56 } 60 57 } -
XIOS/dev/branch_yushan_merged/src/transformation/generic_algorithm_transformation.cpp
r1156 r1160 45 45 { 46 46 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 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 } 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 // } 57 55 } 58 56 else
Note: See TracChangeset
for help on using the changeset viewer.