Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
3012917c
Commit
3012917c
authored
8 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
make engine_marktasks_mapper work the same as cell_unskip_tasks.
parent
7a4714cf
No related branches found
No related tags found
1 merge request
!327
Rebuild criteria
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/engine.c
+29
-10
29 additions, 10 deletions
src/engine.c
src/runner.c
+7
-6
7 additions, 6 deletions
src/runner.c
with
36 additions
and
16 deletions
src/engine.c
+
29
−
10
View file @
3012917c
...
...
@@ -2075,9 +2075,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* Too much particle movement? */
if
(
t
->
tight
&&
(
max
(
ci
->
h_max
,
cj
->
h_max
)
+
ci
->
dx_max
+
cj
->
dx_max
>
cj
->
dmin
||
ci
->
dx_max
>
space_maxreldx
*
ci
->
h_max
||
cj
->
dx_max
>
space_maxreldx
*
cj
->
h_max
))
max
(
ci
->
h_max
,
cj
->
h_max
)
+
ci
->
dx_max
+
cj
->
dx_max
>
cj
->
dmin
)
*
rebuild_space
=
1
;
/* Set this task's skip, otherwise nothing to do. */
...
...
@@ -2089,22 +2087,37 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* If this is not a density task, we don't have to do any of the below. */
if
(
t
->
subtype
!=
task_subtype_density
)
continue
;
/* Set the sort flags
.
*/
/* Set the
correct
sort
ing
flags */
if
(
t
->
type
==
task_type_pair
)
{
if
(
ci
->
dx_max_sort
>
space_maxreldx
*
ci
->
dmin
)
ci
->
sorted
=
0
;
if
(
cj
->
dx_max_sort
>
space_maxreldx
*
cj
->
dmin
)
cj
->
sorted
=
0
;
if
(
ci
->
dx_max_sort
>
space_maxreldx
*
ci
->
dmin
)
{
for
(
struct
cell
*
finger
=
ci
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
finger
->
sorted
=
0
;
}
if
(
cj
->
dx_max_sort
>
space_maxreldx
*
cj
->
dmin
)
{
for
(
struct
cell
*
finger
=
cj
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
finger
->
sorted
=
0
;
}
if
(
!
(
ci
->
sorted
&
(
1
<<
t
->
flags
)))
{
atomic_or
(
&
ci
->
sorts
->
flags
,
(
1
<<
t
->
flags
));
#ifdef SWIFT_DEBUG_CHECKS
if
(
!
(
ci
->
sorts
->
flags
&
(
1
<<
t
->
flags
)))
error
(
"bad flags in sort task."
);
#endif
scheduler_activate
(
s
,
ci
->
sorts
);
scheduler_activate
(
s
,
ci
->
super
->
drift
);
}
if
(
!
(
cj
->
sorted
&
(
1
<<
t
->
flags
)))
{
atomic_or
(
&
cj
->
sorts
->
flags
,
(
1
<<
t
->
flags
));
#ifdef SWIFT_DEBUG_CHECKS
if
(
!
(
cj
->
sorts
->
flags
&
(
1
<<
t
->
flags
)))
error
(
"bad flags in sort task."
);
#endif
scheduler_activate
(
s
,
cj
->
sorts
);
scheduler_activate
(
s
,
cj
->
super
->
drift
);
}
}
#ifdef WITH_MPI
/* Activate the send/recv flags. */
if
(
ci
->
nodeID
!=
engine_rank
)
{
...
...
@@ -2177,8 +2190,14 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
if
(
l
==
NULL
)
error
(
"Missing link to send_ti task."
);
scheduler_activate
(
s
,
l
->
t
);
}
}
}
else
{
scheduler_activate
(
s
,
ci
->
super
->
drift
);
scheduler_activate
(
s
,
cj
->
super
->
drift
);
}
#else
scheduler_activate
(
s
,
ci
->
super
->
drift
);
scheduler_activate
(
s
,
cj
->
super
->
drift
);
#endif
}
...
...
This diff is collapsed.
Click to expand it.
src/runner.c
+
7
−
6
View file @
3012917c
...
...
@@ -336,10 +336,8 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int clock) {
struct
part
*
parts
=
c
->
parts
;
struct
xpart
*
xparts
=
c
->
xparts
;
struct
entry
*
sort
;
int
j
,
k
,
count
=
c
->
count
;
int
i
,
ind
,
off
[
8
],
inds
[
8
],
temp_i
,
missing
;
const
int
count
=
c
->
count
;
float
buff
[
8
];
double
px
[
3
];
TIMER_TIC
...
...
@@ -387,6 +385,7 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int clock) {
if
(
!
(
flags
&
(
1
<<
j
)))
continue
;
/* Init the particle index offsets. */
int
off
[
8
];
off
[
0
]
=
0
;
for
(
int
k
=
1
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
-
1
]
!=
NULL
)
...
...
@@ -395,6 +394,7 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int clock) {
off
[
k
]
=
off
[
k
-
1
];
/* Init the entries and indices. */
int
inds
[
8
];
for
(
int
k
=
0
;
k
<
8
;
k
++
)
{
inds
[
k
]
=
k
;
if
(
c
->
progeny
[
k
]
!=
NULL
&&
c
->
progeny
[
k
]
->
count
>
0
)
{
...
...
@@ -409,7 +409,7 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int clock) {
for
(
int
i
=
0
;
i
<
7
;
i
++
)
for
(
int
k
=
i
+
1
;
k
<
8
;
k
++
)
if
(
buff
[
inds
[
k
]]
<
buff
[
inds
[
i
]])
{
temp_i
=
inds
[
i
];
int
temp_i
=
inds
[
i
];
inds
[
i
]
=
inds
[
k
];
inds
[
k
]
=
temp_i
;
}
...
...
@@ -428,7 +428,7 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int clock) {
/* Find the smallest entry. */
for
(
int
k
=
1
;
k
<
8
&&
buff
[
inds
[
k
]]
<
buff
[
inds
[
k
-
1
]];
k
++
)
{
temp_i
=
inds
[
k
-
1
];
int
temp_i
=
inds
[
k
-
1
];
inds
[
k
-
1
]
=
inds
[
k
];
inds
[
k
]
=
temp_i
;
}
...
...
@@ -1416,7 +1416,8 @@ void *runner_main(void *data) {
}
else
if
(
cj
==
NULL
)
{
/* self */
if
(
!
cell_is_active
(
ci
,
e
)
&&
t
->
type
!=
task_type_sort
&&
t
->
type
!=
task_type_send
&&
t
->
type
!=
task_type_recv
)
t
->
type
!=
task_type_drift
&&
t
->
type
!=
task_type_send
&&
t
->
type
!=
task_type_recv
)
error
(
"Task (type='%s/%s') should have been skipped ti_current=%lld "
"c->ti_end_min=%lld"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment