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

hide the task 'rid' behind an ifdef, still need to add this to the configure script.

parent 6568085f
No related branches found
No related tags found
1 merge request!282Scheduler activate root
......@@ -551,6 +551,7 @@ int main(int argc, char *argv[]) {
/* Dump the task data using the given frequency. */
if (dump_tasks && (dump_tasks == 1 || j % dump_tasks == 1)) {
#ifdef SWIFT_TASK_DUMP
#ifdef WITH_MPI
/* Make sure output file is empty, only on one rank. */
......@@ -580,8 +581,8 @@ int main(int argc, char *argv[]) {
for (int l = 0; l < e.sched.nr_tasks; l++) {
if (!e.sched.tasks[l].implicit && e.sched.tasks[l].toc != 0) {
fprintf(
file_thread, " %03i %i %i %i %lli %lli %i %i %i %i %i\n",
myrank, e.sched.tasks[l].type,
file_thread, " %03i %i %i %i %i %lli %lli %i %i %i %i %i\n",
myrank, e.sched.tasks[l].rid, e.sched.tasks[l].type,
e.sched.tasks[l].subtype, (e.sched.tasks[l].cj == NULL),
e.sched.tasks[l].tic, e.sched.tasks[l].toc,
(e.sched.tasks[l].ci != NULL) ? e.sched.tasks[l].ci->count
......@@ -615,8 +616,8 @@ int main(int argc, char *argv[]) {
for (int l = 0; l < e.sched.nr_tasks; l++) {
if (!e.sched.tasks[l].implicit && e.sched.tasks[l].toc != 0) {
fprintf(
file_thread, " %i %i %i %lli %lli %i %i %i %i\n",
e.sched.tasks[l].type,
file_thread, " %i %i %i %i %lli %lli %i %i %i %i\n",
e.sched.tasks[l].rid, e.sched.tasks[l].type,
e.sched.tasks[l].subtype, (e.sched.tasks[l].cj == NULL),
e.sched.tasks[l].tic, e.sched.tasks[l].toc,
(e.sched.tasks[l].ci == NULL) ? 0 : e.sched.tasks[l].ci->count,
......@@ -626,6 +627,9 @@ int main(int argc, char *argv[]) {
}
}
fclose(file_thread);
#endif
#else
error("Task dumping not enabled at compile-time.");
#endif
}
}
......
......@@ -1293,6 +1293,10 @@ void *runner_main(void *data) {
/* Get the cells. */
struct cell *ci = t->ci;
struct cell *cj = t->cj;
#ifdef SWIFT_TASK_DUMP
t->rid = r->id;
#endif
/* Check that we haven't scheduled an inactive task */
#ifdef SWIFT_DEBUG_CHECKS
......
......@@ -713,6 +713,9 @@ struct task *scheduler_addtask(struct scheduler *s, enum task_types type,
t->tic = 0;
t->toc = 0;
t->nr_unlock_tasks = 0;
#ifdef SWIFT_TASK_DUMP
t->rid = -1;
#endif
/* Add an index for it. */
// lock_lock( &s->lock );
......
......@@ -147,6 +147,11 @@ struct task {
/*! Is this task implicit (i.e. does not do anything) ? */
char implicit;
#ifdef SWIFT_TASK_DUMP
/* ID of the last thread to execute this task. */
short int rid;
#endif // SWIFT_TASK_DUMP
} SWIFT_STRUCT_ALIGN;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment