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
f73cd710
Commit
f73cd710
authored
6 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Don't use threadpool to find foreign links as it gives no performance boost currently due to locks.
parent
828b82fd
No related branches found
No related tags found
1 merge request
!543
Fof
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fof.c
+21
-7
21 additions, 7 deletions
src/fof.c
with
21 additions
and
7 deletions
src/fof.c
+
21
−
7
View file @
f73cd710
...
@@ -731,14 +731,14 @@ void fof_search_foreign_cells(struct space *s) {
...
@@ -731,14 +731,14 @@ void fof_search_foreign_cells(struct space *s) {
for
(
int
j
=
0
;
j
<
e
->
proxies
[
i
].
nr_cells_out
;
j
++
)
{
for
(
int
j
=
0
;
j
<
e
->
proxies
[
i
].
nr_cells_out
;
j
++
)
{
/* Only include gravity cells. */
/* Only include gravity cells. */
if
(
e
->
proxies
[
i
].
cells_out_type
[
j
]
==
proxy_cell_type_gravity
)
num_cells_out
++
;
if
(
e
->
proxies
[
i
].
cells_out_type
[
j
]
&
proxy_cell_type_gravity
)
num_cells_out
++
;
}
}
for
(
int
j
=
0
;
j
<
e
->
proxies
[
i
].
nr_cells_in
;
j
++
)
{
for
(
int
j
=
0
;
j
<
e
->
proxies
[
i
].
nr_cells_in
;
j
++
)
{
/* Only include gravity cells. */
/* Only include gravity cells. */
if
(
e
->
proxies
[
i
].
cells_in_type
[
j
]
==
proxy_cell_type_gravity
)
num_cells_in
++
;
if
(
e
->
proxies
[
i
].
cells_in_type
[
j
]
&
proxy_cell_type_gravity
)
num_cells_in
++
;
}
}
}
}
...
@@ -762,7 +762,7 @@ void fof_search_foreign_cells(struct space *s) {
...
@@ -762,7 +762,7 @@ void fof_search_foreign_cells(struct space *s) {
for
(
int
j
=
0
;
j
<
e
->
proxies
[
i
].
nr_cells_out
;
j
++
)
{
for
(
int
j
=
0
;
j
<
e
->
proxies
[
i
].
nr_cells_out
;
j
++
)
{
/* Skip non-gravity cells. */
/* Skip non-gravity cells. */
if
(
e
->
proxies
[
i
].
cells_out_type
[
j
]
!=
proxy_cell_type_gravity
)
continue
;
if
(
!
(
e
->
proxies
[
i
].
cells_out_type
[
j
]
&
proxy_cell_type_gravity
)
)
continue
;
struct
cell
*
restrict
local_cell
=
e
->
proxies
[
i
].
cells_out
[
j
];
struct
cell
*
restrict
local_cell
=
e
->
proxies
[
i
].
cells_out
[
j
];
...
@@ -772,7 +772,7 @@ void fof_search_foreign_cells(struct space *s) {
...
@@ -772,7 +772,7 @@ void fof_search_foreign_cells(struct space *s) {
for
(
int
k
=
0
;
k
<
e
->
proxies
[
i
].
nr_cells_in
;
k
++
)
{
for
(
int
k
=
0
;
k
<
e
->
proxies
[
i
].
nr_cells_in
;
k
++
)
{
/* Skip non-gravity cells. */
/* Skip non-gravity cells. */
if
(
e
->
proxies
[
i
].
cells_in_type
[
k
]
!=
proxy_cell_type_gravity
)
continue
;
if
(
!
(
e
->
proxies
[
i
].
cells_in_type
[
k
]
&
proxy_cell_type_gravity
)
)
continue
;
struct
cell
*
restrict
foreign_cell
=
e
->
proxies
[
i
].
cells_in
[
k
];
struct
cell
*
restrict
foreign_cell
=
e
->
proxies
[
i
].
cells_in
[
k
];
...
@@ -811,6 +811,8 @@ void fof_search_foreign_cells(struct space *s) {
...
@@ -811,6 +811,8 @@ void fof_search_foreign_cells(struct space *s) {
message
(
"Finding local/foreign cell pairs and initialising particle roots took: %.3f %s."
,
message
(
"Finding local/foreign cell pairs and initialising particle roots took: %.3f %s."
,
clocks_from_ticks
(
getticks
()
-
tic
),
clocks_getunit
());
clocks_from_ticks
(
getticks
()
-
tic
),
clocks_getunit
());
message
(
"Pairs of touching cells: %d"
,
cell_pair_count
);
tic
=
getticks
();
tic
=
getticks
();
struct
scheduler
*
sched
=
&
e
->
sched
;
struct
scheduler
*
sched
=
&
e
->
sched
;
...
@@ -843,9 +845,21 @@ void fof_search_foreign_cells(struct space *s) {
...
@@ -843,9 +845,21 @@ void fof_search_foreign_cells(struct space *s) {
tic
=
getticks
();
tic
=
getticks
();
/* Perform search of group links between local and foreign cells with the threadpool. */
/* Perform search of group links between local and foreign cells by looping over cell pairs. */
threadpool_map
(
&
s
->
e
->
threadpool
,
fof_find_foreign_links_mapper
,
cell_pairs
,
for
(
int
ind
=
0
;
ind
<
cell_pair_count
;
ind
++
)
{
cell_pair_count
,
sizeof
(
struct
cell_pair_indices
),
1
,
s
);
/* Get the local and foreign cells to recurse on. */
struct
cell
*
restrict
local_cell
=
cell_pairs
[
ind
].
local
;
struct
cell
*
restrict
foreign_cell
=
cell_pairs
[
ind
].
foreign
;
rec_fof_search_pair_foreign
(
local_cell
,
foreign_cell
,
s
,
dim
,
search_r2
,
&
s
->
fof_data
.
group_link_count
,
&
s
->
fof_data
.
group_links
,
&
s
->
fof_data
.
group_links_size
);
}
/* TODO: Perform search of group links between local and foreign cells with the threadpool. */
//threadpool_map(&s->e->threadpool, fof_find_foreign_links_mapper, cell_pairs,
// cell_pair_count, sizeof(struct cell_pair_indices), 1, s);
group_link_count
=
s
->
fof_data
.
group_link_count
;
group_link_count
=
s
->
fof_data
.
group_link_count
;
...
...
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