Commit 7c9a3897 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

prioritize tasks with foreign cells, fix weighting bug in subs.


Former-commit-id: a67303c6dbb3908667a36f5ec45066c62efdc224
parent be6e7abd
......@@ -617,6 +617,7 @@ void scheduler_reweight ( struct scheduler *s ) {
int k, j, nr_tasks = s->nr_tasks, *tid = s->tasks_ind;
struct task *t, *tasks = s->tasks;
int nodeID = s->nodeID;
float sid_scale[13] = { 0.1897 , 0.4025 , 0.1897 , 0.4025 , 0.5788 , 0.4025 ,
0.1897 , 0.4025 , 0.1897 , 0.4025 , 0.5788 , 0.4025 ,
0.5788 };
......@@ -643,13 +644,20 @@ void scheduler_reweight ( struct scheduler *s ) {
t->weight += 10 * t->ci->count * t->ci->count;
break;
case task_type_pair:
t->weight += 20 * t->ci->count * t->cj->count * sid_scale[ t->flags ];
if ( t->ci->nodeID != nodeID || t->cj->nodeID != nodeID )
t->weight += 30 * t->ci->count * t->cj->count * sid_scale[ t->flags ];
else
t->weight += 20 * t->ci->count * t->cj->count * sid_scale[ t->flags ];
break;
case task_type_sub:
if ( t->cj != NULL )
t->weight += 10 * t->ci->count * t->cj->count * sid_scale[ t->flags ];
if ( t->cj != NULL ) {
if ( t->ci->nodeID != nodeID || t->cj->nodeID != nodeID )
t->weight += 30 * t->ci->count * t->cj->count * sid_scale[ t->flags ];
else
t->weight += 20 * t->ci->count * t->cj->count * sid_scale[ t->flags ];
}
else
t->weight += 20 * t->ci->count * t->ci->count;
t->weight += 10 * t->ci->count * t->ci->count;
break;
case task_type_ghost:
if ( t->ci == t->ci->super )
......@@ -659,6 +667,10 @@ void scheduler_reweight ( struct scheduler *s ) {
case task_type_kick2:
t->weight += t->ci->count;
break;
case task_type_send_xv:
case task_type_send_rho:
t->weight *= 2;
break;
}
}
// message( "weighting tasks took %.3f ms." , (double)( getticks() - tic ) / CPU_TPS * 1000 );
......@@ -767,7 +779,7 @@ void scheduler_enqueue ( struct scheduler *s , struct task *t ) {
}
// message( "recieving %i parts with tag=%i from %i to %i." ,
// t->ci->count , t->flags , t->ci->nodeID , s->nodeID ); fflush(stdout);
qid = -1;
qid = 0;
#else
error( "SWIFT was not compiled with MPI support." );
#endif
......@@ -783,7 +795,7 @@ void scheduler_enqueue ( struct scheduler *s , struct task *t ) {
}
// message( "sending %i parts with tag=%i from %i to %i." ,
// t->ci->count , t->flags , s->nodeID , t->cj->nodeID ); fflush(stdout);
qid = -1;
qid = 0;
#else
error( "SWIFT was not compiled with MPI support." );
#endif
......
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