Commit 177227c0 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Removed some debugging code.

parent ec6a47c9
......@@ -42,5 +42,5 @@ PointMassPotential:
position_y: 50.
position_z: 50.
mass: 1e10 # mass of external point mass in internal units
timestep_mult: 0.001 # controls time step
timestep_mult: 0.03 # controls time step
......@@ -96,10 +96,6 @@ grp1 = file.create_group("/PartType1")
#generate particle positions
radius = max_radius * (numpy.random.rand(numPart))**(1./3.)
#radius = numpy.zeros(3)
#radius[0] = 8.
#radius[1] = 10.
#radius[2] = 20.
print '---------------------'
print 'Radius: minimum = ',min(radius)
print 'Radius: maximum = ',max(radius)
......
......@@ -6,9 +6,6 @@ InternalUnitSystem:
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
#Scheduler:
# max_top_level_cells: 3
# Parameters governing the time integration
TimeIntegration:
time_begin: 0. # The starting time of the simulation (in internal units).
......
......@@ -60,8 +60,6 @@
#include "space.h"
#include "timers.h"
int counter = 0;
/* Global variables. */
int cell_next_tag = 0;
......@@ -913,7 +911,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
#endif
int rebuild = 0;
/* Un-skip the density tasks involved with this cell. */
for (struct link *l = c->density; l != NULL; l = l->next) {
struct task *t = l->t;
......@@ -1078,10 +1076,6 @@ void cell_drift(struct cell *c, const struct engine *e) {
const double dt = (ti_current - ti_old) * timeBase;
float dx_max = 0.f, dx2_max = 0.f, h_max = 0.f;
/* if (c->gcount > 0) */
/* message("dt=%e, ti_old=%lld ti_current=%lld", dt, c->ti_old,
* e->ti_current); */
/* Check that we are actually going to move forward. */
if (ti_current < ti_old) error("Attempt to drift to the past");
......@@ -1113,8 +1107,6 @@ void cell_drift(struct cell *c, const struct engine *e) {
if (gp->id_or_neg_offset == ICHECK) {
message("--- ti_current=%lld time=%e dt=%e---", e->ti_current, e->time,
dt);
counter++;
message("Drift counter: %d", counter);
printgParticle_single(gp);
}
#endif
......
......@@ -20,8 +20,6 @@
#ifndef SWIFT_CONST_H
#define SWIFT_CONST_H
#include <stdio.h>
/* SPH Viscosity constants. */
#define const_viscosity_alpha 0.8f
#define const_viscosity_alpha_min \
......@@ -63,7 +61,4 @@
#define ICHECK 0
#define num_files 4
extern FILE* files_timestep[num_files];
#endif /* SWIFT_CONST_H */
......@@ -71,8 +71,6 @@
#include "units.h"
#include "version.h"
FILE *files_timestep[num_files];
/* Particle cache size. */
#define CACHE_SIZE 512
......@@ -2608,7 +2606,7 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) {
struct clocks_time time1, time2;
clocks_gettime(&time1);
if (e->nodeID == 0) message("Computing initial gas densities.\n\n\n");
if (e->nodeID == 0) message("Computing initial gas densities.");
engine_rebuild(e);
......@@ -2704,15 +2702,6 @@ void engine_step(struct engine *e) {
fprintf(e->file_timesteps, " %6d %14e %14e %10zu %10zu %21.3f\n", e->step,
e->time, e->timeStep, e->updates, e->g_updates, e->wallclock_time);
fflush(e->file_timesteps);
/* for(int i=0; i<num_files; ++i) { */
/* fprintf(files_timestep[i], " %6d %14e %14e %10zu %10zu %21.3f\n",
* e->step, */
/* e->time, e->timeStep, e->updates, e->g_updates,
* e->wallclock_time); */
/* fflush(files_timestep[i]); */
/* } */
}
/* Do we need repartitioning ? */
......@@ -2738,12 +2727,11 @@ void engine_step(struct engine *e) {
engine_launch(e, e->nr_threads);
TIMER_TOC(timer_runners);
/* Collect the values of rebuild from all nodes. */
/* Collect the values of rebuild from all nodes. */
#ifdef WITH_MPI
int buff = 0;
if (MPI_Allreduce(&e->forcerebuild, &buff, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD) !=
MPI_SUCCESS)
if (MPI_Allreduce(&e->forcerebuild, &buff, 1, MPI_INT, MPI_MAX,
MPI_COMM_WORLD) != MPI_SUCCESS)
error("Failed to aggregate the rebuild flag across nodes.");
e->forcerebuild = buff;
#endif
......@@ -2767,7 +2755,7 @@ void engine_step(struct engine *e) {
}
message("snap=%d, rebuild=%d repart=%d", e->dump_snapshot, e->forcerebuild,
e->forcerepart);
e->forcerepart);
/* Write a snapshot ? */
if (e->dump_snapshot) {
......@@ -2782,8 +2770,6 @@ void engine_step(struct engine *e) {
/* Recover the (integer) end of the next time-step */
engine_collect_timestep(e);
TIMER_TOC2(timer_step);
clocks_gettime(&time2);
......@@ -2826,10 +2812,6 @@ void engine_drift_all(struct engine *e) {
message("drift all");
/* for(int i=0; i<num_files; ++i) { */
/* fprintf(files_timestep[i], "drift all\n"); */
/* } */
const ticks tic = getticks();
threadpool_map(&e->threadpool, runner_do_drift_mapper, e->s->cells_top,
e->s->nr_cells, sizeof(struct cell), 1, e);
......@@ -3047,10 +3029,6 @@ void engine_dump_snapshot(struct engine *e) {
if (e->verbose) message("writing snapshot at t=%e.", e->time);
/* for(int i=0; i<num_files; ++i) { */
/* fprintf(files_timestep[i], "dump\n"); */
/* } */
message("dump");
/* Dump... */
......@@ -3554,12 +3532,6 @@ void engine_init(struct engine *e, struct space *s,
free(buf);
#endif
for (int i = 0; i < num_files; ++i) {
char name[10];
sprintf(name, "dt_%d.txt", i);
files_timestep[i] = fopen(name, "w");
}
/* Wait for the runner threads to be in place. */
while (e->barrier_running || e->barrier_launch)
if (pthread_cond_wait(&e->barrier_cond, &e->barrier_mutex) != 0)
......@@ -3627,8 +3599,6 @@ void engine_compute_next_snapshot_time(struct engine *e) {
*/
void engine_clean(struct engine *e) {
for (int i = 0; i < num_files; ++i) fclose(files_timestep[i]);
free(e->snapshotUnits);
free(e->links);
scheduler_clean(&e->sched);
......
......@@ -52,9 +52,6 @@ __attribute__((always_inline)) INLINE static void kick_gpart(
gp->ti_kick = ti_end;
#endif
// message("dt= %e gp->ti_kick=%lld", dt, gp->ti_kick);
// fprintf(files_timestep[gp->id_or_neg_offset], "kick: dt=%e\n", dt);
/* Kick particles in momentum space */
gp->v_full[0] += gp->a_grav[0] * dt;
gp->v_full[1] += gp->a_grav[1] * dt;
......
......@@ -783,8 +783,6 @@ static void runner_do_unskip(struct cell *c, struct engine *e) {
if (forcerebuild) atomic_inc(&e->forcerebuild);
}
// message("c->depth=%d c->split=%d c->count=%.5d c->ti_end_min=%lld c->ti_end_max=%lld c->ti_beg_max=%lld ti_current=%lld", c->depth, c->split, c->count, c->ti_end_min, c->ti_end_max, c->ti_beg_max ,e->ti_current);
/* Recurse */
if (c->split) {
for (int k = 0; k < 8; k++) {
......
......@@ -477,10 +477,6 @@ void space_rebuild(struct space *s, int verbose) {
fflush(stdout);
#endif
/* for(int i=0; i<num_files; ++i) { */
/* fprintf(files_timestep[i], "REBUILD\n"); */
/* } */
/* Re-grid if necessary, or just re-set the cell data. */
space_regrid(s, verbose);
......@@ -1256,23 +1252,21 @@ void space_gparts_sort_mapper(void *map_data, int num_elements,
}
}
/* #ifdef SWIFT_DEBUG_CHECKS */
/* /\* Verify space_sort_struct. *\/ */
/* for (int k = i; k <= jj; k++) */
/* if (ind[k] > pivot) { */
/* message("sorting failed at k=%i, ind[k]=%i, pivot=%i, i=%li,
* j=%li.", */
/* k, ind[k], pivot, i, j); */
/* error("Partition failed (<=pivot)."); */
/* } */
/* for (int k = jj + 1; k <= j; k++) */
/* if (ind[k] <= pivot) { */
/* message("sorting failed at k=%i, ind[k]=%i, pivot=%i, i=%li,
* j=%li.", */
/* k, ind[k], pivot, i, j); */
/* error("Partition failed (>pivot)."); */
/* } */
/* #endif */
#ifdef SWIFT_DEBUG_CHECKS
/* Verify space_sort_struct. */
for (int k = i; k <= jj; k++)
if (ind[k] > pivot) {
message("sorting failed at k=%i, ind[k]=%i, pivot=%i, i=%li, j=%li.",
k, ind[k], pivot, i, j);
error("Partition failed (<=pivot).");
}
for (int k = jj + 1; k <= j; k++)
if (ind[k] <= pivot) {
message("sorting failed at k=%i, ind[k]=%i, pivot=%i, i=%li, j=%li.",
k, ind[k], pivot, i, j);
error("Partition failed (>pivot).");
}
#endif
/* Split-off largest interval. */
if (jj - i > j - jj + 1) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment