Changeset 1135
- Timestamp:
- 05/17/17 11:02:34 (7 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/client.cpp
r1032 r1135 42 42 } 43 43 CTimer::get("XIOS").resume() ; 44 CTimer::get("XIOS init ").resume() ;44 CTimer::get("XIOS init/finalize").resume() ; 45 45 boost::hash<string> hashString ; 46 46 … … 132 132 133 133 CTimer::get("XIOS").resume() ; 134 CTimer::get("XIOS init ").resume() ;134 CTimer::get("XIOS init/finalize").resume() ; 135 135 136 136 if (CXios::usingServer) … … 235 235 MPI_Comm_free(&intraComm); 236 236 237 CTimer::get("XIOS finalize").suspend() ;237 CTimer::get("XIOS init/finalize").suspend() ; 238 238 CTimer::get("XIOS").suspend() ; 239 239 … … 245 245 246 246 info(20) << "Client side context is finalized"<<endl ; 247 report(0) <<" Performance report : Whole time from XIOS init and finalize: "<< CTimer::get("XIOS init/finalize").getCumulatedTime()<<" s"<<endl ; 247 248 report(0) <<" Performance report : total time spent for XIOS : "<< CTimer::get("XIOS").getCumulatedTime()<<" s"<<endl ; 248 249 report(0)<< " Performance report : time spent for waiting free buffer : "<< CTimer::get("Blocking time").getCumulatedTime()<<" s"<<endl ; 249 report(0)<< " Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS ").getCumulatedTime()*100.<<" %"<<endl ;250 report(0)<< " Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS init/finalize").getCumulatedTime()*100.<<" %"<<endl ; 250 251 report(0)<< " Performance report : This ratio must be close to zero. Otherwise it may be usefull to increase buffer size or numbers of server"<<endl ; 251 252 // report(0)<< " Memory report : Current buffer_size : "<<CXios::bufferSize<<endl ; 252 253 report(0)<< " Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 253 254 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 ; 255 report(100)<<CTimer::getAllCumulatedTime()<<endl ; 254 256 } 255 257 -
XIOS/trunk/src/config/file_attribute.conf
r1096 r1135 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/trunk/src/io/nc4_data_output.cpp
r1108 r1135 11 11 #include "netCdfException.hpp" 12 12 #include "exception.hpp" 13 #include "timer.hpp" 13 14 #include "uuid.hpp" 14 15 15 namespace xios 16 16 { … … 1832 1832 singleDomain = (file->nbDomains == 1); 1833 1833 1834 StdString conv_str ; 1835 if (file->convention_str.isEmpty()) 1836 { 1837 if (SuperClassWriter::useCFConvention) conv_str="CF-1.6" ; 1838 else conv_str="UGRID" ; 1839 } 1840 else conv_str=file->convention_str ; 1841 1834 1842 try 1835 1843 { 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 1844 this->writeFileAttributes(filename, description, 1845 conv_str, 1846 StdString("An IPSL model"), 1847 this->getTimeStamp()); 1847 1848 1848 1849 if (!appendMode) … … 1989 1990 CGrid* grid = field->grid; 1990 1991 1991 if (field->getNStep()<1) return ; 1992 if (field->getNStep()<1) 1993 { 1994 return; 1995 } 1992 1996 1993 1997 if (!grid->doGridHaveDataToWrite()) 1994 if (SuperClass::type == MULTI_FILE || !isCollective) return; 1995 1998 if (SuperClass::type == MULTI_FILE || !isCollective) 1999 { 2000 return; 2001 } 2002 2003 1996 2004 StdString fieldid = field->getFieldOutputName(); 1997 2005 … … 2118 2126 case (MULTI_FILE) : 2119 2127 { 2128 CTimer::get("Files : writing data").resume(); 2120 2129 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1); 2130 CTimer::get("Files : writing data").suspend(); 2121 2131 if (wtime) 2122 2132 { 2133 CTimer::get("Files : writing time axis").resume(); 2123 2134 if ( wtimeData) 2124 2135 { 2125 SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2126 SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2127 } 2136 // SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2137 // SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2138 SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 2139 SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 2140 } 2128 2141 if (wtimeCounter) 2129 2142 { 2130 SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2131 if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2143 // SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2144 // if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2145 SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 2146 if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 2132 2147 } 2148 CTimer::get("Files : writing time axis").suspend(); 2133 2149 } 2134 2150 break; … … 2256 2272 } 2257 2273 2274 2275 CTimer::get("Files : writing data").resume(); 2258 2276 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1, &start, &count); 2277 CTimer::get("Files : writing data").suspend(); 2278 2259 2279 if (wtime) 2260 2280 { 2281 CTimer::get("Files : writing time axis").resume(); 2261 2282 if ( wtimeData) 2262 2283 { 2263 SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2264 SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2284 // SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2285 // SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2286 SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 2287 SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 2265 2288 } 2266 2289 if (wtimeCounter) 2267 2290 { 2268 SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2269 if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2291 // SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2292 // if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2293 SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 2294 if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 2295 2270 2296 } 2297 CTimer::get("Files : writing time axis").suspend(); 2271 2298 } 2272 2299 -
XIOS/trunk/src/io/onetcdf4.cpp
r1097 r1135 7 7 #include "netCdfInterface.hpp" 8 8 #include "netCdfException.hpp" 9 #include "timer.hpp" 9 10 10 11 namespace xios … … 55 56 if (!append || !std::ifstream(filename.c_str())) 56 57 { 58 CTimer::get("Files : create").resume(); 57 59 if (wmpi) 58 60 CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL, 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, *comm, MPI_INFO_NULL, this->ncidp); 69 73 else 70 74 CNetCdfInterface::open(filename, mode, this->ncidp); 71 75 CTimer::get("Files : open").suspend(); 72 76 this->appendMode = true; 73 77 } … … 83 87 void CONetCDF4::close() 84 88 { 89 CTimer::get("Files : close").resume(); 85 90 CNetCdfInterface::close(this->ncidp); 91 CTimer::get("Files : close").suspend(); 86 92 } 87 93 … … 557 563 558 564 this->getWriteDataInfos(name, 0, array_size, sstart, scount, NULL, NULL); 565 559 566 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 567 560 568 } 561 569 … … 583 591 584 592 this->getWriteDataInfos(name, record, array_size, sstart, scount, NULL, NULL); 585 if (using_netcdf_internal)586 {587 if (!isRoot)588 {589 sstart[0] = sstart[0] + 1;590 scount[0] = 0;591 }592 }593 593 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 594 594 } 595 595 596 void CONetCDF4::writeTimeAxisDataBounds(const CArray<double, 1>& data, const StdString& name, 597 bool collective, StdSize record, bool isRoot) 598 { 599 int grpid = this->getCurrentGroup(); 600 int varid = this->getVariable(name); 601 602 map<int,size_t>::iterator it=timeAxis.find(varid); 603 if (it == timeAxis.end()) timeAxis[varid] = record; 604 else 605 { 606 if (it->second >= record) return; 607 else it->second =record; 608 } 609 610 StdSize array_size = 1; 611 std::vector<StdSize> sstart, scount; 612 613 if (this->wmpi && collective) 614 CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 615 if (this->wmpi && !collective) 616 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 617 618 this->getWriteDataInfos(name, record, array_size, sstart, scount, NULL, NULL); 619 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 620 } 621 622 596 623 //--------------------------------------------------------------- 597 624 -
XIOS/trunk/src/io/onetcdf4.hpp
r1097 r1135 71 71 void writeTimeAxisData(const CArray<double,1>& data, const StdString& name, 72 72 bool collective, StdSize record, bool Isroot); 73 void writeTimeAxisDataBounds(const CArray<double,1>& data, const StdString& name, 74 bool collective, StdSize record, bool Isroot); 73 75 /// Accesseur /// 74 76 const CONetCDF4Path& getCurrentPath(void) const; -
XIOS/trunk/src/io/onetcdf4_impl.hpp
r1050 r1135 4 4 #include "onetcdf4.hpp" 5 5 #include "netCdfInterface.hpp" 6 #include "timer.hpp" 6 7 7 8 namespace xios … … 23 24 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 24 25 26 CTimer::get("Files : get data infos").resume(); 25 27 this->getWriteDataInfos 26 28 (name, record, array_size, sstart, scount, start, count); 29 CTimer::get("Files : get data infos").suspend(); 30 27 31 if (data.numElements() != array_size) 28 32 { … … 52 56 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 53 57 54 this->getWriteDataInfos 55 (name, record, array_size, sstart, scount, start, count); 58 CTimer::get("CONetCDF4::writeData getWriteDataInfos").resume(); 59 this->getWriteDataInfos(name, record, array_size, sstart, scount, start, count); 60 CTimer::get("CONetCDF4::writeData getWriteDataInfos").suspend(); 61 56 62 if (data.numElements()*stringArrayLen != array_size) 57 63 { … … 70 76 PtrArrayStr[it->size()]='\0' ; 71 77 } 78 CTimer::get("CONetCDF4::writeData writeData_").resume(); 72 79 this->writeData_(grpid, varid, sstart, scount, ArrayStr); 80 CTimer::get("CONetCDF4::writeData writeData_").suspend(); 73 81 delete [] ArrayStr ; 74 82 } -
XIOS/trunk/src/node/context.cpp
r1091 r1135 14 14 #include "type.hpp" 15 15 #include "xios_spl.hpp" 16 #include "timer.hpp" 16 17 17 18 … … 389 390 void CContext::closeDefinition(void) 390 391 { 392 CTimer::get("Context : close definition").resume() ; 391 393 // There is nothing client need to send to server 392 394 if (hasClient) … … 442 444 startPrefetchingOfEnabledReadModeFiles(); 443 445 } 446 CTimer::get("Context : close definition").suspend() ; 444 447 } 445 448 -
XIOS/trunk/src/node/field.cpp
r1120 r1135 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/trunk/src/node/file.cpp
r1098 r1135 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/trunk/src/server.cpp
r1032 r1135 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/trunk/src/timer.cpp
r652 r1135 3 3 #include <string> 4 4 #include <map> 5 #include <iostream> 6 #include <sstream> 5 7 #include "tracer.hpp" 6 8 … … 57 59 return it->second; 58 60 } 61 62 string CTimer::getAllCumulatedTime(void) 63 { 64 std::ostringstream strOut ; 65 for(std::map<std::string,CTimer>::iterator it=allTimer.begin();it!=allTimer.end();++it) 66 strOut<<"Timer : "<<it->first<<" --> cumulated time : "<<it->second.getCumulatedTime()<<std::endl ; 67 return strOut.str() ; 68 } 59 69 } -
XIOS/trunk/src/timer.hpp
r688 r1135 23 23 static double getTime(void); 24 24 static CTimer& get(std::string name); 25 static std::string getAllCumulatedTime(void) ; 25 26 }; 26 27 }
Note: See TracChangeset
for help on using the changeset viewer.