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
7c9fc32c
Commit
7c9fc32c
authored
8 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
create drift and sort tasks below each sub-cell task.
parent
5852797e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!343
Subset sorting
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scheduler.c
+45
-6
45 additions, 6 deletions
src/scheduler.c
with
45 additions
and
6 deletions
src/scheduler.c
+
45
−
6
View file @
7c9fc32c
...
...
@@ -111,6 +111,45 @@ void scheduler_addunlock(struct scheduler *s, struct task *ta,
atomic_inc
(
&
s
->
completed_unlock_writes
);
}
/**
* @brief Create the drift and sort tasks for the hierarchy of cells under
* a sub-cell task.
*
* @param s The #scheduler.
* @param c A #cell.
* @param t The sub-cell #task that will be unlocked by the sort tasks.
*/
void
scheduler_add_subcell_tasks
(
struct
scheduler
*
s
,
struct
cell
*
c
,
struct
task
*
t
)
{
/* Recurse? */
if
(
c
->
split
)
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
scheduler_add_subcell_tasks
(
s
,
c
->
progeny
[
k
],
t
);
/* Lock the cell before potentially adding tasks. */
lock_lock
(
&
c
->
lock
);
/* Add a drift task if not present. */
if
(
c
->
drift
==
NULL
)
c
->
drift
=
scheduler_addtask
(
s
,
task_type_drift
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
/* Add a sort task if not present. Note that the sort flags will be
populated in cell_activate_subcell_tasks. */
if
(
c
->
sorts
==
NULL
)
{
c
->
sorts
=
scheduler_addtask
(
s
,
task_type_sort
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
}
/* Unlock the cell. */
lock_unlock_blind
(
&
c
->
lock
);
/* The provided task should depend on the sort. */
scheduler_addunlock
(
s
,
c
->
sorts
,
t
);
}
/**
* @brief Split a task if too large.
*
...
...
@@ -183,8 +222,8 @@ static void scheduler_splittask(struct task *t, struct scheduler *s) {
lock_unlock_blind
(
&
ci
->
lock
);
}
/* Depend on local sorts on this cell. */
if
(
ci
->
sorts
!=
NULL
)
scheduler_addunlock
(
s
,
ci
->
sorts
,
t
);
/* Depend on local sorts on this cell
and its sub-cells
. */
scheduler_add_subcell_tasks
(
s
,
ci
,
t
);
/* Otherwise, make tasks explicitly. */
}
else
{
...
...
@@ -262,8 +301,8 @@ static void scheduler_splittask(struct task *t, struct scheduler *s) {
t
->
type
=
task_type_sub_pair
;
/* Depend on the sort tasks of both cells. */
if
(
ci
->
sorts
!=
NULL
)
scheduler_addunlock
(
s
,
ci
->
sorts
,
t
);
if
(
cj
->
sorts
!=
NULL
)
scheduler_addunlock
(
s
,
cj
->
sorts
,
t
);
scheduler_add_subcell_tasks
(
s
,
ci
,
t
);
scheduler_add_subcell_tasks
(
s
,
cj
,
t
);
/* Otherwise, split it. */
}
else
{
...
...
@@ -1149,14 +1188,14 @@ void scheduler_start(struct scheduler *s) {
ci
->
ti_end_min
);
/* Special treatment for sort tasks */
if
(
ci
->
ti_end_min
==
ti_current
&&
t
->
skip
&&
/*
if (ci->ti_end_min == ti_current && t->skip &&
t->type == task_type_sort && t->flags == 0)
error(
"Task (type='%s/%s') should not have been skipped "
"ti_current=%lld "
"c->ti_end_min=%lld t->flags=%d",
taskID_names[t->type], subtaskID_names[t->subtype], ti_current,
ci
->
ti_end_min
,
t
->
flags
);
ci->ti_end_min, t->flags);
*/
}
else
{
/* pair */
...
...
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