Commit 1aa3c67a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

By default the code does not dump the task graph any more. This is dumped only...

By default the code does not dump the task graph any more. This is dumped only hen the option '-y' is passed to the command line.
parent f925a2a2
...@@ -554,6 +554,7 @@ int main(int argc, char *argv[]) { ...@@ -554,6 +554,7 @@ int main(int argc, char *argv[]) {
int c, icount, j, k, N, periodic = 1; int c, icount, j, k, N, periodic = 1;
long long N_total = -1; long long N_total = -1;
int nr_threads = 1, nr_queues = -1, runs = INT_MAX; int nr_threads = 1, nr_queues = -1, runs = INT_MAX;
int dump_tasks = 0;
int data[2]; int data[2];
double dim[3] = {1.0, 1.0, 1.0}, shift[3] = {0.0, 0.0, 0.0}; double dim[3] = {1.0, 1.0, 1.0}, shift[3] = {0.0, 0.0, 0.0};
double h_max = -1.0, scaling = 1.0; double h_max = -1.0, scaling = 1.0;
...@@ -604,7 +605,7 @@ int main(int argc, char *argv[]) { ...@@ -604,7 +605,7 @@ int main(int argc, char *argv[]) {
bzero(&s, sizeof(struct space)); bzero(&s, sizeof(struct space));
/* Parse the options */ /* Parse the options */
while ((c = getopt(argc, argv, "a:c:d:f:g:m:q:r:s:t:w:z:")) != -1) while ((c = getopt(argc, argv, "a:c:d:f:g:m:q:r:s:t:w:yz:")) != -1)
switch (c) { switch (c) {
case 'a': case 'a':
if (sscanf(optarg, "%lf", &scaling) != 1) if (sscanf(optarg, "%lf", &scaling) != 1)
...@@ -659,6 +660,9 @@ int main(int argc, char *argv[]) { ...@@ -659,6 +660,9 @@ int main(int argc, char *argv[]) {
error("Error parsing sub size."); error("Error parsing sub size.");
if (myrank == 0) message("sub size set to %i.", space_subsize); if (myrank == 0) message("sub size set to %i.", space_subsize);
break; break;
case 'y':
dump_tasks = 1;
break;
case 'z': case 'z':
if (sscanf(optarg, "%d", &space_splitsize) != 1) if (sscanf(optarg, "%d", &space_splitsize) != 1)
error("Error parsing split size."); error("Error parsing split size.");
...@@ -909,40 +913,43 @@ int main(int argc, char *argv[]) { ...@@ -909,40 +913,43 @@ 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. */
if (dump_tasks) {
#ifdef WITH_MPI #ifdef WITH_MPI
file_thread = fopen("thread_info_MPI.dat", "w"); file_thread = fopen("thread_info_MPI.dat", "w");
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) {
fprintf(file_thread, " %03i 0 0 0 0 %lli 0 0 0 0\n", myrank, e.tic_step); fprintf(file_thread, " %03i 0 0 0 0 %lli 0 0 0 0\n", myrank,
for (k = 0; k < e.sched.nr_tasks; k++) e.tic_step);
if (!e.sched.tasks[k].skip && !e.sched.tasks[k].implicit) for (k = 0; k < e.sched.nr_tasks; k++)
fprintf( if (!e.sched.tasks[k].skip && !e.sched.tasks[k].implicit)
file_thread, " %03i %i %i %i %i %lli %lli %i %i %i\n", myrank, fprintf(
e.sched.tasks[k].rid, e.sched.tasks[k].type, file_thread, " %03i %i %i %i %i %lli %lli %i %i %i\n", myrank,
e.sched.tasks[k].subtype, (e.sched.tasks[k].cj == NULL), e.sched.tasks[k].rid, e.sched.tasks[k].type,
e.sched.tasks[k].tic, e.sched.tasks[k].toc, e.sched.tasks[k].subtype, (e.sched.tasks[k].cj == NULL),
e.sched.tasks[k].ci->count, e.sched.tasks[k].tic, e.sched.tasks[k].toc,
(e.sched.tasks[k].cj != NULL) ? e.sched.tasks[k].cj->count : 0, e.sched.tasks[k].ci->count,
e.sched.tasks[k].flags); (e.sched.tasks[k].cj != NULL) ? e.sched.tasks[k].cj->count : 0,
fflush(stdout); e.sched.tasks[k].flags);
sleep(1); fflush(stdout);
sleep(1);
}
} }
} fclose(file_thread);
fclose(file_thread);
#else #else
file_thread = fopen("thread_info.dat", "w"); file_thread = fopen("thread_info.dat", "w");
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(file_thread, " %i %i %i %i %lli %lli %i %i\n", fprintf(file_thread, " %i %i %i %i %lli %lli %i %i\n",
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].cj == NULL), e.sched.tasks[k].subtype, (e.sched.tasks[k].cj == NULL),
e.sched.tasks[k].tic, e.sched.tasks[k].toc, e.sched.tasks[k].tic, e.sched.tasks[k].toc,
e.sched.tasks[k].ci->count, e.sched.tasks[k].ci->count,
(e.sched.tasks[k].cj == NULL) ? 0 : e.sched.tasks[k].cj->count); (e.sched.tasks[k].cj == NULL) ? 0 : e.sched.tasks[k].cj->count);
fclose(file_thread); fclose(file_thread);
#endif #endif
}
/* Write final output. */ /* Write final output. */
#if defined(WITH_MPI) #if defined(WITH_MPI)
......
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