diff --git a/examples/ExternalPointMass/externalPointMass.yml b/examples/ExternalPointMass/externalPointMass.yml index df68307fa36cd01488e0276630003fd822b294c3..20b5bb3aa613d553d8c401e968d8ebfc0572e610 100644 --- a/examples/ExternalPointMass/externalPointMass.yml +++ b/examples/ExternalPointMass/externalPointMass.yml @@ -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 diff --git a/examples/ExternalPointMass/makeIC.py b/examples/ExternalPointMass/makeIC.py index 39fe503c1bde766c323b4dad9afc79a18a4af2ba..ba415daf9e03058239599cc08039fc89e0929393 100644 --- a/examples/ExternalPointMass/makeIC.py +++ b/examples/ExternalPointMass/makeIC.py @@ -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) diff --git a/examples/SedovBlast_3D/sedov.yml b/examples/SedovBlast_3D/sedov.yml index c7ea6bfb608d61b631af93c48804202fc0d8f50b..1cc4aced9af3314cadde44f768016225426addf6 100644 --- a/examples/SedovBlast_3D/sedov.yml +++ b/examples/SedovBlast_3D/sedov.yml @@ -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). diff --git a/src/cell.c b/src/cell.c index ca66c85b04a953f44fa56a91e303a1dbbd3c5288..d2b995a259e9ddd3f3b84117d53fa0f6f2024e31 100644 --- a/src/cell.c +++ b/src/cell.c @@ -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 diff --git a/src/const.h b/src/const.h index 81678eebb9ba99268b4d817acd581ec36e6cec43..d164f71b3e0e044276bb6bf253eedc8d435e736e 100644 --- a/src/const.h +++ b/src/const.h @@ -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 */ diff --git a/src/engine.c b/src/engine.c index 9b7bc5d6d4e49e160fc4bd55b49f473fca61d0d3..feefdf3f72765606c361c5c3b07b056831244733 100644 --- a/src/engine.c +++ b/src/engine.c @@ -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); diff --git a/src/kick.h b/src/kick.h index 92f25461ad9743ad17f3a107478a930b24e8bc57..61bdd194a2fbee47c959626abc97362fe5972250 100644 --- a/src/kick.h +++ b/src/kick.h @@ -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; diff --git a/src/runner.c b/src/runner.c index 41b951a8faaa85af80370ce6ac4261c64d8bfc31..4c1d5dee8f0593954baf4cda4c7e326ca064d6a6 100644 --- a/src/runner.c +++ b/src/runner.c @@ -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++) { diff --git a/src/space.c b/src/space.c index b289f95b47b830e9192b7cd60dceeb69a24c0053..408f7590ea9087c7ab84801b894cd8c332d989c5 100644 --- a/src/space.c +++ b/src/space.c @@ -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) {