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
6e1a684b
Commit
6e1a684b
authored
10 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
The particle-multipole interactions can now also be created as tasks.
parent
14252fc0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/test_fmm.c
+36
-10
36 additions, 10 deletions
examples/test_fmm.c
with
36 additions
and
10 deletions
examples/test_fmm.c
+
36
−
10
View file @
6e1a684b
...
...
@@ -38,14 +38,14 @@
/* Some local constants. */
#define cell_pool_grow 1000
#define cell_maxparts 100
#define task_limit 1
e10
#define task_limit 1
#define const_G 1 // 6.6738e-8
#define dist_min 0.5
/* Used for legacy walk only */
#define dist_cutoff_ratio 1.5
#define ICHECK -10000000
#define SANITY_CHECKS
#define
NO_
COM_AS_TASK
#define COM_AS_TASK
#define COUNTERS
/** Data structure for the particles. */
...
...
@@ -103,7 +103,7 @@ struct cell {
enum
task_type
{
task_type_self
=
0
,
task_type_pair
,
task_type_
self
_pc
,
task_type_
pair
_pc
,
task_type_com
,
task_type_count
};
...
...
@@ -939,6 +939,33 @@ void create_tasks(struct qsched *s, struct cell *ci, struct cell *cj) {
/* Are the cells NOT neighbours ? */
if
(
!
are_neighbours
(
ci
,
cj
))
{
/* We can do particle-monopole tasks */
/* Create the task. */
data
[
0
]
=
ci
;
data
[
1
]
=
cj
;
tid
=
qsched_addtask
(
s
,
task_type_pair_pc
,
task_flag_none
,
data
,
sizeof
(
struct
cell
*
)
*
2
,
ci
->
count
);
/* Add the resource and dependance */
qsched_addlock
(
s
,
tid
,
ci
->
res
);
#ifdef COM_AS_TASK
qsched_addunlock
(
s
,
cj
->
com_tid
,
tid
);
#endif
/* Create the other task. */
data
[
1
]
=
ci
;
data
[
0
]
=
cj
;
tid
=
qsched_addtask
(
s
,
task_type_pair_pc
,
task_flag_none
,
data
,
sizeof
(
struct
cell
*
)
*
2
,
cj
->
count
);
/* Add the resource and dependance */
qsched_addlock
(
s
,
tid
,
cj
->
res
);
#ifdef COM_AS_TASK
qsched_addunlock
(
s
,
ci
->
com_tid
,
tid
);
#endif
}
else
{
/* Cells are direct neighbours */
/* Are both cells split and we are above the task limit ? */
...
...
@@ -1253,8 +1280,8 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) {
case
task_type_pair
:
iact_pair
(
d
[
0
],
d
[
1
]);
break
;
case
task_type_
self
_pc
:
//
iact_
self
_pc(d[0], d[1]
, NULL
);
case
task_type_
pair
_pc
:
iact_
pair
_pc
(
d
[
0
],
d
[
1
]);
break
;
case
task_type_com
:
comp_com
(
d
[
0
]);
...
...
@@ -1392,13 +1419,12 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) {
/* root->parts[ICHECK].a_legacy[0], root->parts[ICHECK].a_legacy[1], */
/* root->parts[ICHECK].a_legacy[2]); */
/* #endif */
printf
(
"task counts: [ %
8
s %
8
s %
8
s %
8
s %
8
s ]
\n
"
,
"self"
,
"pair"
,
"m-poles"
,
printf
(
"task counts: [ %
10
s %
10
s %
10
s %
10
s %
10
s ]
\n
"
,
"self"
,
"pair"
,
"m-poles"
,
"direct"
,
"CoMs"
);
printf
(
"task counts: [ %
8
i %
8
i %
8
i %
8
i %
8
i ] (legacy).
\n
"
,
0
,
0
,
printf
(
"task counts: [ %
10
i %
10
i %
10
i %
10
i %
10
i ] (legacy).
\n
"
,
0
,
0
,
countMultipoles
,
countPairs
,
countCoMs
);
printf
(
"task counts: [ "
);
for
(
k
=
0
;
k
<
task_type_count
;
k
++
)
printf
(
"%8i "
,
counts
[
k
]);
printf
(
"] (new).
\n
"
);
printf
(
"task counts: [ %10i %10i %10i %10i %10i ] (legacy).
\n
"
,
counts
[
0
],
counts
[
1
],
counts
[
2
],
0
,
counts
[
3
]);
/* Loop over the number of runs. */
for
(
k
=
0
;
k
<
runs
;
k
++
)
{
...
...
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