Adjusted preprocessor debug stuff

This commit is contained in:
2025-07-09 14:04:30 +02:00
parent 532bdf7979
commit 375ab23008
10 changed files with 26 additions and 26 deletions
+12 -12
View File
@@ -51,7 +51,7 @@ void SimulationOutput::writeSimulationData(
int cpu_sync,
std::map<std::string, std::shared_ptr<species::TrackedSpecie>>& species) {
if (MpiCommunication::mpi_rank == 0) {
#ifdef debug_level2
#if defined(debug_level2) || defined(debug_level3)
DEBUG_LEVEL_2("Write density field data.");
#endif
for (auto& task : tasks_density_fields_) {
@@ -61,7 +61,7 @@ void SimulationOutput::writeSimulationData(
specie_path, cpu_sync, task.overwrite_last);
}
}
#ifdef debug_level2
#if defined(debug_level2) || defined(debug_level3)
DEBUG_LEVEL_2("Write current collector data.");
#endif
for (auto& task : tasks_current_collector_) {
@@ -71,7 +71,7 @@ void SimulationOutput::writeSimulationData(
specie_path, cpu_sync, task.overwrite_last);
}
}
#ifdef debug_level2
#if defined(debug_level2) || defined(debug_level3)
DEBUG_LEVEL_2("Write deletion logger data.");
#endif
for (auto& task : tasks_deletion_logger_) {
@@ -94,23 +94,23 @@ void SimulationOutput::writeSimulationData(DynamicDensityField* density_field,
}
std::string path = species_path + "/DensityField/SimulationData/" + sync_path;
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Write spectrum.");
#endif
writeSpectrum(density_field, path);
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Write density.");
#endif
writeDensity(density_field, path);
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Write time in bin.");
#endif
writeTimeInBin(density_field, path);
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Write deleted particles.");
#endif
writeDeletedParticles(density_field, path);
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Write physical time.");
#endif
writePhysicalTime(density_field, path);
@@ -126,15 +126,15 @@ void SimulationOutput::writeSimulationData(CurrentCollector* current_collector,
}
std::string path =
species_path + "/CurrentCollector/SimulationData/" + sync_path;
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Write current crossings.");
#endif
writeCurrentCrossings(current_collector, path);
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Write current.");
#endif
writeCurrent(current_collector, path);
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Write physical time.");
#endif
writePhysicalTime(current_collector, path);
@@ -149,7 +149,7 @@ void SimulationOutput::writeSimulationData(DeletionLogger* logger,
sync_path = "LastSyncPeriod";
}
std::string path = species_path + "/DeletionLogger/" + sync_path;
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Write number of deletions.");
#endif
writeNumDeletions(logger, path);
+1 -1
View File
@@ -13,7 +13,7 @@ ChargeExchange::ChargeExchange(std::function<double(double)> cross_section,
InteractionOutput ChargeExchange::performInteraction(
particle::Particle& particle,
RandomNumbers* generator) {
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Perform charge exchange.");
#endif
+1 -1
View File
@@ -18,7 +18,7 @@ ClusterFormation::ClusterFormation(
InteractionOutput ClusterFormation::performInteraction(
particle::Particle& particle,
RandomNumbers* generator) {
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Perform cluster formation.");
#endif
const auto x_impact = particle.position();
+1 -1
View File
@@ -18,7 +18,7 @@ ElasticScattering::ElasticScattering(
InteractionOutput ElasticScattering::performInteraction(
particle::Particle& particle,
RandomNumbers* generator) {
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Perform elastic scattering.");
#endif
// get the information of the incident particle
+1 -1
View File
@@ -18,7 +18,7 @@ Excitation::Excitation(std::function<double(double)> cross_section,
InteractionOutput Excitation::performInteraction(particle::Particle& particle,
RandomNumbers* generator) {
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Perform excitation.");
#endif
const blitz::TinyVector<double, 3> v_impact =
+1 -1
View File
@@ -10,7 +10,7 @@ FreeMovement::FreeMovement()
InteractionOutput FreeMovement::performInteraction(particle::Particle& particle,
RandomNumbers* generator) {
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Perform free movement.");
#endif
// do nothing
+1 -1
View File
@@ -29,7 +29,7 @@ ElectronIonization::ElectronIonization(
InteractionOutput ElectronIonization::performInteraction(
particle::Particle& particle,
RandomNumbers* generator) {
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Perform ionization.");
#endif
+1 -1
View File
@@ -16,7 +16,7 @@ Recombination::Recombination(std::function<double(double)> cross_section,
InteractionOutput Recombination::performInteraction(
particle::Particle& particle,
RandomNumbers* generator) {
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Perform recombination.");
#endif
+1 -1
View File
@@ -45,7 +45,7 @@ std::vector<particle::Particle> Injector::rollNewParticles(
// particles are assumed to be created by a decay process
// therefore the resulting particles all start out at the same position
CylinderCoordinate position = position_distribution_->rollPosition(engine);
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Injected z position: " +
std::to_string(position.cylinderEntries()(2)));
#endif
+6 -6
View File
@@ -72,7 +72,7 @@ void Simulation::init(Parameter& parameter) {
DEBUG_LEVEL_0("Init cpu synchronizer.");
#endif
cpu_synchronizer_ = std::make_shared<CpuSynchronizer>();
#ifdef debug_level3
#if defined(debug_level3)
DEBUG_LEVEL_3("Init done.");
#endif
}
@@ -137,7 +137,7 @@ void Simulation::start() {
std::to_string(leftover_events));
processEvents(evenst_of_cycle);
#ifdef debug_level1
#if defined(debug_level1) || defined(debug_level2) || defined(debug_level3)
DEBUG_LEVEL_1("Leftover events: " + std::to_string(leftover_events));
#endif
leftover_events -= evenst_of_cycle;
@@ -171,13 +171,13 @@ void Simulation::processEvents(int events) {
particle_queue.reserve(100);
int current_event = 0;
while ((current_event < events) || (!particle_queue.empty())) {
#ifdef debug_level2
#if defined(debug_level2) || defined(debug_level3)
DEBUG_LEVEL_2("Current event: " + std::to_string(current_event));
#endif
// if the particle queue is empty a new beta decay event is started
if (particle_queue.empty()) {
current_event += 1;
#ifdef debug_level2
#if defined(debug_level2) || defined(debug_level3)
DEBUG_LEVEL_2("Inject particles to queue.");
#endif
SimulationTimer::eventStartPoint(std::string("ParticleInjection"));
@@ -185,14 +185,14 @@ void Simulation::processEvents(int events) {
std::vector<particle::Particle> new_particles =
determineInjectedParticles(random_.get());
SimulationTimer::eventStopPoint(std::string("ParticleInjection"));
#ifdef debug_level2
#if defined(debug_level2) || defined(debug_level3)
DEBUG_LEVEL_2("Injected particles to queue.");
#endif
particle_queue.insert(particle_queue.end(), new_particles.begin(),
new_particles.end());
}
#ifdef debug_level2
#if defined(debug_level2) || defined(debug_level3)
DEBUG_LEVEL_2("Particles in queue: " + std::to_string(particle_queue.size()));
#endif
// choose a random particle from the particle queue to be processed