ls1-MarDyn
ls1-MarDyn molecular dynamics code
FlopRateWriter.h
1/*
2 * FlopRateWriter.h
3 *
4 * Created on: 8 May 2017
5 * Author: tchipevn
6 */
7
8#ifndef SRC_IO_FLOPRATEWRITER_H_
9#define SRC_IO_FLOPRATEWRITER_H_
10
11#include "plugins/PluginBase.h"
12
13#include <fstream>
14
15class FlopCounter;
16
18public:
19 FlopRateWriter() : PluginBase(), _flopCounter(nullptr) {}
20 ~~FlopRateWriter() {}
21
27 void init(ParticleContainer *particleContainer,
28 DomainDecompBase *domainDecomp, Domain *domain);
29
30 void readXML(XMLfileUnits& /*xmlconfig*/);
31
33
34 void afterForces(
35 ParticleContainer* particleContainer, DomainDecompBase* domainDecomp,
36 unsigned long simstep);
37
44 void endStep(
45 ParticleContainer *particleContainer, DomainDecompBase *domainDecomp,
46 Domain *domain, unsigned long simstep
47 );
48
54 void finish(ParticleContainer *particleContainer,
55 DomainDecompBase *domainDecomp, Domain *domain);
56
58 return std::string("FlopRateWriter");
59 }
60 static PluginBase* createInstance() { return new FlopRateWriter(); }
61
62 void measureFLOPS(ParticleContainer* particleContainer, unsigned long simstep);
63
64private:
65 void setPrefix(double f_in, double& f_out, char& prefix) const;
66
67 FlopCounter * _flopCounter;
68 bool _writeToStdout, _writeToFile;
69 std::ofstream _fileStream;
70 unsigned long _writeFrequency;
71 std::string _outputPrefix;
72};
73
74#endif /* SRC_IO_FLOPRATEWRITER_H_ */
handle boundary region and multiple processes
Definition: DomainDecompBase.h:51
This class is used to read in the phasespace and to handle macroscopic values.
Definition: Domain.h:47
Definition: FlopCounter.h:60
Definition: FlopRateWriter.h:17
void endStep(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain, unsigned long simstep)
will be called in each time step
Definition: FlopRateWriter.cpp:71
void finish(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain)
will be called at the end of the simulation
Definition: FlopRateWriter.cpp:114
std::string getPluginName()
return the name of the plugin
Definition: FlopRateWriter.h:57
void afterForces(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep)
will be called after forces have been applied and exchanged
Definition: FlopRateWriter.cpp:65
void init(ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain)
will be called at the beginning of the simulation
Definition: FlopRateWriter.cpp:48
void readXML(XMLfileUnits &)
Method readXML will be called once for each plugin section in the input file.
Definition: FlopRateWriter.cpp:15
This Interface is used to get access to particles and pairs of particles.
Definition: ParticleContainer.h:69
The PluginBase class provides the interface for any kind of output/plugin classes - called "(output) ...
Definition: PluginBase.h:47
PluginBase()
Subclasses should use their constructur to pass parameters (e.g. filenames)
Definition: PluginBase.h:50
XML file with unit attributes abstraction.
Definition: xmlfileUnits.h:25
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
Definition: vtk-punstructured.h:270