Skip to content
Snippets Groups Projects
Commit 177b3821 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

add the option of dumping the timers in each time step.

parent 03b2046d
No related tags found
1 merge request!327Rebuild criteria
...@@ -165,12 +165,13 @@ int main(int argc, char *argv[]) { ...@@ -165,12 +165,13 @@ int main(int argc, char *argv[]) {
int with_drift_all = 0; int with_drift_all = 0;
int verbose = 0; int verbose = 0;
int nr_threads = 1; int nr_threads = 1;
int with_verbose_timers = 0;
char paramFileName[200] = ""; char paramFileName[200] = "";
unsigned long long cpufreq = 0; unsigned long long cpufreq = 0;
/* Parse the parameters */ /* Parse the parameters */
int c; int c;
while ((c = getopt(argc, argv, "acCdDef:FgGhn:sSt:v:y:")) != -1) switch (c) { while ((c = getopt(argc, argv, "acCdDef:FgGhn:sSt:Tv:y:")) != -1) switch (c) {
case 'a': case 'a':
with_aff = 1; with_aff = 1;
break; break;
...@@ -229,6 +230,9 @@ int main(int argc, char *argv[]) { ...@@ -229,6 +230,9 @@ int main(int argc, char *argv[]) {
return 1; return 1;
} }
break; break;
case 'T':
with_verbose_timers = 1;
break;
case 'v': case 'v':
if (sscanf(optarg, "%d", &verbose) != 1) { if (sscanf(optarg, "%d", &verbose) != 1) {
if (myrank == 0) printf("Error parsing verbosity level (-v).\n"); if (myrank == 0) printf("Error parsing verbosity level (-v).\n");
...@@ -600,10 +604,11 @@ int main(int argc, char *argv[]) { ...@@ -600,10 +604,11 @@ int main(int argc, char *argv[]) {
printf("# %6s %14s %14s %10s %10s %10s %16s [%s]\n", "Step", "Time", printf("# %6s %14s %14s %10s %10s %10s %16s [%s]\n", "Step", "Time",
"Time-step", "Updates", "g-Updates", "s-Updates", "Wall-clock time", "Time-step", "Updates", "g-Updates", "s-Updates", "Wall-clock time",
clocks_getunit()); clocks_getunit());
printf("timers: "); if (with_verbose_timers) {
for (int k = 0; k < timer_count; k++) printf("timers: ");
printf("%s\t", timers_names[k]); for (int k = 0; k < timer_count; k++) printf("%s\t", timers_names[k]);
printf("\n"); printf("\n");
}
} }
/* Main simulation loop */ /* Main simulation loop */
...@@ -614,12 +619,14 @@ int main(int argc, char *argv[]) { ...@@ -614,12 +619,14 @@ int main(int argc, char *argv[]) {
/* Take a step. */ /* Take a step. */
engine_step(&e); engine_step(&e);
/* Print the timers. */ /* Print the timers. */
printf("timers: "); if (with_verbose_timers) {
for (int k = 0; k < timer_count; k++) printf("timers: ");
printf("%.3f\t", clocks_from_ticks(timers[k])); for (int k = 0; k < timer_count; k++)
printf("\n"); printf("%.3f\t", clocks_from_ticks(timers[k]));
printf("\n");
}
#ifdef SWIFT_DEBUG_TASKS #ifdef SWIFT_DEBUG_TASKS
/* Dump the task data using the given frequency. */ /* Dump the task data using the given frequency. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment