Commit 60a49236 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

re-weight tasks now and then.


Former-commit-id: 2f5875f45efac6042798dc065b852e9c42168493
parent 47cc69b9
......@@ -932,10 +932,13 @@ void engine_maketasks ( struct engine *e ) {
/* Rank the tasks. */
scheduler_ranktasks( sched );
/* Weight the tasks. */
scheduler_reweight( sched );
/* Set the tasks age. */
e->tasks_age = 0;
}
......@@ -1158,6 +1161,11 @@ void engine_prepare ( struct engine *e ) {
/* Did this not go through? */
if ( rebuild )
engine_rebuild( e );
/* Re-rank the tasks every now and then. */
if ( e->tasks_age % engine_tasksreweight == 1 )
scheduler_reweight( &e->sched );
e->tasks_age += 1;
/* Start the scheduler. */
// ticks tic2 = getticks();
......
......@@ -34,6 +34,7 @@
#define engine_queue_scale 1.2
#define engine_maxtaskspercell 32
#define engine_maxproxies 64
#define engine_tasksreweight 10
/* The rank of the engine as a global variable (for messages). */
......@@ -94,6 +95,9 @@ struct engine {
/* Force the engine to rebuild? */
int forcerebuild, forcerepart;
/* How many steps have we done with the same set of tasks? */
int tasks_age;
};
......
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