Skip to content
Snippets Groups Projects
Commit 9e4d1d1e authored by Aidan Chalk's avatar Aidan Chalk
Browse files

Some infrastructure for #15. Not tested yet, needs integrating with FORTRAN...

Some infrastructure for #15. Not tested yet, needs integrating with FORTRAN bindings once they are added. May be done before this is added to master so I can use them
parent f9c431d4
No related branches found
No related tags found
1 merge request!9Task timers
......@@ -99,6 +99,17 @@ if test "$enable_san" = "yes"; then
fi
fi
AC_ARG_ENABLE([task-timers],
[AS_HELP_STRING([--enable-task-timers],
[Enables task timer output and collection of extra data to enable it])].
[enable_tts]="$enableval$"],
[enable_tts]="no"]
)
if test "$enable_tts" = "yes"; then
AC_DEFINE(WITH_TASK_TIMERS,1,[Define if Task Timer recording is enabled])
fi
# Autoconf stuff
AC_PROG_INSTALL
AC_PROG_MAKE_SET
......
......@@ -608,6 +608,9 @@ void qsched_done ( struct qsched *s , struct task *t ) {
/* Set the task stats. */
t->toc = getticks();
#ifdef WITH_TASK_TIMERS
t->tid = qsched_get_tid();
#endif
if (!(s->flags & qsched_flag_norecost))
t->cost = t->toc - t->tic;
......@@ -1646,3 +1649,26 @@ void qsched_init ( struct qsched *s , int nr_queues , int flags ) {
lock_init( &s->lock );
}
void qsched_dump_task_timers( struct qsched *s, char *filename ){
#ifdef WITH_TASK_TIMERS
FILE *task_file;
task_file = fopen(filename, "w");
for(int i = 0; i < s->nr_tasks; i++)
{
struct task *t = s->tasks[i];
fprintf("%i %i %lli %lli\n", t->type, t->tid, t->tic, t->toc);
}
fclose(task_file);
#else
error("Quicksched wasn't compiled with task timers enabled\n");
#endif
}
......@@ -211,3 +211,4 @@ void qsched_reset ( struct qsched *s );
void qsched_addtask_dynamic ( struct qsched *s , int type , unsigned int flags , void *data , int data_size , int cost , qsched_res_t *locks , int nr_locks , qsched_res_t *uses , int nr_uses );
void qsched_ensure ( struct qsched *s , int nr_tasks , int nr_res , int nr_deps , int nr_locks , int nr_uses , int size_data );
void qsched_res_own ( struct qsched *s , qsched_res_t res , int owner );
void qsched_dump_task_timers( struct qsched *s, char *filename );
......@@ -57,4 +57,9 @@ struct task {
/* Task weight for queue selection. */
int cost, weight;
#ifdef WITH_TASK_TIMERS
int tid;
#endif
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment