- Timestamp:
- 10/13/22 15:45:43 (19 months ago)
- Location:
- XIOS3/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/trunk/bld.cfg
r2409 r2420 53 53 bld::target xios_server.exe 54 54 bld::target generic_testcase.exe 55 bld::target test_ugrid.exe55 #bld::target test_ugrid.exe 56 56 #bld::target test_regular.exe 57 57 #bld::target test_xios2_cmip6.exe -
XIOS3/trunk/scripts/plotly_memory.js
r2419 r2420 72 72 title: "Memory consumption", 73 73 xaxis: { 74 title: "Time ( ms)",74 title: "Time (s)", 75 75 }, 76 76 yaxis: { -
XIOS3/trunk/src/cxios.cpp
r2419 r2420 56 56 bool CXios::checkSumRecv=false ; 57 57 bool CXios::checkSumSend=false ; 58 bool CXios::logMemory=false ; 58 59 59 60 CDaemonsManager* CXios::daemonsManager_=nullptr ; … … 117 118 checkSumSend = getin<bool>("checksum_send_fields", false); 118 119 checkSumRecv = getin<bool>("checksum_recv_fields", false); 120 121 logMemory = getin<bool>("log_memory", false); 119 122 120 123 globalComm=MPI_COMM_WORLD ; … … 157 160 void CXios::clientFinalize(void) 158 161 { 159 CMemChecker::logMem("CXios::clientFinalize" );162 CMemChecker::logMem("CXios::clientFinalize", true); 160 163 161 164 CClient::finalize() ; -
XIOS3/trunk/src/cxios.hpp
r2407 r2420 68 68 static bool checkSumRecv; //!< For debugging, compute a checksum of fields received by the model through the XIOS client 69 69 70 static bool logMemory; //!< Activate memory monitoring for all XIOS process 71 70 72 static const string defaultPoolId ; 71 73 static const string defaultServerId ; -
XIOS3/trunk/src/mem_checker.cpp
r2419 r2420 1 1 #include "mem_checker.hpp" 2 #include "cxios.hpp" 2 3 #include "mpi.hpp" 3 4 #include <string> … … 5 6 #include <iostream> 6 7 #include <sstream> 7 #include <fstream>8 8 9 9 #include <fcntl.h> … … 20 20 double CMemChecker::vsize_init_=0; 21 21 double CMemChecker::time_init_=0; 22 22 std::ofstream CMemChecker::fout_; 23 int CMemChecker::flush_counter_=1; 24 23 25 CMemChecker::CMemChecker(const std::string& name) : name_(name) 24 26 { … … 64 66 void CMemChecker::logMem( std::string id, bool finalizeLog ) 65 67 { 66 // function get_xios_mem_data() { 67 // return [ 68 // ... 69 // [ "2000-01-01 01:00:10.XXX", "XIOS close context def", 1000], 70 // [ "2000-01-01 01:00:11.XXX", "update timestep" , 1000], 71 // [ "2000-01-01 01:00:15.XXX", "send field" , 2000], 72 // ... 73 // ]; 74 // } 75 76 std::ofstream fout; 68 if ( !CXios::logMemory ) return ; 69 77 70 int rk = 0; 78 71 MPI_Comm_rank( MPI_COMM_WORLD, &rk ); … … 80 73 double mem = getMemRSS(); 81 74 if (!mem) { 82 fout.open( logName ); 83 fout << "time,event,memory" << std::endl; 84 } 85 else 86 { 87 fout.open( logName, std::ios_base::app ); 75 fout_.open( logName ); 76 fout_ << "time,event,memory" << std::endl; 88 77 } 89 78 79 fout_.precision(4); 90 80 // Time format : YYYY-MM-DD HH:MM:SS.XXX -> seconds * 1000. 91 fout << (MPI_Wtime()-time_init_)*1000.<< "," << id << "," << mem/1000000. << std::endl;81 fout_ << (MPI_Wtime()-time_init_) << "," << id << "," << mem/1000000. << std::endl; 92 82 93 fout.close(); 83 if ((MPI_Wtime()-time_init_)>flush_counter_*600.) 84 { 85 fout_.flush(); 86 flush_counter_++; 87 } 88 89 if (finalizeLog) 90 { 91 fout_.close(); 92 } 94 93 } 95 94 -
XIOS3/trunk/src/mem_checker.hpp
r2418 r2420 4 4 #include <string> 5 5 #include <map> 6 #include <fstream> 6 7 7 8 namespace xios … … 39 40 static double vsize_init_; 40 41 static double time_init_; 42 static std::ofstream fout_; 43 static int flush_counter_; 41 44 }; 42 45 } -
XIOS3/trunk/src/server.cpp
r2419 r2420 434 434 CXios::getMpiGarbageCollector().release() ; // release unfree MPI ressources 435 435 436 CMemChecker::logMem( "CServer::finalize" );436 CMemChecker::logMem( "CServer::finalize", true ); 437 437 if (!is_MPI_Initialized) 438 438 {
Note: See TracChangeset
for help on using the changeset viewer.