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
1ef92d72
Commit
1ef92d72
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Add a unique cell ID for all the non top-level cells.
parent
b494c6d0
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/cell.c
+6
-0
6 additions, 0 deletions
src/cell.c
src/cell.h
+8
-0
8 additions, 0 deletions
src/cell.h
src/space.c
+7
-1
7 additions, 1 deletion
src/space.c
with
21 additions
and
1 deletion
src/cell.c
+
6
−
0
View file @
1ef92d72
...
@@ -182,6 +182,9 @@ int cell_pack(struct cell *restrict c, struct pcell *restrict pc) {
...
@@ -182,6 +182,9 @@ int cell_pack(struct cell *restrict c, struct pcell *restrict pc) {
pc
->
gcount
=
c
->
gcount
;
pc
->
gcount
=
c
->
gcount
;
pc
->
scount
=
c
->
scount
;
pc
->
scount
=
c
->
scount
;
c
->
tag
=
pc
->
tag
=
atomic_inc
(
&
cell_next_tag
)
%
cell_max_tag
;
c
->
tag
=
pc
->
tag
=
atomic_inc
(
&
cell_next_tag
)
%
cell_max_tag
;
#ifdef SWIFT_DEBUG_CHECKS
pc
->
cellID
=
c
->
cellID
;
#endif
/* Fill in the progeny, depth-first recursion. */
/* Fill in the progeny, depth-first recursion. */
int
count
=
1
;
int
count
=
1
;
...
@@ -227,6 +230,9 @@ int cell_unpack(struct pcell *restrict pc, struct cell *restrict c,
...
@@ -227,6 +230,9 @@ int cell_unpack(struct pcell *restrict pc, struct cell *restrict c,
c
->
gcount
=
pc
->
gcount
;
c
->
gcount
=
pc
->
gcount
;
c
->
scount
=
pc
->
scount
;
c
->
scount
=
pc
->
scount
;
c
->
tag
=
pc
->
tag
;
c
->
tag
=
pc
->
tag
;
#ifdef SWIFT_DEBUG_CHECKS
c
->
cellID
=
pc
->
cellID
;
#endif
/* Number of new cells created. */
/* Number of new cells created. */
int
count
=
1
;
int
count
=
1
;
...
...
This diff is collapsed.
Click to expand it.
src/cell.h
+
8
−
0
View file @
1ef92d72
...
@@ -113,6 +113,11 @@ struct pcell {
...
@@ -113,6 +113,11 @@ struct pcell {
/*! Relative indices of the cell's progeny. */
/*! Relative indices of the cell's progeny. */
int
progeny
[
8
];
int
progeny
[
8
];
#ifdef SWIFT_DEBUG_CHECKS
/* Cell ID (for debugging) */
int
cellID
;
#endif
}
SWIFT_STRUCT_ALIGN
;
}
SWIFT_STRUCT_ALIGN
;
/**
/**
...
@@ -406,6 +411,9 @@ struct cell {
...
@@ -406,6 +411,9 @@ struct cell {
char
do_sub_sort
;
char
do_sub_sort
;
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
/* Cell ID (for debugging) */
int
cellID
;
/*! Last (integer) time the cell's sort arrays were updated. */
/*! Last (integer) time the cell's sort arrays were updated. */
integertime_t
ti_sort
;
integertime_t
ti_sort
;
...
...
This diff is collapsed.
Click to expand it.
src/space.c
+
7
−
1
View file @
1ef92d72
...
@@ -64,6 +64,9 @@ int space_subsize_pair = space_subsize_pair_default;
...
@@ -64,6 +64,9 @@ int space_subsize_pair = space_subsize_pair_default;
int
space_subsize_self
=
space_subsize_self_default
;
int
space_subsize_self
=
space_subsize_self_default
;
int
space_subsize_self_grav
=
space_subsize_self_grav_default
;
int
space_subsize_self_grav
=
space_subsize_self_grav_default
;
int
space_maxsize
=
space_maxsize_default
;
int
space_maxsize
=
space_maxsize_default
;
#ifdef SWIFT_DEBUG_CHECKS
int
last_cell_id
;
#endif
/**
/**
* @brief Interval stack necessary for parallel particle sorting.
* @brief Interval stack necessary for parallel particle sorting.
...
@@ -463,7 +466,7 @@ void space_regrid(struct space *s, int verbose) {
...
@@ -463,7 +466,7 @@ void space_regrid(struct space *s, int verbose) {
c
->
ti_old_part
=
ti_old
;
c
->
ti_old_part
=
ti_old
;
c
->
ti_old_gpart
=
ti_old
;
c
->
ti_old_gpart
=
ti_old
;
c
->
ti_old_multipole
=
ti_old
;
c
->
ti_old_multipole
=
ti_old
;
if
(
s
->
gravity
)
c
->
multipole
=
&
s
->
multipoles_top
[
cid
];
if
(
s
->
gravity
)
c
->
multipole
=
&
s
->
multipoles_top
[
cid
];
}
}
/* Be verbose about the change. */
/* Be verbose about the change. */
...
@@ -2082,6 +2085,9 @@ void space_split_recursive(struct space *s, struct cell *c,
...
@@ -2082,6 +2085,9 @@ void space_split_recursive(struct space *s, struct cell *c,
cp
->
nodeID
=
c
->
nodeID
;
cp
->
nodeID
=
c
->
nodeID
;
cp
->
parent
=
c
;
cp
->
parent
=
c
;
cp
->
super
=
NULL
;
cp
->
super
=
NULL
;
#ifdef SWIFT_DEBUG_CHECKS
cp
->
cellID
=
last_cell_id
++
;
#endif
}
}
/* Split the cell data. */
/* Split the cell data. */
...
...
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