|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
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, size_t particleContainerIndex=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(), const std::string &species="") |
| 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 41 of file StatWriter.cpp.
|
protectedinherited |
|
protectedinherited |
Definition at line 190 of file SDDSWriter.cpp.
References SDDSWriter::addParameter(), Util::getGitRevision(), and OpalData::getInstance().
Referenced by ElementPositionWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), and MemoryProfiler::header().

|
inlineprotectedinherited |
Definition at line 141 of file SDDSWriter.h.
References SDDSWriter::desc_m.
Referenced by ElementPositionWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), fillHeader(), and MemoryProfiler::header().
|
inlineprotectedinherited |
Definition at line 154 of file SDDSWriter.h.
References SDDSWriter::info_m.
Referenced by ElementPositionWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), fillHeader(), and MemoryProfiler::header().
|
protectedinherited |
Definition at line 146 of file SDDSWriter.h.
References SDDSWriter::params_m, and SDDSWriter::paramValues_m.
Referenced by SDDSWriter::addDefaultParameters(), and fillHeader().
|
protectedinherited |
Definition at line 131 of file SDDSWriter.cpp.
References SDDSWriter::os_m.
Referenced by MonitorStatisticsWriter::addRow(), ElementPositionWriter::addRow(), LBalWriter::write(), MemoryProfiler::write(), and write().
|
inlineinherited |
Definition at line 139 of file SDDSWriter.h.
References SDDSWriter::fname_m.
|
private |
Definition at line 43 of file StatWriter.cpp.
References SDDSColumnSet::addColumn(), SDDSWriter::addDescription(), SDDSWriter::addInfo(), SDDSWriter::addParameter(), SDDSWriter::columns_m, OPALTimer::Timer::date(), Util::getGitRevision(), OpalData::getInputFn(), OpalData::getInstance(), SDDSWriter::hasColumns(), SDDSWriter::mode_m, and OPALTimer::Timer::time().
Referenced by write().

|
inherited |
Definition at line 115 of file SDDSWriter.cpp.
References SDDSWriter::fname_m, SDDS::SDDSParser::getValue(), and SDDS::SDDSParser::run().

|
inlineprotectedinherited |
Definition at line 168 of file SDDSWriter.h.
References SDDSWriter::columns_m, and SDDSColumnSet::hasColumns().
Referenced by ElementPositionWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), fillHeader(), and MemoryProfiler::header().

|
protectedinherited |
Definition at line 123 of file SDDSWriter.cpp.
References SDDSWriter::fname_m, SDDSWriter::mode_m, SDDSWriter::os_m, and SDDSWriter::precision_m.
Referenced by MonitorStatisticsWriter::addRow(), ElementPositionWriter::addRow(), LBalWriter::write(), MemoryProfiler::write(), and write().
|
inherited |
Definition at line 74 of file SDDSWriter.cpp.
References SDDSWriter::fname_m, Util::getGitRevision(), SDDS::SDDSParser::getParameterValue(), and SDDS::SDDSParser::run().

|
inherited |
delete the last 'numberOfLines' lines of the file 'fileName'
Definition at line 45 of file SDDSWriter.cpp.
References SDDSWriter::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 161 of file SDDSWriter.h.
References SDDSWriter::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, |
||
| size_t | particleContainerIndex = 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:
|
Definition at line 219 of file StatWriter.cpp.
References SDDSColumnSet::addColumnValue(), SDDSWriter::close(), SDDSWriter::columns_m, fillHeader(), PartBunch< T, Dim >::get_halo(), PartBunch< T, Dim >::get_rmsDensity(), PartBunch< T, Dim >::getCurrentNBins(), PartBunch< T, Dim >::getdT(), OpalData::getInstance(), PartBunch< T, Dim >::getParticleName(), PartBunch< T, Dim >::getT(), SDDSWriter::open(), Units::s2ns, SDDSWriter::writeHeader(), and SDDSWriter::writeRow().

|
privateinherited |
Definition at line 173 of file SDDSWriter.cpp.
References SDDSWriter::columns_m, SDDSWriter::indent_m, SDDSWriter::os_m, and SDDSColumnSet::writeHeader().
Referenced by SDDSWriter::writeHeader().

