Skip to content

Commit

Permalink
Merge pull request #346 from ls1mardyn/fix/EnergyRAPL-empty-TSV
Browse files Browse the repository at this point in the history
Fixed creation of ".tsv" file without output
  • Loading branch information
FG-TUM authored Nov 6, 2024
2 parents be0b01b + 89a04db commit 87024df
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/plugins/EnergyRAPL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ void EnergyRAPL::init(ParticleContainer* particleContainer, DomainDecompBase* do
MPI_Get_processor_name(_processorName, &processorNameLength);
MPI_Comm_rank(MPI_COMM_WORLD, &_thisRank);
#endif
std::ostringstream outputFilename;
outputFilename << _outputprefix << ".tsv";
std::ofstream outputFile(outputFilename.str().c_str());
outputFile << "milliseconds\tsimstep\tjoules" << std::endl;
if (!_outputprefix.empty()) {
std::ostringstream outputFilename;
outputFilename << _outputprefix << ".tsv";
std::ofstream outputFile(outputFilename.str().c_str());
outputFile << "milliseconds\tsimstep\tjoules" << std::endl;
}
// For each package...
const int numberOfPackages = getNumberOfPackages();
for (int packageIdx = 0; packageIdx < numberOfPackages; packageIdx++) {
Expand Down

0 comments on commit 87024df

Please sign in to comment.