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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
13444dab
Commit
13444dab
authored
Jan 19, 2017
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Check that all particles and cells have a time-step assigned at the end of the initialisation step.
parent
66da9d09
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!304
Star particle infrastructure
,
!303
MPI send/recv fixes for inactive cells
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/cell.c
+23
-0
23 additions, 0 deletions
src/cell.c
src/cell.h
+1
-0
1 addition, 0 deletions
src/cell.h
src/engine.c
+4
-0
4 additions, 0 deletions
src/engine.c
src/space.c
+13
-0
13 additions, 0 deletions
src/space.c
src/space.h
+2
-0
2 additions, 0 deletions
src/space.h
with
43 additions
and
0 deletions
src/cell.c
+
23
−
0
View file @
13444dab
...
@@ -1091,3 +1091,26 @@ void cell_drift(struct cell *c, const struct engine *e) {
...
@@ -1091,3 +1091,26 @@ void cell_drift(struct cell *c, const struct engine *e) {
/* Update the time of the last drift */
/* Update the time of the last drift */
c
->
ti_old
=
ti_current
;
c
->
ti_old
=
ti_current
;
}
}
/**
* @brief Recursively checks that all particles in a cell have a time-step
*/
void
cell_check_timesteps
(
struct
cell
*
c
)
{
#ifdef SWIFT_DEBUG_CHECKS
if
(
c
->
nodeID
!=
engine_rank
)
return
;
if
(
c
->
ti_end_min
==
0
)
error
(
"Cell without assigned time-step"
);
if
(
c
->
split
)
{
for
(
int
k
=
0
;
k
<
8
;
++
k
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
cell_check_timesteps
(
c
->
progeny
[
k
]);
}
else
{
for
(
int
i
=
0
;
i
<
c
->
count
;
++
i
)
if
(
c
->
parts
[
i
].
time_bin
==
0
)
error
(
"Particle without assigned time-bin"
);
}
#endif
}
This diff is collapsed.
Click to expand it.
src/cell.h
+
1
−
0
View file @
13444dab
...
@@ -306,5 +306,6 @@ int cell_is_drift_needed(struct cell *c, const struct engine *e);
...
@@ -306,5 +306,6 @@ int cell_is_drift_needed(struct cell *c, const struct engine *e);
int
cell_unskip_tasks
(
struct
cell
*
c
,
struct
scheduler
*
s
);
int
cell_unskip_tasks
(
struct
cell
*
c
,
struct
scheduler
*
s
);
void
cell_set_super
(
struct
cell
*
c
,
struct
cell
*
super
);
void
cell_set_super
(
struct
cell
*
c
,
struct
cell
*
super
);
void
cell_drift
(
struct
cell
*
c
,
const
struct
engine
*
e
);
void
cell_drift
(
struct
cell
*
c
,
const
struct
engine
*
e
);
void
cell_check_timesteps
(
struct
cell
*
c
);
#endif
/* SWIFT_CELL_H */
#endif
/* SWIFT_CELL_H */
This diff is collapsed.
Click to expand it.
src/engine.c
+
4
−
0
View file @
13444dab
...
@@ -2665,6 +2665,10 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) {
...
@@ -2665,6 +2665,10 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) {
clocks_gettime
(
&
time2
);
clocks_gettime
(
&
time2
);
#ifdef SWIFT_DEBUG_CHECKS
space_check_timesteps
(
e
->
s
);
#endif
/* Ready to go */
/* Ready to go */
e
->
step
=
0
;
e
->
step
=
0
;
e
->
forcerebuild
=
1
;
e
->
forcerebuild
=
1
;
...
...
...
...
This diff is collapsed.
Click to expand it.
src/space.c
+
13
−
0
View file @
13444dab
...
@@ -2007,6 +2007,19 @@ void space_check_drift_point(struct space *s, integertime_t ti_current) {
...
@@ -2007,6 +2007,19 @@ void space_check_drift_point(struct space *s, integertime_t ti_current) {
space_map_cells_pre
(
s
,
1
,
cell_check_drift_point
,
&
ti_current
);
space_map_cells_pre
(
s
,
1
,
cell_check_drift_point
,
&
ti_current
);
}
}
/**
* @brief Checks that all particles and local cells have a non-zero time-step.
*/
void
space_check_timesteps
(
struct
space
*
s
)
{
#ifdef SWIFT_DEBUG_CHECKS
for
(
int
i
=
0
;
i
<
s
->
nr_cells
;
++
i
)
{
cell_check_timesteps
(
&
s
->
cells_top
[
i
]);
}
#endif
}
/**
/**
* @brief Frees up the memory allocated for this #space
* @brief Frees up the memory allocated for this #space
*/
*/
...
...
...
...
This diff is collapsed.
Click to expand it.
src/space.h
+
2
−
0
View file @
13444dab
...
@@ -186,6 +186,8 @@ void space_init_parts(struct space *s);
...
@@ -186,6 +186,8 @@ void space_init_parts(struct space *s);
void
space_init_gparts
(
struct
space
*
s
);
void
space_init_gparts
(
struct
space
*
s
);
void
space_link_cleanup
(
struct
space
*
s
);
void
space_link_cleanup
(
struct
space
*
s
);
void
space_check_drift_point
(
struct
space
*
s
,
integertime_t
ti_current
);
void
space_check_drift_point
(
struct
space
*
s
,
integertime_t
ti_current
);
void
space_check_timesteps
(
struct
space
*
s
);
void
space_clean
(
struct
space
*
s
);
void
space_clean
(
struct
space
*
s
);
#endif
/* SWIFT_SPACE_H */
#endif
/* SWIFT_SPACE_H */
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
sign in
to comment