Skip to content
Snippets Groups Projects
Commit b3575963 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Correct timers and documentation

parent a26e112a
No related branches found
No related tags found
1 merge request!420Gravity speedup
......@@ -132,12 +132,19 @@ static INLINE void gravity_cache_init(struct gravity_cache *c, int count) {
/**
* @brief Fills a #gravity_cache structure with some #gpart and shift them.
*
* Also checks whether the #gpart can use a M2P interaction instead of the
* more expensive P2P.
*
* @param max_active_bin The largest active bin in the current time-step.
* @param c The #gravity_cache to fill.
* @param gparts The #gpart array to read from.
* @param gcount The number of particles to read.
* @param gcount_padded The number of particle to read padded to the next
* multiple of the vector length.
* @param shift A shift to apply to all the particles.
* @param CoM The position of the multipole.
* @param r_max2 The square of the multipole radius.
* @param theta_crit2 The square of the opening angle.
*/
__attribute__((always_inline)) INLINE static void gravity_cache_populate(
timebin_t max_active_bin, struct gravity_cache *c,
......@@ -192,6 +199,7 @@ __attribute__((always_inline)) INLINE static void gravity_cache_populate(
/**
* @brief Fills a #gravity_cache structure with some #gpart and shift them.
*
* @param max_active_bin The largest active bin in the current time-step.
* @param c The #gravity_cache to fill.
* @param gparts The #gpart array to read from.
* @param gcount The number of particles to read.
......
......@@ -54,8 +54,9 @@ const char* timers_names[timer_count] = {
"dopair_density",
"dopair_gradient",
"dopair_force",
"dopair_grav_pm",
"dopair_grav_branch",
"dopair_grav_mm",
"dopair_grav_pm",
"dopair_grav_pp",
"dograv_external",
"dograv_down",
......@@ -119,8 +120,9 @@ void timers_reset_all() { timers_reset(timers_mask_all); }
void timers_print(int step) {
fprintf(timers_file, "%d\t", step);
for (int k = 0; k < timer_count; k++)
fprintf(timers_file, "%.3f\t", clocks_from_ticks(timers[k]));
fprintf(timers_file, "%18.3f ", clocks_from_ticks(timers[k]));
fprintf(timers_file, "\n");
fflush(timers_file);
}
/**
......@@ -136,7 +138,7 @@ void timers_open_file(int rank) {
fprintf(timers_file, "# timers: \n# step | ");
for (int k = 0; k < timer_count; k++)
fprintf(timers_file, "%s\t", timers_names[k]);
fprintf(timers_file, "%18s ", timers_names[k]);
fprintf(timers_file, "\n");
}
......
......@@ -56,6 +56,7 @@ enum {
timer_dopair_gradient,
timer_dopair_force,
timer_dopair_grav_branch,
timer_dopair_grav_mm,
timer_dopair_grav_pm,
timer_dopair_grav_pp,
timer_dograv_external,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment