Skip to content
Permalink
Browse files

Remove unused debug functions

  • Loading branch information...
jngrad committed Sep 10, 2019
1 parent 8ede1c7 commit 0bbe9ca6fa61f38b32e47ac922f53c03fef40f4b
Showing with 0 additions and 84 deletions.
  1. +0 −1 src/core/accumulators/Correlator.cpp
  2. +0 −66 src/core/debug.cpp
  3. +0 −13 src/core/debug.hpp
  4. +0 −4 src/core/rattle.cpp
@@ -511,7 +511,6 @@ int Correlator::finalize() {
// Lets find out how far we have to go back in the hierarchy to make space
// for the new value
while (highest_level_to_compress > -1) {
// printf("test level %d for compression, n_vals=%d ... ",i,n_vals[i]);
if (n_vals[i] % 2) {
if (i < (hierarchy_depth - 1) && n_vals[i] > m_tau_lin) {
highest_level_to_compress += 1;
@@ -141,72 +141,6 @@ void check_particle_consistency() {
}
}

void check_particles() {
int n, c;
int cell_part_cnt = 0, local_part_cnt = 0;
int cell_err_cnt = 0;
double const skin2 = (skin != -1) ? skin / 2 : 0;

/* checks: part_id, part_pos, local_particles id */
for (c = 0; c < local_cells.n; c++) {
auto const cell = local_cells.cell[c];
cell_part_cnt += cell->n;
for (int n = 0; n < cell->n; n++) {
auto const &p = cell->part[n];
if (p.p.identity < 0 || p.p.identity > max_seen_particle) {
fprintf(
stderr,
"%d: check_particles: ERROR: Cell %d Part %d has corrupted id=%d\n",
this_node, c, n, p.p.identity);
errexit();
}

for (int dir = 0; dir < 3; dir++) {
if (box_geo.periodic(dir) &&
(p.r.p[dir] < -skin2 ||
p.r.p[dir] > box_geo.length()[dir] + skin2)) {
fprintf(stderr,
"%d: check_particles: ERROR: illegal pos[%d]=%f of "
"part %d id=%d in cell %d\n",
this_node, dir, p.r.p[dir], n, p.p.identity, c);
errexit();
}
}
if (local_particles[p.p.identity] != &p) {
fprintf(stderr,
"%d: check_particles: ERROR: address mismatch for part "
"id %d: local: %p cell: %p in cell %d\n",
this_node, p.p.identity,
static_cast<void *>(local_particles[p.p.identity]),
static_cast<void const *>(&p), c);
errexit();
}
}
}

/* checks: local particle id */
for (n = 0; n <= max_seen_particle; n++) {
if (local_particles[n] != nullptr) {
local_part_cnt++;
if (local_particles[n]->p.identity != n) {
fprintf(stderr,
"%d: check_particles: ERROR: local_particles part %d "
"has corrupted id %d\n",
this_node, n, local_particles[n]->p.identity);
errexit();
}
}
}

/* EXIT on severe errors */
if (cell_err_cnt > 0) {
fprintf(stderr,
"%d: check_particles: %d ERRORS detected in cell structure!\n",
this_node, cell_err_cnt);
errexit();
}
}

/**
* @brief Check if particles are in correct cells.
*
@@ -22,10 +22,6 @@
* This file controls debug facilities.
*
* Implementation in debug.cpp.
*
* For every define there exists a macro that can be used to encapsulate
* short lines (like printf("...",...);) of code that should be executed
* iff the respective *_DEBUG macro is defined.
*/

#include "config.hpp"
@@ -35,15 +31,6 @@
*/
void check_particle_consistency();

/** check the consistency of the cells and particle_node.
*/
void check_particles();

void check_particle_sorting();

/** Print all particle positions contained in \ref cells::cells array. */
void print_particle_positions();
/** Print all particle forces contained in \ref cells::cells array. */
void print_particle_forces();

extern int this_node;
@@ -76,10 +76,6 @@ void apply_vel_corr(const ParticleRange &particles);
void revert_force(const ParticleRange &particles,
const ParticleRange &ghost_particles);

/**For debugging purpose--prints the bond lengths between particles that have
rigid_bonds*/
void print_bond_len();

/*@}*/

/*Initialize old positions (particle positions at previous time step)

0 comments on commit 0bbe9ca

Please sign in to comment.
You can’t perform that action at this time.