Commit 2abe8136 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

no need to distinguish between send/recv task subtypes.


Former-commit-id: b5530fc2006c6ba04401156070119580f715566d
parent 57bab69e
......@@ -578,8 +578,8 @@ void engine_addtasks_send ( struct engine *e , struct cell *ci , struct cell *cj
if ( l != NULL ) {
/* Create the tasks. */
struct task *t_xv = scheduler_addtask( &e->sched , task_type_send_xv , task_subtype_none , 2*ci->tag , 0 , ci , cj , 0 );
struct task *t_rho = scheduler_addtask( &e->sched , task_type_send_rho , task_subtype_none , 2*ci->tag + 1 , 0 , ci , cj , 0 );
struct task *t_xv = scheduler_addtask( &e->sched , task_type_send , task_subtype_none , 2*ci->tag , 0 , ci , cj , 0 );
struct task *t_rho = scheduler_addtask( &e->sched , task_type_send , task_subtype_none , 2*ci->tag + 1 , 0 , ci , cj , 0 );
/* The send_rho task depends on the cell's ghost task. */
scheduler_addunlock( s , ci->super->ghost , t_rho );
......@@ -619,8 +619,8 @@ void engine_addtasks_recv ( struct engine *e , struct cell *c , struct task *t_x
if ( t_xv == NULL && c->nr_density > 0 ) {
/* Create the tasks. */
t_xv = c->recv_xv = scheduler_addtask( &e->sched , task_type_recv_xv , task_subtype_none , 2*c->tag , 0 , c , NULL , 0 );
t_rho = c->recv_rho = scheduler_addtask( &e->sched , task_type_recv_rho , task_subtype_none , 2*c->tag + 1 , 0 , c , NULL , 0 );
t_xv = c->recv_xv = scheduler_addtask( &e->sched , task_type_recv , task_subtype_none , 2*c->tag , 0 , c , NULL , 0 );
t_rho = c->recv_rho = scheduler_addtask( &e->sched , task_type_recv , task_subtype_none , 2*c->tag + 1 , 0 , c , NULL , 0 );
}
......@@ -1655,10 +1655,8 @@ void engine_step ( struct engine *e ) {
(1 << task_type_sub) |
(1 << task_type_ghost) |
(1 << task_type_kick2) |
(1 << task_type_send_xv) |
(1 << task_type_recv_xv) |
(1 << task_type_send_rho) |
(1 << task_type_recv_rho) |
(1 << task_type_send) |
(1 << task_type_recv) |
(1 << task_type_link) );
TIMER_TOC(timer_runners);
......
......@@ -1160,16 +1160,14 @@ void *runner_main ( void *data ) {
else
runner_dokick2( r , ci );
break;
case task_type_send_xv:
case task_type_send_rho:
case task_type_send:
break;
case task_type_recv_xv:
case task_type_recv_rho:
parts = ci->parts;
case task_type_recv:
parts = ci->parts;
nr_parts = ci->count;
for ( k = 0 ; k < nr_parts ; k++ )
parts[k].dt = FLT_MAX;
ci->dt_min = ci->dt_max = FLT_MAX;
parts[k].dt = FLT_MAX;
ci->dt_min = ci->dt_max = FLT_MAX;
break;
default:
error( "Unknown task type." );
......
......@@ -654,9 +654,9 @@ void scheduler_reweight ( struct scheduler *s ) {
t->weight += wscale * t->ci->count;
break;
}
if ( t->type == task_type_send_xv || t->type == task_type_send_rho )
if ( t->type == task_type_send )
t->weight = INT_MAX / 8;
if ( t->type == task_type_recv_xv || t->type == task_type_recv_rho )
if ( t->type == task_type_recv )
t->weight *= 1.41;
}
// message( "weighting tasks took %.3f ms." , (double)( getticks() - tic ) / CPU_TPS * 1000 );
......@@ -763,8 +763,7 @@ void scheduler_enqueue ( struct scheduler *s , struct task *t ) {
( qid < 0 || s->queues[qid].count > s->queues[t->cj->super->owner].count ) )
qid = t->cj->super->owner;
break;
case task_type_recv_xv:
case task_type_recv_rho:
case task_type_recv:
#ifdef WITH_MPI
if ( ( err = MPI_Irecv( t->ci->parts , sizeof(struct part) * t->ci->count , MPI_BYTE , t->ci->nodeID , t->flags , MPI_COMM_WORLD , &t->req ) ) != MPI_SUCCESS ) {
char buff[ MPI_MAX_ERROR_STRING ];
......@@ -779,8 +778,7 @@ void scheduler_enqueue ( struct scheduler *s , struct task *t ) {
error( "SWIFT was not compiled with MPI support." );
#endif
break;
case task_type_send_xv:
case task_type_send_rho:
case task_type_send:
#ifdef WITH_MPI
if ( ( err = MPI_Isend( t->ci->parts , sizeof(struct part) * t->ci->count , MPI_BYTE , t->cj->nodeID , t->flags , MPI_COMM_WORLD , &t->req ) ) != MPI_SUCCESS ) {
char buff[ MPI_MAX_ERROR_STRING ];
......
......@@ -49,8 +49,7 @@
/* Task type names. */
const char *taskID_names[task_type_count] = {
"none" , "sort" , "self" , "pair" , "sub" , "ghost" ,
"kick1" , "kick2" , "send_xv" , "recv_xv" , "send_rho" ,
"recv_rho" , "link" };
"kick1" , "kick2" , "send" , "recv" , "link" };
/**
......@@ -90,8 +89,8 @@ int task_lock ( struct task *t ) {
struct cell *ci = t->ci, *cj = t->cj;
/* Communication task? */
if ( type == task_type_recv_xv || type == task_type_recv_rho ||
type == task_type_send_xv || type == task_type_send_rho ) {
if ( type == task_type_recv ||
type == task_type_send ) {
#ifdef WITH_MPI
/* Check the status of the MPI request. */
......
......@@ -33,10 +33,8 @@ enum task_types {
task_type_ghost,
task_type_kick1,
task_type_kick2,
task_type_send_xv,
task_type_recv_xv,
task_type_send_rho,
task_type_recv_rho,
task_type_send,
task_type_recv,
task_type_link,
task_type_count
};
......
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