Skip to content

Commit

Permalink
Replace tabs in log output with whitespaces for better readability
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Niethammer <[email protected]>
  • Loading branch information
cniethammer committed Dec 23, 2024
1 parent f93bb05 commit aef0537
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/io/MPICheckpointWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,34 @@ void MPICheckpointWriter::readXML(XMLfileUnits& xmlconfig)
{
_writeFrequency = 1;
xmlconfig.getNodeValue("writefrequency", _writeFrequency);
Log::global_log->info() << "[MPICheckpointWriter]\twrite frequency: " << _writeFrequency << std::endl;
Log::global_log->info() << "[MPICheckpointWriter] write frequency: " << _writeFrequency << std::endl;

_outputPrefix = "mardyn";
xmlconfig.getNodeValue("outputprefix", _outputPrefix);
Log::global_log->info() << "[MPICheckpointWriter]\toutput prefix: " << _outputPrefix << std::endl;
Log::global_log->info() << "[MPICheckpointWriter] output prefix: " << _outputPrefix << std::endl;

_incremental = false;
xmlconfig.getNodeValue("incremental", _incremental);
if(_incremental) {
Log::global_log->info() << "[MPICheckpointWriter]\tusing incremental numbers in file names" << std::endl;
Log::global_log->info() << "[MPICheckpointWriter] using incremental numbers in file names" << std::endl;
}

_appendTimestamp = false;
xmlconfig.getNodeValue("appendTimestamp", _appendTimestamp);
if(_appendTimestamp) {
Log::global_log->info() << "[MPICheckpointWriter]\tappend timestamp to file names" << std::endl;
Log::global_log->info() << "[MPICheckpointWriter] appending timestamps to file names" << std::endl;
}

_datarep = ""; // -> NULL
//_datarep = "external32"; // "native", "internal", "external32"
xmlconfig.getNodeValue("datarep", _datarep);
if(!_datarep.empty())
Log::global_log->info() << "[MPICheckpointWriter]\tdata representation: " << _datarep << std::endl;
Log::global_log->info() << "[MPICheckpointWriter] data representation: " << _datarep << std::endl;

_measureTime = false;
xmlconfig.getNodeValue("measureTime", _measureTime);
if(_measureTime) {
Log::global_log->info() << "[MPICheckpointWriter]\texecution wall time will be measured" << std::endl;
Log::global_log->info() << "[MPICheckpointWriter] execution wall time will be measured" << std::endl;
}

if(xmlconfig.changecurrentnode("mpi_info")) {
Expand All @@ -93,9 +93,9 @@ void MPICheckpointWriter::readXML(XMLfileUnits& xmlconfig)
if(_particlesbuffersize)
{
#ifdef ENABLE_MPI
Log::global_log->info() << "[MPICheckpointWriter]\tparticles buffer size: " << _particlesbuffersize << std::endl;
Log::global_log->info() << "[MPICheckpointWriter] particles buffer size: " << _particlesbuffersize << std::endl;
#else
Log::global_log->info() << "[MPICheckpointWriter]\tparticles buffer size (" << _particlesbuffersize << ") only used in parallel/MPI version" << std::endl;
Log::global_log->info() << "[MPICheckpointWriter] particles buffer size (" << _particlesbuffersize << ") only used in parallel/MPI version" << std::endl;
#endif
}
}
Expand Down Expand Up @@ -155,14 +155,14 @@ void MPICheckpointWriter::endStep(ParticleContainer *particleContainer, DomainDe
filenamestream << ".MPIrestart.dat";

std::string filename = filenamestream.str();
Log::global_log->info() << "[MPICheckpointWriter]\tfilename: " << filename << std::endl;
Log::global_log->info() << "[MPICheckpointWriter] filename: " << filename << std::endl;

unsigned long numParticles_global = domain->getglobalNumMolecules(true, particleContainer, domainDecomp);
unsigned long numParticles = particleContainer->getNumberOfParticles(); // local
unsigned long numbb{1ul};
#ifdef ENABLE_MPI
Log::global_log->info() << "[MPICheckpointWriter]\tnumber of particles: " << numParticles_global
<< "\t(*" << sizeof(ParticleData) << "=" << numParticles_global*sizeof(ParticleData) << " Bytes in memory)"
Log::global_log->info() << "[MPICheckpointWriter] number of particles: " << numParticles_global
<< " (*" << sizeof(ParticleData) << "=" << numParticles_global*sizeof(ParticleData) << " Bytes in memory)"
<< std::endl;
//global_log->set_mpi_output_all()
int num_procs;
Expand Down Expand Up @@ -251,10 +251,10 @@ void MPICheckpointWriter::endStep(ParticleContainer *particleContainer, DomainDe
mpioffset+=sizeof(unsigned long);
MPI_CHECK( MPI_File_write_at(mpifh,mpioffset,&numParticles,1,MPI_UNSIGNED_LONG,&mpistat) );
mpioffset+=sizeof(unsigned long);
Log::global_log->debug() << "[MPICheckpointWriter](" << ownrank << ")\tBB " << ":\t"
Log::global_log->debug() << "[MPICheckpointWriter](" << ownrank << ") BB " << ": "
<< bbmin[0] << ", " << bbmin[1] << ", " << bbmin[2] << " - "
<< bbmax[0] << ", " << bbmax[1] << ", " << bbmax[2]
<< "\tstarting index=" << startidx << " numParticles=" << numParticles << std::endl;
<< " starting index=" << startidx << " numParticles=" << numParticles << std::endl;
//
MPI_Datatype mpidtParticleM, mpidtParticleD;
ParticleData::getMPIType(mpidtParticleM);
Expand All @@ -276,7 +276,7 @@ void MPICheckpointWriter::endStep(ParticleContainer *particleContainer, DomainDe
Log::global_log->debug()
<< "[MPICheckpointWriter]("
<< ownrank
<< ")\twriting molecule data for "
<< ") writing molecule data for "
<< numParticles
<< " particles of size "
<< mpidtParticleDts
Expand Down Expand Up @@ -354,20 +354,20 @@ void MPICheckpointWriter::endStep(ParticleContainer *particleContainer, DomainDe
// global_simulation->timers()->stop("MPI_CHECKPOINT_WRITER_INPUT");
// double mpimeasuredtime=global_simulation->timers()->getTime("MPI_CHECKPOINT_WRITER_INPUT");
if(ownrank==0) {
Log::global_log->info() << "[MPICheckpointWriter]\tmeasured time: " << mpimeasuredtime << " sec (par., "
Log::global_log->info() << "[MPICheckpointWriter] measured time: " << mpimeasuredtime << " sec (par., "
<< num_procs << " proc.; " << numParticles_global << "*" << mpidtParticleDts
<< "=" << numParticles_global * mpidtParticleDts << " Bytes)" << std::endl;
}
}
#else
Log::global_log->info() << "[MPICheckpointWriter]\tnumber of particles: " << numParticles_global
<< "\t(*" << 2*sizeof(unsigned long)+13*sizeof(double) << "=" << numParticles_global*(2*sizeof(unsigned long)+13*sizeof(double)) << " Bytes in memory)"
Log::global_log->info() << "[MPICheckpointWriter] number of particles: " << numParticles_global
<< " (*" << 2*sizeof(unsigned long)+13*sizeof(double) << "=" << numParticles_global*(2*sizeof(unsigned long)+13*sizeof(double)) << " Bytes in memory)"
<< std::endl;
unsigned long gap=7+3+sizeof(unsigned long)+(6*sizeof(double)+2*sizeof(unsigned long));
unsigned int i;
unsigned int offset=0;
if (!_datarep.empty()) {
Log::global_log->warning() << "[MPICheckpointWriter]\tsetting data representation (" << _datarep
Log::global_log->warning() << "[MPICheckpointWriter] setting data representation (" << _datarep
<< ") is not supported (yet) in sequential version" << std::endl;
}
// should use Timer instead
Expand Down Expand Up @@ -433,7 +433,7 @@ void MPICheckpointWriter::endStep(ParticleContainer *particleContainer, DomainDe
double measuredtime=(double)(tod_end.tv_sec-tod_start.tv_sec)+(double)(tod_end.tv_usec-tod_start.tv_usec)/1.E6;
// global_simulation->timers()->stop("MPI_CHECKPOINT_WRITER_INPUT");
// double measuredtime=global_simulation->timers()->getTime("MPI_CHECKPOINT_WRITER_INPUT");
Log::global_log->info() << "[MPICheckpointWriter]\tmeasured time: " << measuredtime << " sec (seq.)" << std::endl;
Log::global_log->info() << "[MPICheckpointWriter] measured time: " << measuredtime << " sec (seq.)" << std::endl;
}
#endif
}
Expand Down

0 comments on commit aef0537

Please sign in to comment.