Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QuickSched
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
QuickSched
Commits
3ee481c2
Commit
3ee481c2
authored
11 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug in task type creation.
parent
d2dfab47
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/test_bh.c
+34
-40
34 additions, 40 deletions
examples/test_bh.c
with
34 additions
and
40 deletions
examples/test_bh.c
+
34
−
40
View file @
3ee481c2
...
...
@@ -552,10 +552,26 @@ void create_tasks ( struct qsched *s , struct cell *ci , struct cell *cj ) {
r2
+=
dx
*
dx
;
}
/* Are the cells sufficiently well separated? */
if
(
r2
/
ci
->
h
[
0
]
>
dist_min
*
dist_min
)
{
/* Interact ci's parts with cj as a cell. */
data
[
0
]
=
ci
;
data
[
1
]
=
cj
;
tid
=
qsched_addtask
(
s
,
task_type_pair_pc
,
task_flag_none
,
data
,
sizeof
(
struct
cell
*
)
*
2
,
ci
->
count
);
qsched_addlock
(
s
,
tid
,
ci
->
res
);
qsched_addunlock
(
s
,
cj
->
com_tid
,
tid
);
/* Interact cj's parts with ci as a cell. */
data
[
0
]
=
cj
;
data
[
1
]
=
ci
;
tid
=
qsched_addtask
(
s
,
task_type_pair_pc
,
task_flag_none
,
data
,
sizeof
(
struct
cell
*
)
*
2
,
ci
->
count
);
qsched_addlock
(
s
,
tid
,
cj
->
res
);
qsched_addunlock
(
s
,
ci
->
com_tid
,
tid
);
}
/* Does this task need to be broken-down further? */
if
(
r2
/
ci
->
h
[
0
]
<
dist_min
*
dist_min
&&
ci
->
split
&&
cj
->
split
&&
ci
->
count
>
task_limit
&&
cj
->
count
>
task_limit
)
{
else
if
(
ci
->
split
&&
cj
->
split
&&
ci
->
count
>
task_limit
&&
cj
->
count
>
task_limit
)
{
/* Loop over all pairs between ci and cj's progeny. */
for
(
j
=
0
;
j
<
8
;
j
++
)
...
...
@@ -564,49 +580,27 @@ void create_tasks ( struct qsched *s , struct cell *ci , struct cell *cj ) {
}
/* Otherwise, generate a task. */
/* Otherwise, generate a
part-part
task. */
else
{
/* Can we get away with cell-part interactions? */
if
(
r2
/
ci
->
h
[
0
]
<
dist_min
*
dist_min
)
{
/* Interact ci's parts with cj as a cell. */
data
[
0
]
=
ci
;
data
[
1
]
=
cj
;
tid
=
qsched_addtask
(
s
,
task_type_pair_pc
,
task_flag_none
,
data
,
sizeof
(
struct
cell
*
)
*
2
,
ci
->
count
);
qsched_addlock
(
s
,
tid
,
ci
->
res
);
qsched_addunlock
(
s
,
cj
->
com_tid
,
tid
);
/* Interact cj's parts with ci as a cell. */
data
[
0
]
=
cj
;
data
[
1
]
=
ci
;
tid
=
qsched_addtask
(
s
,
task_type_pair_pc
,
task_flag_none
,
data
,
sizeof
(
struct
cell
*
)
*
2
,
ci
->
count
);
qsched_addlock
(
s
,
tid
,
cj
->
res
);
qsched_addunlock
(
s
,
ci
->
com_tid
,
tid
);
}
/* Nope, add a part-part interaction. */
else
{
/* Set the data. */
data
[
0
]
=
ci
;
data
[
1
]
=
cj
;
/* Set the data. */
data
[
0
]
=
ci
;
data
[
1
]
=
cj
;
/* Create the task. */
tid
=
qsched_addtask
(
s
,
task_type_pair
,
task_flag_none
,
data
,
sizeof
(
struct
cell
*
)
*
2
,
ci
->
count
*
cj
->
count
);
/* Create the task. */
tid
=
qsched_addtask
(
s
,
task_type_pair
,
task_flag_none
,
data
,
sizeof
(
struct
cell
*
)
*
2
,
ci
->
count
*
cj
->
count
);
/* Add the resources. */
qsched_addlock
(
s
,
tid
,
ci
->
res
);
qsched_addlock
(
s
,
tid
,
cj
->
res
);
/* Depend on the COMs in case this task recurses. */
if
(
ci
->
split
||
cj
->
split
)
{
qsched_addunlock
(
s
,
ci
->
com_tid
,
tid
);
qsched_addunlock
(
s
,
cj
->
com_tid
,
tid
);
}
/* Add the resources. */
qsched_addlock
(
s
,
tid
,
ci
->
res
);
qsched_addlock
(
s
,
tid
,
cj
->
res
);
/* Depend on the COMs in case this task recurses. */
if
(
ci
->
split
||
cj
->
split
)
{
qsched_addunlock
(
s
,
ci
->
com_tid
,
tid
);
qsched_addunlock
(
s
,
cj
->
com_tid
,
tid
);
}
}
}
/* otherwise, it's a 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