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
ed288f25
Commit
ed288f25
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Also put checks in place for sparts
parent
f0dd1ffb
No related branches found
No related tags found
1 merge request
!314
Timestep order
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner.c
+24
-4
24 additions, 4 deletions
src/runner.c
with
24 additions
and
4 deletions
src/runner.c
+
24
−
4
View file @
ed288f25
...
...
@@ -952,17 +952,21 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) {
struct
spart
*
restrict
sp
=
&
sparts
[
k
];
/* If particle needs to be kicked */
if
(
spart_is_
active
(
sp
,
e
))
{
if
(
spart_is_
starting
(
sp
,
e
))
{
const
integertime_t
ti_step
=
get_integer_timestep
(
sp
->
time_bin
);
const
integertime_t
ti_begin
=
get_integer_time_begin
(
ti_current
,
sp
->
time_bin
);
get_integer_time_begin
(
ti_current
+
1
,
sp
->
time_bin
);
#ifdef SWIFT_DEBUG_CHECKS
const
integertime_t
ti_end
=
get_integer_time_end
(
ti_current
,
sp
->
time_bin
);
get_integer_time_end
(
ti_current
+
1
,
sp
->
time_bin
);
if
(
ti_end
-
ti_begin
!=
ti_step
)
error
(
"Particle in wrong time-bin"
);
if
(
ti_begin
!=
ti_current
)
error
(
"Particle in wrong time-bin, ti_end=%lld, ti_begin=%lld, "
"ti_step=%lld time_bin=%d ti_current=%lld"
,
ti_end
,
ti_begin
,
ti_step
,
sp
->
time_bin
,
ti_current
);
#endif
/* do the kick */
...
...
@@ -970,6 +974,7 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) {
}
}
}
if
(
timer
)
TIMER_TOC
(
timer_kick1
);
}
...
...
@@ -1230,6 +1235,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
/* What is the next sync-point ? */
ti_end_min
=
min
(
ti_end
,
ti_end_min
);
ti_end_max
=
max
(
ti_end
,
ti_end_max
);
const
integertime_t
ti_beg
=
get_integer_time_begin
(
ti_current
+
1
,
gp
->
time_bin
);
...
...
@@ -1271,6 +1277,9 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
ti_end_min
=
min
(
ti_current
+
ti_new_step
,
ti_end_min
);
ti_end_max
=
max
(
ti_current
+
ti_new_step
,
ti_end_max
);
/* What is the next starting point for this cell ? */
ti_beg_max
=
max
(
ti_current
,
ti_beg_max
);
}
else
{
/* star particle is inactive */
const
integertime_t
ti_end
=
...
...
@@ -1279,6 +1288,12 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
/* What is the next sync-point ? */
ti_end_min
=
min
(
ti_end
,
ti_end_min
);
ti_end_max
=
max
(
ti_end
,
ti_end_max
);
const
integertime_t
ti_beg
=
get_integer_time_begin
(
ti_current
+
1
,
sp
->
time_bin
);
/* What is the next starting point for this cell ? */
ti_beg_max
=
max
(
ti_beg
,
ti_beg_max
);
}
}
}
else
{
...
...
@@ -1493,6 +1508,11 @@ void runner_do_recv_gpart(struct runner *r, struct cell *c, int timer) {
get_integer_time_end
(
ti_current
,
gparts
[
k
].
time_bin
);
ti_end_min
=
min
(
ti_end_min
,
ti_end
);
ti_end_max
=
max
(
ti_end_max
,
ti_end
);
#ifdef SWIFT_DEBUG_CHECKS
if
(
gparts
[
k
].
ti_drift
!=
ti_current
)
error
(
"Received un-drifted g-particle !"
);
#endif
}
}
...
...
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