ESPResSo 3.2.0-167-g2c9ead1-git
Extensible Simulation Package for Soft Matter Research
Functions | Variables
debug.c File Reference

Implements the malloc replacements as described in debug.h. More...

#include <mpi.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "utils.h"
#include "communication.h"
#include "cells.h"
#include "grid.h"
#include "integrate.h"
Include dependency graph for debug.c:

Go to the source code of this file.

Functions

void * __realloc (void *old, unsigned int size, char *where, int line)
 memory allocation test routine
void * __malloc (unsigned int size, char *where, int line)
 memory allocation test routine
void __free (void *p, char *where, int line)
 memory allocation test routine
void core ()
 this functions kills the task with SIGSEGV
void check_particle_consistency ()
 this performs a lot of tests which will very likely detect corruptions of local_particles and the cell structure.
void check_particles ()
 check the consistency of the cells and particle_node.
void print_particle_positions ()
 Print all particle positions contained in cells::cells array.
void print_particle_forces ()
 Print all particle forces contained in cells::cells array.

Variables

int regular_exit = 0
 by setting this variable to 1, a regular exit is indicated.
static int core_done = 0
int check_id = ONEPART_DEBUG_ID
 Identity of the particle to check extensively if ONEPART_DEBUG is defined.

Detailed Description

Implements the malloc replacements as described in debug.h.

Definition in file debug.c.


Function Documentation

void __free ( void *  p,
char *  where,
int  line 
)

memory allocation test routine

Definition at line 79 of file debug.c.

References free, and this_node.

void* __malloc ( unsigned int  size,
char *  where,
int  line 
)

memory allocation test routine

Definition at line 68 of file debug.c.

References malloc, and this_node.

void* __realloc ( void *  old,
unsigned int  size,
char *  where,
int  line 
)

memory allocation test routine

Definition at line 54 of file debug.c.

References free, realloc, and this_node.

void check_particle_consistency ( )
void check_particles ( )

check the consistency of the cells and particle_node.

Called from mpi_bcast_event(CHECK_PARTICLES)

Definition at line 187 of file debug.c.

References box_l, CellPList::cell, CELL_TRACE, comm_cart, errexit(), free, ParticleProperties::identity, local_cells, local_particles, malloc, max_seen_particle, MPI_Bcast(), MPI_INT, CellPList::n, ParticleList::n, n_total_particles, Particle::p, ParticleList::part, particle_node, PERIODIC, skin, skin2, and this_node.

Referenced by mpi_bcast_event_slave().

void core ( )

this functions kills the task with SIGSEGV

Definition at line 87 of file debug.c.

References core_done, regular_exit, and this_node.

Referenced by errexit(), mpi_core(), and on_program_start().

void print_particle_forces ( )

Print all particle forces contained in cells::cells array.

Definition at line 314 of file debug.c.

References cells, ParticleForce::f, Particle::f, ParticleList::n, n_cells, ParticleList::part, and this_node.

void print_particle_positions ( )

Print all particle positions contained in cells::cells array.

Definition at line 295 of file debug.c.

References cells, ParticleList::n, n_cells, ParticlePosition::p, ParticleList::part, Particle::r, and this_node.


Variable Documentation

int check_id = ONEPART_DEBUG_ID
int core_done = 0 [static]

Definition at line 42 of file debug.c.

Referenced by core().

int regular_exit = 0

by setting this variable to 1, a regular exit is indicated.

In that case, no core dump is generated.

Definition at line 38 of file debug.c.

Referenced by core(), mpi_stop(), and mpi_stop_slave().