|
privateinherited |
Definition at line 151 of file SDDSWriter.cpp.
References SDDSWriter::desc_m, SDDSWriter::indent_m, and SDDSWriter::os_m.
Referenced by SDDSWriter::writeHeader().
|
protectedinherited |
Write SDDS header.
Writes the appropriate SDDS format header information, The SDDS tools can be used for plotting data.
Definition at line 137 of file SDDSWriter.cpp.
References SDDSWriter::mode_m, SDDSWriter::writeColumns(), SDDSWriter::writeDescription(), SDDSWriter::writeInfo(), and SDDSWriter::writeParameters().
Referenced by MonitorStatisticsWriter::addRow(), ElementPositionWriter::addRow(), LBalWriter::write(), MemoryProfiler::write(), and write().

|
privateinherited |
Definition at line 175 of file SDDSWriter.cpp.
References SDDSWriter::indent_m, SDDSWriter::info_m, SDDSWriter::os_m, and SDDSWriter::paramValues_m.
Referenced by SDDSWriter::writeHeader().
|
privateinherited |
Definition at line 159 of file SDDSWriter.cpp.
References SDDSWriter::indent_m, SDDSWriter::os_m, and SDDSWriter::params_m.
Referenced by SDDSWriter::writeHeader().
|
inlineprotectedinherited |
Definition at line 158 of file SDDSWriter.h.
References SDDSWriter::columns_m, SDDSWriter::os_m, and SDDSColumnSet::writeRow().
Referenced by MonitorStatisticsWriter::addRow(), ElementPositionWriter::addRow(), LBalWriter::write(), MemoryProfiler::write(), and write().

|
protectedinherited |
Definition at line 111 of file SDDSWriter.h.
Referenced by MonitorStatisticsWriter::addRow(), ElementPositionWriter::addRow(), ElementPositionWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), fillHeader(), SDDSWriter::hasColumns(), MemoryProfiler::header(), LBalWriter::write(), MemoryProfiler::write(), write(), SDDSWriter::writeColumns(), and SDDSWriter::writeRow().
|
privateinherited |
Definition at line 131 of file SDDSWriter.h.
Referenced by SDDSWriter::addDescription(), and SDDSWriter::writeDescription().
|
protectedinherited |
Definition at line 101 of file SDDSWriter.h.
Referenced by SDDSWriter::exists(), SDDSWriter::getLastValue(), SDDSWriter::open(), SDDSWriter::replaceVersionString(), SDDSWriter::rewindLines(), StatBaseWriter::rewindToSpos(), and SDDSWriter::SDDSWriter().
|
privateinherited |
Definition at line 129 of file SDDSWriter.h.
Referenced by SDDSWriter::writeColumns(), SDDSWriter::writeDescription(), SDDSWriter::writeInfo(), and SDDSWriter::writeParameters().
|
privateinherited |
Definition at line 134 of file SDDSWriter.h.
Referenced by SDDSWriter::addInfo(), and SDDSWriter::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 109 of file SDDSWriter.h.
Referenced by LBalWriter::fillHeader(), fillHeader(), MemoryProfiler::header(), SDDSWriter::open(), SDDSWriter::SDDSWriter(), and SDDSWriter::writeHeader().
|
privateinherited |
Definition at line 127 of file SDDSWriter.h.
Referenced by SDDSWriter::close(), SDDSWriter::open(), SDDSWriter::writeColumns(), SDDSWriter::writeDescription(), SDDSWriter::writeInfo(), SDDSWriter::writeParameters(), and SDDSWriter::writeRow().
|
privateinherited |
Definition at line 132 of file SDDSWriter.h.
Referenced by SDDSWriter::addParameter(), and SDDSWriter::writeParameters().
|
privateinherited |
Definition at line 133 of file SDDSWriter.h.
Referenced by SDDSWriter::addParameter(), and SDDSWriter::writeInfo().
|
staticconstexprprivateinherited |
Definition at line 136 of file SDDSWriter.h.
Referenced by SDDSWriter::open(), and SDDSWriter::toString().