Commit 2a9c96e0 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Time the task dumping operations and add them to the analysis script when running with --task-dumps

parent 1bd0d6be
......@@ -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());
}
......@@ -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],
......
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