Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
2abe8136
Commit
2abe8136
authored
Sep 19, 2013
by
Pedro Gonnet
Browse files
no need to distinguish between send/recv task subtypes.
Former-commit-id: b5530fc2006c6ba04401156070119580f715566d
parent
57bab69e
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
2abe8136
...
...
@@ -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
);
...
...
src/runner.c
View file @
2abe8136
...
...
@@ -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."
);
...
...
src/scheduler.c
View file @
2abe8136
...
...
@@ -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
];
...
...
src/task.c
View file @
2abe8136
...
...
@@ -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. */
...
...
src/task.h
View file @
2abe8136
...
...
@@ -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
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment