|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
|
#include <StatWriter.h>
Public Types | |
| typedef std::vector< std::pair< std::string, unsigned int > > | losses_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 | |
| StatWriter (const std::string &fname, bool restart) | |
| void | write (PartBunch_t *beam, Vector_t< double, 3 > FDext[], const losses_t &losses=losses_t(), const double &azimuth=-1, const size_t npOutside=0) |
| Write statistical data. | |
| virtual void | write (const PartBunch_t *) |
| unsigned int | rewindToSpos (double maxSpos) |
| delete the last 'numberOfLines' lines of the statistics file | |
| 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 | fillHeader (const losses_t &losses=losses_t()) |
| void | writeDescription () |
| void | writeParameters () |
| void | writeColumns () |
| void | writeInfo () |
Private Attributes | |
| 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 24 of file StatWriter.h.
|
inherited |
Definition at line 50 of file SDDSWriter.h.
|
inherited |
Definition at line 47 of file SDDSWriter.h.
|
inherited |
Definition at line 41 of file SDDSWriter.h.
| typedef std::vector<std::pair<std::string, unsigned int> > StatWriter::losses_t |
Definition at line 26 of file StatWriter.h.
|
inherited |
Definition at line 44 of file SDDSWriter.h.
| StatWriter::StatWriter | ( | const std::string & | fname, |
| bool | restart ) |
Definition at line 28 of file StatWriter.cpp.
References StatBaseWriter::StatBaseWriter().
|
protectedinherited |
|
protectedinherited |
Definition at line 199 of file SDDSWriter.cpp.
References addParameter(), Util::getGitRevision(), OpalData::getInstance(), OPAL_PROJECT_NAME, and OPAL_PROJECT_VERSION.
Referenced by ElementPositionWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
inlineprotectedinherited |
Definition at line 142 of file SDDSWriter.h.
References desc_m.
Referenced by ElementPositionWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
inlineprotectedinherited |
Definition at line 155 of file SDDSWriter.h.
References info_m.
Referenced by ElementPositionWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
protectedinherited |
Definition at line 147 of file SDDSWriter.h.
References params_m, and paramValues_m.
Referenced by addDefaultParameters().
|
protectedinherited |
Definition at line 137 of file SDDSWriter.cpp.
References os_m.
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), LBalWriter::write(), MemoryProfiler::write(), and StatWriter::write().
|
inlineinherited |
Definition at line 138 of file SDDSWriter.h.
References fname_m.
Definition at line 31 of file StatWriter.cpp.
References SDDSWriter::addDefaultParameters(), SDDSWriter::addDescription(), SDDSWriter::addInfo(), SDDSWriter::columns_m, OPALTimer::Timer::date(), OpalData::getInputFn(), OpalData::getInstance(), SDDSWriter::hasColumns(), SDDSWriter::mode_m, and OPALTimer::Timer::time().
Referenced by write().
|
inherited |
Definition at line 120 of file SDDSWriter.cpp.
References fname_m, SDDS::SDDSParser::getValue(), and SDDS::SDDSParser::run().
|
inlineprotectedinherited |
Definition at line 171 of file SDDSWriter.h.
References columns_m.
Referenced by ElementPositionWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
protectedinherited |
Definition at line 128 of file SDDSWriter.cpp.
References fname_m, mode_m, os_m, and precision_m.
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), LBalWriter::write(), MemoryProfiler::write(), and StatWriter::write().
|
inherited |
Definition at line 76 of file SDDSWriter.cpp.
References fname_m, Util::getGitRevision(), SDDS::SDDSParser::getParameterValue(), OPAL_PROJECT_NAME, OPAL_PROJECT_VERSION, and SDDS::SDDSParser::run().
|
inherited |
delete the last 'numberOfLines' lines of the file 'fileName'
Definition at line 45 of file SDDSWriter.cpp.
References fname_m.
|
inlineinherited |
delete the last 'numberOfLines' lines of the statistics file
Definition at line 37 of file StatBaseWriter.h.
References SDDSWriter::fname_m, and Util::rewindLinesSDDS().
Definition at line 164 of file SDDSWriter.h.
References precision_m.
Referenced by MemoryProfiler::write().
|
inlinevirtual |
Reimplemented from SDDSWriter.
Definition at line 56 of file SDDSWriter.h.
| void StatWriter::write | ( | PartBunch_t * | beam, |
| Vector_t< double, 3 > | FDext[], | ||
| const losses_t & | losses = losses_t(), | ||
| const double & | azimuth = -1, | ||
| const size_t | npOutside = 0 ) |
Write statistical data.
Writes statistical beam data to proper output file. This is information such as RMS beam parameters etc.
Also gathers and writes load balancing data to load balance statistics file.
| beam | The beam. |
| FDext | The external E and B field for the head, reference and tail particles. The vector array has the following layout:
|
Write data to files. If this is the first write to the beam statistics file, write SDDS header information.
Definition at line 197 of file StatWriter.cpp.
References SDDSWriter::close(), SDDSWriter::columns_m, fillHeader(), PartBunch< PLayout, T, Dim >::get_DDx(), PartBunch< PLayout, T, Dim >::get_DDy(), PartBunch< PLayout, T, Dim >::get_debyeLength(), PartBunch< PLayout, T, Dim >::get_Dx(), PartBunch< PLayout, T, Dim >::get_Dy(), PartBunch< PLayout, T, Dim >::get_halo(), PartBunch< PLayout, T, Dim >::get_norm_emit(), PartBunch< PLayout, T, Dim >::get_plasmaParameter(), PartBunch< PLayout, T, Dim >::get_rmsDensity(), PartBunch< PLayout, T, Dim >::get_rprms(), PartBunch< PLayout, T, Dim >::get_sPos(), PartBunch< PLayout, T, Dim >::get_temperature(), PartBunch< PLayout, T, Dim >::getCharge(), PartBunch< PLayout, T, Dim >::getdE(), PartBunch< PLayout, T, Dim >::getdT(), OpalData::getInstance(), PartBunch< PLayout, T, Dim >::getLocalNum(), PartBunch< PLayout, T, Dim >::getParticleContainer(), PartBunch< PLayout, T, Dim >::getT(), PartBunch< PLayout, T, Dim >::getTotalNum(), SDDSWriter::open(), PartBunch< PLayout, T, Dim >::P, PartBunch< PLayout, T, Dim >::R(), PartBunch< PLayout, T, Dim >::RefPartP_m, PartBunch< PLayout, T, Dim >::RefPartR_m, Units::s2ns, SDDSWriter::writeHeader(), and SDDSWriter::writeRow().
|
privateinherited |
Definition at line 180 of file SDDSWriter.cpp.
References columns_m, indent_m, and os_m.
Referenced by writeHeader().
|
privateinherited |
Definition at line 158 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 143 of file SDDSWriter.cpp.
References mode_m, writeColumns(), writeDescription(), writeInfo(), and writeParameters().
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), LBalWriter::write(), MemoryProfiler::write(), and StatWriter::write().
|
privateinherited |
Definition at line 184 of file SDDSWriter.cpp.
References indent_m, info_m, os_m, and paramValues_m.
Referenced by writeHeader().
|
privateinherited |
Definition at line 166 of file SDDSWriter.cpp.
References indent_m, os_m, and params_m.
Referenced by writeHeader().
|
inlineprotectedinherited |
Definition at line 159 of file SDDSWriter.h.
References columns_m, and os_m.
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), LBalWriter::write(), MemoryProfiler::write(), and StatWriter::write().
|
protectedinherited |
Definition at line 110 of file SDDSWriter.h.
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), ElementPositionWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), StatWriter::fillHeader(), hasColumns(), MemoryProfiler::header(), LBalWriter::write(), MemoryProfiler::write(), StatWriter::write(), writeColumns(), and writeRow().
|
privateinherited |
Definition at line 130 of file SDDSWriter.h.
Referenced by addDescription(), and writeDescription().
|
protectedinherited |
Definition at line 100 of file SDDSWriter.h.
Referenced by exists(), getLastValue(), open(), replaceVersionString(), rewindLines(), StatBaseWriter::rewindToSpos(), and SDDSWriter().
|
privateinherited |
Definition at line 128 of file SDDSWriter.h.
Referenced by SDDSWriter(), writeColumns(), writeDescription(), writeInfo(), and writeParameters().
|
privateinherited |
Definition at line 133 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 108 of file SDDSWriter.h.
Referenced by LBalWriter::fillHeader(), StatWriter::fillHeader(), MemoryProfiler::header(), open(), SDDSWriter(), and writeHeader().
|
privateinherited |
Definition at line 126 of file SDDSWriter.h.
Referenced by close(), open(), writeColumns(), writeDescription(), writeInfo(), writeParameters(), and writeRow().
|
privateinherited |
Definition at line 131 of file SDDSWriter.h.
Referenced by addParameter(), and writeParameters().
|
privateinherited |
Definition at line 132 of file SDDSWriter.h.
Referenced by addParameter(), and writeInfo().
|
staticconstexprprivateinherited |
Definition at line 135 of file SDDSWriter.h.
Referenced by open(), and toString().