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
f4fa72c0
Commit
f4fa72c0
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Also drift foreign top-level multipoles every time-step
parent
6ea5c6b0
No related branches found
No related tags found
1 merge request
!433
Correct wrapping of multipoles in FFT task
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/engine.c
+5
-5
5 additions, 5 deletions
src/engine.c
src/runner_doiact_grav.h
+2
-2
2 additions, 2 deletions
src/runner_doiact_grav.h
src/space.c
+5
-0
5 additions, 0 deletions
src/space.c
with
12 additions
and
7 deletions
src/engine.c
+
5
−
5
View file @
f4fa72c0
...
@@ -1977,8 +1977,8 @@ void engine_make_self_gravity_tasks_mapper(void *map_data, int num_elements,
...
@@ -1977,8 +1977,8 @@ void engine_make_self_gravity_tasks_mapper(void *map_data, int num_elements,
const
int
cjd
=
cell_getid
(
cdim
,
iii
,
jjj
,
kkk
);
const
int
cjd
=
cell_getid
(
cdim
,
iii
,
jjj
,
kkk
);
struct
cell
*
cj
=
&
cells
[
cjd
];
struct
cell
*
cj
=
&
cells
[
cjd
];
if
(
i
==
11
&&
j
==
0
&&
k
==
10
)
/*
if(i==11 && j==0 && k==10)
*/
message
(
"Found direct neighbour: (i,j,k)=(%d,%d,%d) (iii,jjj,kkk)=(%d,%d,%d) nodeID=%d"
,
i
,
j
,
k
,
iii
,
jjj
,
kkk
,
cj
->
nodeID
);
/*
message("Found direct neighbour: (i,j,k)=(%d,%d,%d) (iii,jjj,kkk)=(%d,%d,%d) nodeID=%d", i,j,k, iii,jjj,kkk, cj->nodeID);
*/
/* Avoid duplicates of local pairs*/
/* Avoid duplicates of local pairs*/
...
@@ -3947,11 +3947,11 @@ void engine_step(struct engine *e) {
...
@@ -3947,11 +3947,11 @@ void engine_step(struct engine *e) {
if
(
e
->
policy
&
engine_policy_self_gravity
)
{
if
(
e
->
policy
&
engine_policy_self_gravity
)
{
for
(
int
i
=
0
;
i
<
e
->
s
->
nr_cells
;
++
i
)
for
(
int
i
=
0
;
i
<
e
->
s
->
nr_cells
;
++
i
)
num_gpart_mpole
+=
e
->
s
->
cells_top
[
i
].
multipole
->
m_pole
.
num_gpart
;
num_gpart_mpole
+=
e
->
s
->
cells_top
[
i
].
multipole
->
m_pole
.
num_gpart
;
if
(
num_gpart_mpole
!=
e
->
s
->
nr_gparts
)
if
(
num_gpart_mpole
!=
e
->
total_
nr_gparts
)
error
(
error
(
"Multipoles don't contain the total number of gpart mpoles=%zd "
"Multipoles don't contain the total number of gpart mpoles=%zd "
"ngparts=%zd"
,
"ngparts=%zd"
,
num_gpart_mpole
,
e
->
s
->
nr_gparts
);
num_gpart_mpole
,
e
->
total_
nr_gparts
);
}
}
#endif
#endif
...
@@ -4140,7 +4140,7 @@ void engine_do_drift_top_multipoles_mapper(void *map_data, int num_elements,
...
@@ -4140,7 +4140,7 @@ void engine_do_drift_top_multipoles_mapper(void *map_data, int num_elements,
for
(
int
ind
=
0
;
ind
<
num_elements
;
ind
++
)
{
for
(
int
ind
=
0
;
ind
<
num_elements
;
ind
++
)
{
struct
cell
*
c
=
&
cells
[
ind
];
struct
cell
*
c
=
&
cells
[
ind
];
if
(
c
!=
NULL
&&
c
->
nodeID
==
e
->
nodeID
)
{
if
(
c
!=
NULL
)
{
/* Drift the multipole at this level only */
/* Drift the multipole at this level only */
if
(
c
->
ti_old_multipole
!=
e
->
ti_current
)
cell_drift_multipole
(
c
,
e
);
if
(
c
->
ti_old_multipole
!=
e
->
ti_current
)
cell_drift_multipole
(
c
,
e
);
...
...
This diff is collapsed.
Click to expand it.
src/runner_doiact_grav.h
+
2
−
2
View file @
f4fa72c0
...
@@ -1241,8 +1241,8 @@ void runner_do_grav_long_range(struct runner *r, struct cell *ci, int timer) {
...
@@ -1241,8 +1241,8 @@ void runner_do_grav_long_range(struct runner *r, struct cell *ci, int timer) {
if
(
check
)
{
if
(
check
)
{
++
direct_ngbs
;
++
direct_ngbs
;
direct_ngbs_gpart
+=
cj
->
multipole
->
m_pole
.
num_gpart
;
direct_ngbs_gpart
+=
cj
->
multipole
->
m_pole
.
num_gpart
;
message
(
"Found direct neighbour %d: (i,j,k)=(%d,%d,%d) (ii,jj,kk)=(%d,%d,%d) nodeID=%d"
,
/*
message("Found direct neighbour %d: (i,j,k)=(%d,%d,%d) (ii,jj,kk)=(%d,%d,%d) nodeID=%d",
*/
direct_ngbs
,
i
,
j
,
k
,
ii
,
jj
,
kk
,
cj
->
nodeID
);
/*
direct_ngbs, i,j,k, ii,jj,kk, cj->nodeID);
*/
}
}
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
src/space.c
+
5
−
0
View file @
f4fa72c0
...
@@ -234,6 +234,8 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements,
...
@@ -234,6 +234,8 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements,
c
->
xparts
=
NULL
;
c
->
xparts
=
NULL
;
c
->
gparts
=
NULL
;
c
->
gparts
=
NULL
;
c
->
sparts
=
NULL
;
c
->
sparts
=
NULL
;
if
(
s
->
gravity
)
bzero
(
c
->
multipole
,
sizeof
(
struct
gravity_tensors
));
for
(
int
i
=
0
;
i
<
13
;
i
++
)
for
(
int
i
=
0
;
i
<
13
;
i
++
)
if
(
c
->
sort
[
i
]
!=
NULL
)
{
if
(
c
->
sort
[
i
]
!=
NULL
)
{
free
(
c
->
sort
[
i
]);
free
(
c
->
sort
[
i
]);
...
@@ -264,6 +266,7 @@ void space_free_cells(struct space *s) {
...
@@ -264,6 +266,7 @@ void space_free_cells(struct space *s) {
threadpool_map
(
&
s
->
e
->
threadpool
,
space_rebuild_recycle_mapper
,
s
->
cells_top
,
threadpool_map
(
&
s
->
e
->
threadpool
,
space_rebuild_recycle_mapper
,
s
->
cells_top
,
s
->
nr_cells
,
sizeof
(
struct
cell
),
0
,
s
);
s
->
nr_cells
,
sizeof
(
struct
cell
),
0
,
s
);
s
->
maxdepth
=
0
;
s
->
maxdepth
=
0
;
message
(
"Done"
);
fflush
(
stdout
);
}
}
/**
/**
...
@@ -953,6 +956,8 @@ void space_rebuild(struct space *s, int verbose) {
...
@@ -953,6 +956,8 @@ void space_rebuild(struct space *s, int verbose) {
// message( "hooking up cells took %.3f %s." ,
// message( "hooking up cells took %.3f %s." ,
// clocks_from_ticks(getticks() - tic), clocks_getunit());
// clocks_from_ticks(getticks() - tic), clocks_getunit());
message
(
"ti_old=%lld"
,
ti_old
);
/* At this point, we have the upper-level cells, old or new. Now make
/* At this point, we have the upper-level cells, old or new. Now make
sure that the parts in each cell are ok. */
sure that the parts in each cell are ok. */
space_split
(
s
,
cells_top
,
s
->
nr_cells
,
verbose
);
space_split
(
s
,
cells_top
,
s
->
nr_cells
,
verbose
);
...
...
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