diff --git a/src/task.c b/src/task.c index 30f6a9621916615d9aa6e9e315e30d222acd8f84..4930d28a9e9477f012f1167cb46c2f0ed7a1fa4a 100644 --- a/src/task.c +++ b/src/task.c @@ -915,6 +915,8 @@ void task_dump_all(struct engine *e, int step) { #ifdef SWIFT_DEBUG_TASKS + const ticks tic = getticks(); + /* Need this to convert ticks to seconds. */ const unsigned long long cpufreq = clocks_get_cpufreq(); @@ -1008,6 +1010,10 @@ void task_dump_all(struct engine *e, int step) { } fclose(file_thread); #endif // WITH_MPI + + if (e->verbose) + message("took %.3f %s.", clocks_from_ticks(getticks() - tic), + clocks_getunit()); #endif // SWIFT_DEBUG_TASKS } @@ -1036,6 +1042,8 @@ void task_dump_all(struct engine *e, int step) { void task_dump_stats(const char *dumpfile, struct engine *e, int header, int allranks) { + const ticks function_tic = getticks(); + /* Need arrays for sum, min and max across all types and subtypes. */ double sum[task_type_count][task_subtype_count]; double tsum[task_type_count][task_subtype_count]; @@ -1171,6 +1179,10 @@ void task_dump_stats(const char *dumpfile, struct engine *e, int header, #ifdef WITH_MPI } #endif + + if (e->verbose) + message("took %.3f %s.", clocks_from_ticks(getticks() - function_tic), + clocks_getunit()); } /** @@ -1188,6 +1200,8 @@ void task_dump_stats(const char *dumpfile, struct engine *e, int header, */ void task_dump_active(struct engine *e) { + const ticks tic = getticks(); + /* Need this to convert ticks to seconds. */ unsigned long long cpufreq = clocks_get_cpufreq(); char dumpfile[35]; @@ -1234,4 +1248,8 @@ void task_dump_active(struct engine *e) { count++; } fclose(file_thread); + + if (e->verbose) + message("took %.3f %s.", clocks_from_ticks(getticks() - tic), + clocks_getunit()); } diff --git a/tools/analyse_runtime.py b/tools/analyse_runtime.py index bdb09679e69db7f07aeee9ccda48e93e52eca4d7..cfa7b9770733ab5b6f8f7f7905588952761d249c 100755 --- a/tools/analyse_runtime.py +++ b/tools/analyse_runtime.py @@ -97,6 +97,9 @@ labels = [ ["engine_print_task_counts:", 0], ["engine_drift_top_multipoles:", 0], ["Communicating rebuild flag", 0], + ["task_dump_all", 0], + ["task_dump_stats", 0], + ["task_dump_active", 0], ["engine_split:", 0], ["space_init", 0], ["engine_init", 0],