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

The task timings are now dumped to a file at the end of the simulation.

Former-commit-id: f291796e0d8ceb8ad73411bfc16f32ecae1d05e3
parent 98124124
No related branches found
No related tags found
No related merge requests found
...@@ -737,7 +737,6 @@ int main(int argc, char *argv[]) { ...@@ -737,7 +737,6 @@ int main(int argc, char *argv[]) {
parts[k].x[2] += shift[2]; parts[k].x[2] += shift[2];
} }
/* Set default number of queues. */ /* Set default number of queues. */
if (nr_queues < 0) nr_queues = nr_threads; if (nr_queues < 0) nr_queues = nr_threads;
...@@ -827,10 +826,10 @@ int main(int argc, char *argv[]) { ...@@ -827,10 +826,10 @@ int main(int argc, char *argv[]) {
e.nr_threads, e.sched.nr_queues); e.nr_threads, e.sched.nr_queues);
fflush(stdout); fflush(stdout);
/* Legend. */ /* Legend. */
/* if (myrank == 0) */ /* if (myrank == 0) */
/* printf("# step time e_tot e_kin e_temp dt dt_step count dt_min dt_max\n"); */ /* printf("# step time e_tot e_kin e_temp dt dt_step count dt_min
* dt_max\n"); */
/* Let loose a runner on the space. */ /* Let loose a runner on the space. */
for (j = 0; j < runs && e.time < clock; j++) { for (j = 0; j < runs && e.time < clock; j++) {
...@@ -864,21 +863,22 @@ int main(int argc, char *argv[]) { ...@@ -864,21 +863,22 @@ int main(int argc, char *argv[]) {
} }
/* Dump a line of agregate output. */ /* Dump a line of agregate output. */
/* if (myrank == 0) { */ /* if (myrank == 0) { */
/* printf("%i %e %.16e %.16e %.16e %.3e %.3e %i %.3e %.3e", j, e.time, */ /* printf("%i %e %.16e %.16e %.16e %.3e %.3e %i %.3e %.3e", j, e.time,
/* e.ekin + e.epot, e.ekin, e.epot, e.dt, e.dt_step, e.count_step, */ */
/* e.dt_min, e.dt_max); */ /* e.ekin + e.epot, e.ekin, e.epot, e.dt, e.dt_step,
/* for (k = 0; k < timer_count; k++) */ * e.count_step, */
/* printf(" %.3f", ((double)timers[k]) / CPU_TPS * 1000); */ /* e.dt_min, e.dt_max); */
/* printf("\n"); */ /* for (k = 0; k < timer_count; k++) */
/* fflush(stdout); */ /* printf(" %.3f", ((double)timers[k]) / CPU_TPS * 1000); */
/* } */ /* printf("\n"); */
/* fflush(stdout); */
/* } */
if (myrank == 0) { if (myrank == 0) {
if (j == 0) if (j == 0) printf("# Step Time time-step CPU Wall-clock time [ms]\n");
printf("# Step Time time-step CPU Wall-clock time [ms]\n");
printf("%i %e %.3e", j, e.time, e.dt ); printf("%i %e %.3e", j, e.time, e.dt);
printf(" %.3f", ((double)timers[timer_count-1]) / CPU_TPS * 1000); printf(" %.3f", ((double)timers[timer_count - 1]) / CPU_TPS * 1000);
printf("\n"); printf("\n");
fflush(stdout); fflush(stdout);
} }
...@@ -898,39 +898,37 @@ int main(int argc, char *argv[]) { ...@@ -898,39 +898,37 @@ int main(int argc, char *argv[]) {
(double)runner_hist_bins[k]); (double)runner_hist_bins[k]);
#endif #endif
/* Dump the task data. */
/* Dump the task data. */ FILE *file = fopen("thread_info.dat", "w");
#ifdef WITH_MPI #ifdef WITH_MPI
for ( j = 0 ; j < nr_nodes ; j++ ) { for (j = 0; j < nr_nodes; j++) {
MPI_Barrier( MPI_COMM_WORLD ); MPI_Barrier(MPI_COMM_WORLD);
if ( j == myrank ) { if (j == myrank) {
printf( " %03i 0 0 0 0 %lli 0 0 0 0\n" , myrank , e.tic_step ); printf(" %03i 0 0 0 0 %lli 0 0 0 0\n", myrank, e.tic_step);
for ( k = 0 ; k < e.sched.nr_tasks ; k++ ) for (k = 0; k < e.sched.nr_tasks; k++)
if ( !e.sched.tasks[k].skip && !e.sched.tasks[k].implicit ) if (!e.sched.tasks[k].skip && !e.sched.tasks[k].implicit)
printf( " %03i %i %i %i %i %lli %lli %i %i %i\n" , fprintf(
myrank , file, " %03i %i %i %i %i %lli %lli %i %i %i\n", myrank,
e.sched.tasks[k].rid , e.sched.tasks[k].type , e.sched.tasks[k].rid, e.sched.tasks[k].type,
e.sched.tasks[k].subtype , e.sched.tasks[k].subtype, (e.sched.tasks[k].cj == NULL),
(e.sched.tasks[k].cj == NULL) , e.sched.tasks[k].tic , e.sched.tasks[k].tic, e.sched.tasks[k].toc,
e.sched.tasks[k].toc , e.sched.tasks[k].ci->count,
e.sched.tasks[k].ci->count , (e.sched.tasks[k].cj != NULL) ? e.sched.tasks[k].cj->count : 0,
(e.sched.tasks[k].cj!=NULL)?e.sched.tasks[k].cj->count:0 , e.sched.tasks[k].flags);
e.sched.tasks[k].flags); fflush(stdout);
fflush(stdout); sleep(1);
sleep(1); }
} }
}
#else #else
for ( k = 0 ; k < e.sched.nr_tasks ; k++ ) for (k = 0; k < e.sched.nr_tasks; k++)
if ( !e.sched.tasks[k].skip && !e.sched.tasks[k].implicit ) if (!e.sched.tasks[k].skip && !e.sched.tasks[k].implicit)
fprintf(stderr, " %i %i %i %i %lli %lli %i %i\n" , fprintf(file, " %i %i %i %i %lli %lli %i %i\n", e.sched.tasks[k].rid,
e.sched.tasks[k].rid , e.sched.tasks[k].type , e.sched.tasks[k].type, e.sched.tasks[k].subtype,
e.sched.tasks[k].subtype , (e.sched.tasks[k].cj == NULL), e.sched.tasks[k].tic,
(e.sched.tasks[k].cj == NULL) , e.sched.tasks[k].tic , e.sched.tasks[k].toc, e.sched.tasks[k].ci->count,
e.sched.tasks[k].toc , (e.sched.tasks[k].cj == NULL) ? 0 : e.sched.tasks[k].cj->count);
e.sched.tasks[k].ci->count ,
(e.sched.tasks[k].cj==NULL)?0:e.sched.tasks[k].cj->count );
#endif #endif
fclose(file);
/* Write final output. */ /* Write final output. */
#if defined(WITH_MPI) #if defined(WITH_MPI)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment