Changeset 1156


Ignore:
Timestamp:
06/06/17 15:52:13 (4 years ago)
Author:
yushan
Message:

branch merged with trunk @1155

Location:
XIOS/dev/branch_yushan_merged
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan_merged/arch/arch-local.env

    r1134 r1156  
    33export HDF5_LIB_DIR=$HOME/LIB/hdf5-1.8.16/hdf5/lib 
    44 
    5 export NETCDF_INC_DIR=/usr/local/include 
    6 export NETCDF_LIB_DIR=/usr/local/lib 
     5export NETCDF_INC_DIR=$HOME/LIB/netcdf-fortran-4.4.3/fortran 
     6export NETCDF_LIB_DIR=$HOME/LIB/netcdf-fortran-4.4.3/fortran 
    77 
  • XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_declaration.hpp

    r1134 r1156  
    5959extern ep_lib::MPI_Status MPI_STATUS_IGNORE; 
    6060extern ep_lib::MPI_Request MPI_REQUEST_NULL; 
    61 //extern ep_lib::MPI_Info MPI_INFO_NULL; 
     61extern ep_lib::MPI_Info MPI_INFO_NULL; 
    6262 
    6363#endif // EP_DECLARATION_HPP_INCLUDED 
  • XIOS/dev/branch_yushan_merged/src/client.cpp

    r1134 r1156  
    2828    StdOFStream CClient::m_errorStream; 
    2929 
    30     StdOFStream CClient::array_infoStream[10]; 
     30    StdOFStream CClient::array_infoStream[16]; 
    3131 
    3232    void CClient::initialize(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm) 
     
    5252          } 
    5353          CTimer::get("XIOS").resume() ; 
    54           CTimer::get("XIOS init").resume() ; 
     54          CTimer::get("XIOS init/finalize").resume() ; 
    5555          boost::hash<string> hashString ; 
    5656 
     
    151151 
    152152        CTimer::get("XIOS").resume() ; 
    153         CTimer::get("XIOS init").resume() ; 
     153        CTimer::get("XIOS init/finalize").resume() ; 
    154154 
    155155        if (CXios::usingServer) 
     
    269269      MPI_Comm_free(&intraComm); 
    270270 
    271       CTimer::get("XIOS finalize").suspend() ; 
     271      CTimer::get("XIOS init/finalize").suspend() ; 
    272272      CTimer::get("XIOS").suspend() ; 
    273273 
     
    283283  /*    #pragma omp critical (_output) 
    284284      { 
     285         report(0) <<" Performance report : Whole time from XIOS init and finalize: "<< CTimer::get("XIOS init/finalize").getCumulatedTime()<<" s"<<endl ; 
    285286         report(0) <<"     Performance report : total time spent for XIOS : "<< CTimer::get("XIOS").getCumulatedTime()<<" s"<<endl ; 
    286287         report(0)<< "     Performance report : time spent for waiting free buffer : "<< CTimer::get("Blocking time").getCumulatedTime()<<" s"<<endl ; 
     
    290291         report(0)<< "     Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 
    291292         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      }       
    293295*/ 
    294296   } 
  • XIOS/dev/branch_yushan_merged/src/client.hpp

    r1134 r1156  
    5858        #pragma omp threadprivate(m_errorStream) 
    5959 
    60         static StdOFStream array_infoStream[10]; 
     60        static StdOFStream array_infoStream[16]; 
    6161 
    6262        static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); 
  • XIOS/dev/branch_yushan_merged/src/config/file_attribute.conf

    r1096 r1156  
    1414DECLARE_ENUM2(format,        netcdf4, netcdf4_classic) 
    1515DECLARE_ENUM2(convention,    CF, UGRID) 
     16DECLARE_ATTRIBUTE(StdString, convention_str) 
    1617DECLARE_ENUM2(par_access,    collective, independent) 
    1718DECLARE_ATTRIBUTE(bool,      append) 
  • XIOS/dev/branch_yushan_merged/src/cxios.cpp

    r1134 r1156  
    163163       delete globalRegistry ; 
    164164     } 
    165      CClient::closeInfoStream(); 
    166    
    167165 
    168166#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 
    169174     MemTrack::TrackListMemoryUsage() ; 
    170175     MemTrack::TrackDumpBlocks(); 
     176#endif 
     177 
     178     CClient::closeInfoStream(); 
     179 
    171180#endif 
    172181  } 
     
    228237       delete globalRegistry ; 
    229238     } 
    230  
    231239    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 
    233256    CServer::closeInfoStream(); 
    234257  } 
  • XIOS/dev/branch_yushan_merged/src/io/nc4_data_output.cpp

    r1138 r1156  
    1111#include "netCdfException.hpp" 
    1212#include "exception.hpp" 
     13#include "timer.hpp" 
    1314#include "uuid.hpp" 
    1415// mpi.hpp 
     
    18331834         singleDomain = (file->nbDomains == 1); 
    18341835 
     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            
    18351844         try 
    18361845         { 
    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()); 
    18481850 
    18491851           if (!appendMode) 
     
    19901992        CGrid* grid = field->grid; 
    19911993 
    1992         if (field->getNStep()<1) return ; 
     1994        if (field->getNStep()<1)  
     1995        { 
     1996          return; 
     1997        } 
    19931998         
    19941999        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           
    19972006        StdString fieldid = field->getFieldOutputName(); 
    19982007 
     
    21192128              case (MULTI_FILE) : 
    21202129              { 
     2130                 CTimer::get("Files : writing data").resume(); 
    21212131                 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1); 
     2132                 CTimer::get("Files : writing data").suspend(); 
    21222133                 if (wtime) 
    21232134                 { 
     2135                   CTimer::get("Files : writing time axis").resume(); 
    21242136                   if ( wtimeData) 
    21252137                   { 
    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                  } 
    21292143                   if (wtimeCounter) 
    21302144                   { 
    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); 
    21332149                   } 
     2150                   CTimer::get("Files : writing time axis").suspend(); 
    21342151                 } 
    21352152                 break; 
     
    22572274                } 
    22582275 
     2276 
     2277                CTimer::get("Files : writing data").resume(); 
    22592278                SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1, &start, &count); 
     2279                CTimer::get("Files : writing data").suspend(); 
     2280 
    22602281                 if (wtime) 
    22612282                 { 
     2283                   CTimer::get("Files : writing time axis").resume(); 
    22622284                   if ( wtimeData) 
    22632285                   { 
    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); 
    22662290                   } 
    22672291                   if (wtimeCounter) 
    22682292                   { 
    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 
    22712298                   } 
     2299                   CTimer::get("Files : writing time axis").suspend();   
    22722300                 } 
    22732301 
  • XIOS/dev/branch_yushan_merged/src/io/onetcdf4.cpp

    r1138 r1156  
    66#include "netCdfInterface.hpp" 
    77#include "netCdfException.hpp" 
     8#include "timer.hpp" 
    89// mpi_std.hpp 
    910 
     
    5455         if (!append || !std::ifstream(filename.c_str())) 
    5556         { 
     57            CTimer::get("Files : create").resume(); 
    5658            if (wmpi) 
    5759               //CNetCdfInterface::createPar(filename, mode, static_cast<MPI_Comm>(comm->mpi_comm), MPI_INFO_NULL_STD, this->ncidp);            
     
    5961            else 
    6062               CNetCdfInterface::create(filename, mode, this->ncidp); 
    61  
     63            CTimer::get("Files : create").suspend(); 
     64  
    6265            this->appendMode = false; 
    6366         } 
     
    6568         { 
    6669            mode |= NC_WRITE; 
     70            CTimer::get("Files : open").resume(); 
    6771            if (wmpi) 
    6872               //CNetCdfInterface::openPar(filename, mode, static_cast<MPI_Comm>(comm->mpi_comm), MPI_INFO_NULL_STD, this->ncidp); 
     
    7074            else 
    7175               CNetCdfInterface::open(filename, mode, this->ncidp); 
    72  
     76            CTimer::get("Files : open").suspend(); 
    7377            this->appendMode = true; 
    7478         } 
     
    8488      void CONetCDF4::close() 
    8589      { 
     90        CTimer::get("Files : close").resume(); 
    8691        CNetCdfInterface::close(this->ncidp); 
     92        CTimer::get("Files : close").suspend(); 
    8793      } 
    8894 
     
    559565 
    560566         this->getWriteDataInfos(name, 0, array_size,  sstart, scount, NULL, NULL); 
     567 
    561568         this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
     569 
    562570      } 
    563571 
     
    585593 
    586594         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          } 
    595595         this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
    596596       } 
    597597 
     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 
    598625      //--------------------------------------------------------------- 
    599626 
  • XIOS/dev/branch_yushan_merged/src/io/onetcdf4.hpp

    r1138 r1156  
    7373            void writeTimeAxisData(const CArray<double,1>& data, const StdString& name, 
    7474                                   bool collective, StdSize record, bool Isroot); 
     75            void writeTimeAxisDataBounds(const CArray<double,1>& data, const StdString& name, 
     76                                   bool collective, StdSize record, bool Isroot); 
    7577            /// Accesseur /// 
    7678            const CONetCDF4Path& getCurrentPath(void) const; 
  • XIOS/dev/branch_yushan_merged/src/io/onetcdf4_impl.hpp

    r1138 r1156  
    2525    CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 
    2626 
     27    CTimer::get("Files : get data infos").resume(); 
    2728    this->getWriteDataInfos 
    2829    (name, record, array_size,  sstart, scount, start, count); 
     30    CTimer::get("Files : get data infos").suspend(); 
     31 
    2932    if (data.numElements() != array_size) 
    3033    { 
     
    5457    CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 
    5558 
    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  
    5863    if (data.numElements()*stringArrayLen != array_size) 
    5964    { 
     
    7277      PtrArrayStr[it->size()]='\0' ; 
    7378    } 
     79    CTimer::get("CONetCDF4::writeData writeData_").resume(); 
    7480    this->writeData_(grpid, varid, sstart, scount, ArrayStr); 
     81    CTimer::get("CONetCDF4::writeData writeData_").suspend(); 
    7582    delete [] ArrayStr ; 
    7683  } 
  • XIOS/dev/branch_yushan_merged/src/log.cpp

    r1134 r1156  
    77{ 
    88 
    9   std::filebuf* info_FB[10]; 
     9  std::filebuf* info_FB[16]; 
    1010 
    1111 
  • XIOS/dev/branch_yushan_merged/src/log.hpp

    r1134 r1156  
    1919    { 
    2020      omp_init_lock( &mutex ); 
    21       for(int i=0; i<10; i++) 
     21      for(int i=0; i<16; i++) 
    2222        strBuf_array[i] = sBuff; 
    2323    } 
     
    6161    string name ; 
    6262    std::streambuf* strBuf_; 
    63     std::streambuf* strBuf_array[10]; 
     63    std::streambuf* strBuf_array[16]; 
    6464    omp_lock_t mutex; 
    6565  }; 
     
    7070 
    7171 
    72   extern std::filebuf* info_FB[10]; 
     72  extern std::filebuf* info_FB[16]; 
    7373 
    7474 
  • XIOS/dev/branch_yushan_merged/src/memtrack.cpp

    r1134 r1156  
    5252{ 
    5353  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 
    5457} 
    5558/* ------------------------------------------------------------ */ 
     
    5962namespace MemTrack 
    6063{ 
     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 ; } 
    6169 
    6270    /* ------------------------------------------------------------ */ 
     
    376384        // Get the offset to the user chunk and return it. 
    377385        UserChunk *pUser = GetUserAddress(pProlog); 
     386 
     387        currentMemorySize += size ; 
     388        if (currentMemorySize>maxMemorySize) maxMemorySize=currentMemorySize ; 
    378389         
    379390        return pUser; 
     
    401412        // Unlink the block header from the list and destroy it. 
    402413        BlockHeader *pBlockHeader = GetHeaderAddress(pProlog); 
     414        currentMemorySize-=pBlockHeader->GetRequestedSize(); 
    403415        BlockHeader::RemoveNode(pBlockHeader); 
    404416        pBlockHeader->~BlockHeader(); 
  • XIOS/dev/branch_yushan_merged/src/memtrack.hpp

    r501 r1156  
    6161    void TrackDumpBlocks(); 
    6262    void TrackListMemoryUsage(); 
    63  
     63    size_t getCurrentMemorySize(void) ; 
     64    size_t getMaxMemorySize(void) ; 
    6465    /* ---------------------------------------- operator * (MemStamp, ptr) */ 
    6566 
  • XIOS/dev/branch_yushan_merged/src/node/context.cpp

    r1146 r1156  
    1414#include "type.hpp" 
    1515#include "xios_spl.hpp" 
     16#include "timer.hpp" 
     17#include "memtrack.hpp" 
    1618 
    1719 
     
    402404   void CContext::closeDefinition(void) 
    403405   { 
     406     CTimer::get("Context : close definition").resume() ; 
    404407     // There is nothing client need to send to server 
    405408     if (hasClient) 
     
    455458      startPrefetchingOfEnabledReadModeFiles(); 
    456459    } 
     460    CTimer::get("Context : close definition").suspend() ; 
    457461   } 
    458462 
     
    12081212   { 
    12091213      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 
    12111217      if (hasClient) 
    12121218      { 
  • XIOS/dev/branch_yushan_merged/src/node/field.cpp

    r1155 r1156  
    125125  void CField::sendUpdateData(const CArray<double,1>& data) 
    126126  { 
    127     CTimer::get("XIOS Send Data").resume(); 
     127    CTimer::get("Field : send data").resume(); 
    128128 
    129129    CContext* context = CContext::getCurrent(); 
     
    177177    } 
    178178 
    179     CTimer::get("XIOS Send Data").suspend(); 
     179    CTimer::get("Field : send data").suspend(); 
    180180  } 
    181181 
     
    187187    list<CEventServer::SSubEvent>::iterator it; 
    188188    string fieldId; 
    189  
     189    CTimer::get("Field : recv data").resume(); 
    190190    for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it) 
    191191    { 
     
    197197    } 
    198198    get(fieldId)->recvUpdateData(ranks,buffers); 
     199    CTimer::get("Field : recv data").suspend(); 
    199200  } 
    200201 
  • XIOS/dev/branch_yushan_merged/src/node/file.cpp

    r1153 r1156  
    1616#include "context_client.hpp" 
    1717#include "mpi.hpp" 
     18#include "timer.hpp" 
    1819 
    1920namespace xios { 
     
    274275      if (mode.isEmpty() || mode.getValue() == mode_attr::write) 
    275276      { 
     277        CTimer::get("Files : create headers").resume(); 
    276278        if (!isOpen) createHeader(); 
     279        CTimer::get("Files : create headers").suspend(); 
    277280        checkSync(); 
    278281      } 
    279282      else 
    280283      { 
     284        CTimer::get("Files : open headers").resume(); 
    281285        if (!isOpen) openInReadMode(); 
     286        CTimer::get("Files : open headers").suspend(); 
    282287      } 
    283288      checkSplit(); 
  • XIOS/dev/branch_yushan_merged/src/server.cpp

    r1146 r1156  
    163163      report(0)<<"Performance report : Time spent in processing events : "<<CTimer::get("Process events").getCumulatedTime()<<endl  ; 
    164164      report(0)<<"Performance report : Ratio : "<<CTimer::get("Process events").getCumulatedTime()/CTimer::get("XIOS server").getCumulatedTime()*100.<<"%"<<endl  ; 
     165      report(100)<<CTimer::getAllCumulatedTime()<<endl ; 
    165166    } 
    166167 
  • XIOS/dev/branch_yushan_merged/src/timer.cpp

    r1134 r1156  
    33#include <string> 
    44#include <map> 
     5#include <iostream> 
     6#include <sstream> 
    57#include "tracer.hpp" 
    68 
     
    6668    return it->second; 
    6769  } 
     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  } 
    6878} 
  • XIOS/dev/branch_yushan_merged/src/timer.hpp

    r1134 r1156  
    2727      static double getTime(void); 
    2828      static CTimer& get(std::string name); 
     29      static std::string getAllCumulatedTime(void) ; 
    2930  }; 
    3031} 
  • XIOS/dev/branch_yushan_merged/src/transformation/Functions/average_reduction.cpp

    r1076 r1156  
    3939    int nbLocalIndex = localIndex.size(); 
    4040    int currentlocalIndex = 0; 
    41     double currentWeight  = 0.0; 
    42  
    43     dataOut=std::numeric_limits<double>::quiet_NaN(); 
     41    double currentWeight  = 0.0;     
    4442 
    4543    for (int idx = 0; idx < nbLocalIndex; ++idx) 
     
    5957          weights_(currentlocalIndex) += 1.0; 
    6058        } 
     59      } 
     60      else 
     61      { 
     62        if (flagInitial[currentlocalIndex])  
     63          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 
    6164      } 
    6265    } 
  • XIOS/dev/branch_yushan_merged/src/transformation/Functions/max_reduction.cpp

    r1076 r1156  
    3636  { 
    3737    int nbLocalIndex = localIndex.size(); 
    38     int currentlocalIndex = 0; 
    39     dataOut=std::numeric_limits<double>::quiet_NaN();     
     38    int currentlocalIndex = 0;     
    4039    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4140    { 
     
    5251          dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 
    5352        } 
     53      } 
     54      else 
     55      { 
     56        if (flagInitial[currentlocalIndex])  
     57          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 
    5458      } 
    5559    } 
  • XIOS/dev/branch_yushan_merged/src/transformation/Functions/min_reduction.cpp

    r1076 r1156  
    3636  { 
    3737    int nbLocalIndex = localIndex.size(); 
    38     int currentlocalIndex = 0; 
    39     dataOut=std::numeric_limits<double>::quiet_NaN(); 
     38    int currentlocalIndex = 0;     
    4039    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4140    { 
     
    5251          dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 
    5352        } 
     53      } 
     54      else 
     55      { 
     56        if (flagInitial[currentlocalIndex])  
     57          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 
    5458      } 
    5559    } 
  • XIOS/dev/branch_yushan_merged/src/transformation/Functions/sum_reduction.cpp

    r1076 r1156  
    3636  { 
    3737    int nbLocalIndex = localIndex.size(); 
    38     int currentlocalIndex = 0; 
    39  
    40     dataOut=std::numeric_limits<double>::quiet_NaN(); 
     38    int currentlocalIndex = 0;     
    4139   
    4240    for (int idx = 0; idx < nbLocalIndex; ++idx) 
     
    5452          dataOut(currentlocalIndex) += *(dataInput + idx); 
    5553        } 
     54      } 
     55      else 
     56      { 
     57        if (flagInitial[currentlocalIndex])  
     58          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN(); 
    5659      } 
    5760    }     
  • XIOS/dev/branch_yushan_merged/src/transformation/generic_algorithm_transformation.cpp

    r1104 r1156  
    4545      { 
    4646        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    } 
    5557  } 
    5658  else 
Note: See TracChangeset for help on using the changeset viewer.