|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
#include <MemoryProfiler.h>
Public Types | |
| enum | VirtualMemory { VMPEAK = 0 , VMSIZE , VMHWM , VMRSS , VMDATA , VMSTK , VMEXE , VMLCK , VMPIN , VMLIB , VMPTE , VMPMD , VMSWAP } |
| typedef std::vector< long double > | vm_t |
| typedef std::vector< std::string > | units_t |
| typedef std::pair< std::string, std::string > | desc_t |
| typedef std::tuple< std::string, std::string, std::string > | param_t |
| typedef std::pair< std::string, size_t > | data_t |
| typedef std::tuple< std::string, std::string, std::string, std::string > | cols_t |
Public Member Functions | |
| MemoryProfiler (const std::string &fname, bool restart) | |
| void | write (PartBunchBase< double, 3 > *beam) override |
| void | rewindLines (size_t numberOfLines) |
| delete the last 'numberOfLines' lines of the file 'fileName' | |
| void | replaceVersionString () |
| double | getLastValue (const std::string &column) |
| bool | exists () const |
Protected Member Functions | |
| void | addDescription (const std::string &text, const std::string &content) |
| template<typename T> | |
| void | addParameter (const std::string &name, const std::string &type, const std::string &desc, const T &value) |
| void | addDefaultParameters () |
| void | addColumn (const std::string &name, const std::string &type, const std::string &unit, const std::string &desc) |
| void | addInfo (const std::string &mode, const size_t &no_row_counts) |
| void | writeRow () |
| void | open () |
| void | close () |
| void | writeHeader () |
| Write SDDS header. | |
| template<typename T> | |
| std::string | toString (const T &val) |
| bool | hasColumns () const |
Protected Attributes | |
| std::string | fname_m |
| std::ios_base::openmode | mode_m |
| First write to the statistics output file. | |
| SDDSColumnSet | columns_m |
Private Member Functions | |
| void | header () |
| void | update () |
| void | compute (vm_t &vmMin, vm_t &vmMax, vm_t &vmAvg) |
| void | writeDescription () |
| void | writeParameters () |
| void | writeColumns () |
| void | writeInfo () |
Private Attributes | |
| std::map< std::string, int > | procinfo_m |
| vm_t | vmem_m |
| units_t | unit_m |
| std::ofstream | os_m |
| std::string | indent_m |
| desc_t | desc_m |
| std::queue< param_t > | params_m |
| std::queue< std::string > | paramValues_m |
| data_t | info_m |
Static Private Attributes | |
| static constexpr unsigned int | precision_m = 15 |
Definition at line 32 of file MemoryProfiler.h.
|
inherited |
Definition at line 57 of file SDDSWriter.h.
|
inherited |
Definition at line 51 of file SDDSWriter.h.
|
inherited |
Definition at line 43 of file SDDSWriter.h.
|
inherited |
Definition at line 48 of file SDDSWriter.h.
| typedef std::vector<std::string> MemoryProfiler::units_t |
Definition at line 40 of file MemoryProfiler.h.
| typedef std::vector<long double> MemoryProfiler::vm_t |
Definition at line 39 of file MemoryProfiler.h.
| Enumerator | |
|---|---|
| VMPEAK | |
| VMSIZE | |
| VMHWM | |
| VMRSS | |
| VMDATA | |
| VMSTK | |
| VMEXE | |
| VMLCK | |
| VMPIN | |
| VMLIB | |
| VMPTE | |
| VMPMD | |
| VMSWAP | |
Definition at line 44 of file MemoryProfiler.h.
| MemoryProfiler::MemoryProfiler | ( | const std::string & | fname, |
| bool | restart ) |
|
protectedinherited |
References name.
|
protectedinherited |
Definition at line 209 of file SDDSWriter.cpp.
References addParameter(), Util::getGitRevision(), OpalData::getInstance(), and IpplInfo::getNodes().
Referenced by ElementPositionWriter::fillHeader(), GridLBalWriter::fillHeader(), LBalWriter::fillHeader(), MemoryWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
inlineprotectedinherited |
Definition at line 159 of file SDDSWriter.h.
References desc_m.
Referenced by ElementPositionWriter::fillHeader(), GridLBalWriter::fillHeader(), LBalWriter::fillHeader(), MemoryWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
inlineprotectedinherited |
Definition at line 178 of file SDDSWriter.h.
References info_m.
Referenced by ElementPositionWriter::fillHeader(), GridLBalWriter::fillHeader(), LBalWriter::fillHeader(), MemoryWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
protectedinherited |
Definition at line 166 of file SDDSWriter.h.
References name, params_m, and paramValues_m.
Referenced by addDefaultParameters().
|
protectedinherited |
Definition at line 142 of file SDDSWriter.cpp.
References IpplInfo::myNode(), and os_m.
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), GridLBalWriter::write(), LBalWriter::write(), MemoryProfiler::write(), MemoryWriter::write(), MultiBunchDump::write(), and StatWriter::write().
Definition at line 174 of file MemoryProfiler.cpp.
References IpplInfo::getNodes(), new_reduce(), and vmem_m.
Referenced by write().
|
inlineinherited |
Definition at line 153 of file SDDSWriter.h.
References fname_m.
|
inherited |
Definition at line 123 of file SDDSWriter.cpp.
References fname_m, SDDS::SDDSParser::getValue(), and SDDS::SDDSParser::run().
|
inlineprotectedinherited |
Definition at line 200 of file SDDSWriter.h.
References columns_m.
Referenced by ElementPositionWriter::fillHeader(), GridLBalWriter::fillHeader(), LBalWriter::fillHeader(), MemoryWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
private |
Definition at line 61 of file MemoryProfiler.cpp.
References SDDSWriter::addDefaultParameters(), SDDSWriter::addDescription(), SDDSWriter::addInfo(), SDDSWriter::columns_m, OPALTimer::Timer::date(), OpalData::getInputFn(), OpalData::getInstance(), SDDSWriter::hasColumns(), SDDSWriter::mode_m, OPALTimer::Timer::time(), unit_m, VMHWM, VMPEAK, VMRSS, VMSIZE, and VMSTK.
Referenced by write().
|
protectedinherited |
Definition at line 132 of file SDDSWriter.cpp.
References fname_m, mode_m, IpplInfo::myNode(), os_m, and precision_m.
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), GridLBalWriter::write(), LBalWriter::write(), MemoryProfiler::write(), MemoryWriter::write(), MultiBunchDump::write(), and StatWriter::write().
|
inherited |
Definition at line 78 of file SDDSWriter.cpp.
References fname_m, Util::getGitRevision(), SDDS::SDDSParser::getParameterValue(), IpplInfo::myNode(), and SDDS::SDDSParser::run().
|
inherited |
delete the last 'numberOfLines' lines of the file 'fileName'
Definition at line 48 of file SDDSWriter.cpp.
References fname_m, and IpplInfo::myNode().
|
protectedinherited |
Definition at line 191 of file SDDSWriter.h.
References precision_m.
Referenced by GridLBalWriter::write(), and MemoryProfiler::write().
|
private |
Definition at line 142 of file MemoryProfiler.cpp.
References procinfo_m, unit_m, and vmem_m.
Referenced by write().
|
overridevirtual |
Reimplemented from SDDSWriter.
Definition at line 197 of file MemoryProfiler.cpp.
References SDDSWriter::close(), SDDSWriter::columns_m, compute(), PartBunchBase< T, Dim >::get_sPos(), PartBunchBase< T, Dim >::getT(), header(), IpplInfo::myNode(), SDDSWriter::open(), Units::s2ns, SDDSWriter::toString(), update(), vmem_m, VMHWM, VMPEAK, VMRSS, VMSIZE, VMSTK, SDDSWriter::writeHeader(), and SDDSWriter::writeRow().
|
privateinherited |
Definition at line 189 of file SDDSWriter.cpp.
References columns_m, indent_m, and os_m.
Referenced by writeHeader().
|
privateinherited |
Definition at line 165 of file SDDSWriter.cpp.
References desc_m, indent_m, and os_m.
Referenced by writeHeader().
|
protectedinherited |
Write SDDS header.
Writes the appropriate SDDS format header information, The SDDS tools can be used for plotting data.
Definition at line 149 of file SDDSWriter.cpp.
References mode_m, IpplInfo::myNode(), writeColumns(), writeDescription(), writeInfo(), and writeParameters().
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), GridLBalWriter::write(), LBalWriter::write(), MemoryProfiler::write(), MemoryWriter::write(), MultiBunchDump::write(), and StatWriter::write().
|
privateinherited |
Definition at line 194 of file SDDSWriter.cpp.
References indent_m, info_m, os_m, and paramValues_m.
Referenced by writeHeader().
|
privateinherited |
Definition at line 174 of file SDDSWriter.cpp.
References indent_m, os_m, and params_m.
Referenced by writeHeader().
|
inlineprotectedinherited |
Definition at line 185 of file SDDSWriter.h.
References columns_m, and os_m.
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), GridLBalWriter::write(), LBalWriter::write(), MemoryProfiler::write(), MemoryWriter::write(), MultiBunchDump::write(), and StatWriter::write().
|
protectedinherited |
Definition at line 122 of file SDDSWriter.h.
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), ElementPositionWriter::fillHeader(), GridLBalWriter::fillHeader(), LBalWriter::fillHeader(), MemoryWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), hasColumns(), MemoryProfiler::header(), GridLBalWriter::write(), LBalWriter::write(), MemoryProfiler::write(), MemoryWriter::write(), MultiBunchDump::write(), StatWriter::write(), writeColumns(), and writeRow().
|
privateinherited |
Definition at line 142 of file SDDSWriter.h.
Referenced by addDescription(), and writeDescription().
|
protectedinherited |
Definition at line 112 of file SDDSWriter.h.
Referenced by exists(), getLastValue(), open(), replaceVersionString(), rewindLines(), StatBaseWriter::rewindToSpos(), and SDDSWriter().
|
privateinherited |
Definition at line 140 of file SDDSWriter.h.
Referenced by SDDSWriter(), writeColumns(), writeDescription(), writeInfo(), and writeParameters().
|
privateinherited |
Definition at line 145 of file SDDSWriter.h.
Referenced by addInfo(), and writeInfo().
|
protectedinherited |
First write to the statistics output file.
Initially set to std::ios::out so that SDDS format header information is written to file during the first write call to the statistics output file. Variable is then reset to std::ios::app so that header information is only written once.
Definition at line 120 of file SDDSWriter.h.
Referenced by GridLBalWriter::fillHeader(), LBalWriter::fillHeader(), MemoryWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), MemoryProfiler::header(), open(), SDDSWriter(), and writeHeader().
|
privateinherited |
Definition at line 138 of file SDDSWriter.h.
Referenced by close(), open(), writeColumns(), writeDescription(), writeInfo(), writeParameters(), and writeRow().
|
privateinherited |
Definition at line 143 of file SDDSWriter.h.
Referenced by addParameter(), and writeParameters().
|
privateinherited |
Definition at line 144 of file SDDSWriter.h.
Referenced by addParameter(), and writeInfo().
|
staticconstexprprivateinherited |
Definition at line 148 of file SDDSWriter.h.
Referenced by open(), and toString().
|
private |
Definition at line 70 of file MemoryProfiler.h.
Referenced by MemoryProfiler(), and update().
|
private |
Definition at line 72 of file MemoryProfiler.h.
Referenced by header(), MemoryProfiler(), and update().
|
private |
Definition at line 71 of file MemoryProfiler.h.
Referenced by compute(), MemoryProfiler(), update(), and write().