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
f3cffb3a
Commit
f3cffb3a
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Avoid recursion in the tasks if no particle is active.
parent
3a199fe2
No related branches found
No related tags found
1 merge request
!230
Avoid recursion in the tasks if no particle is active.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner.c
+23
-3
23 additions, 3 deletions
src/runner.c
with
23 additions
and
3 deletions
src/runner.c
+
23
−
3
View file @
f3cffb3a
...
@@ -113,8 +113,12 @@ void runner_do_grav_external(struct runner *r, struct cell *c, int timer) {
...
@@ -113,8 +113,12 @@ void runner_do_grav_external(struct runner *r, struct cell *c, int timer) {
const
struct
external_potential
*
potential
=
r
->
e
->
external_potential
;
const
struct
external_potential
*
potential
=
r
->
e
->
external_potential
;
const
struct
phys_const
*
constants
=
r
->
e
->
physical_constants
;
const
struct
phys_const
*
constants
=
r
->
e
->
physical_constants
;
const
double
time
=
r
->
e
->
time
;
const
double
time
=
r
->
e
->
time
;
TIMER_TIC
;
TIMER_TIC
;
/* Anything to do here? */
if
(
c
->
ti_end_min
>
ti_current
)
return
;
/* Recurse? */
/* Recurse? */
if
(
c
->
split
)
{
if
(
c
->
split
)
{
for
(
int
k
=
0
;
k
<
8
;
k
++
)
for
(
int
k
=
0
;
k
<
8
;
k
++
)
...
@@ -391,6 +395,9 @@ void runner_do_init(struct runner *r, struct cell *c, int timer) {
...
@@ -391,6 +395,9 @@ void runner_do_init(struct runner *r, struct cell *c, int timer) {
TIMER_TIC
;
TIMER_TIC
;
/* Anything to do here? */
if
(
c
->
ti_end_min
>
ti_current
)
return
;
/* Recurse? */
/* Recurse? */
if
(
c
->
split
)
{
if
(
c
->
split
)
{
for
(
int
k
=
0
;
k
<
8
;
k
++
)
for
(
int
k
=
0
;
k
<
8
;
k
++
)
...
@@ -443,6 +450,9 @@ void runner_do_extra_ghost(struct runner *r, struct cell *c) {
...
@@ -443,6 +450,9 @@ void runner_do_extra_ghost(struct runner *r, struct cell *c) {
const
int
count
=
c
->
count
;
const
int
count
=
c
->
count
;
const
int
ti_current
=
r
->
e
->
ti_current
;
const
int
ti_current
=
r
->
e
->
ti_current
;
/* Anything to do here? */
if
(
c
->
ti_end_min
>
ti_current
)
return
;
/* Recurse? */
/* Recurse? */
if
(
c
->
split
)
{
if
(
c
->
split
)
{
for
(
int
k
=
0
;
k
<
8
;
k
++
)
for
(
int
k
=
0
;
k
<
8
;
k
++
)
...
@@ -493,6 +503,9 @@ void runner_do_ghost(struct runner *r, struct cell *c) {
...
@@ -493,6 +503,9 @@ void runner_do_ghost(struct runner *r, struct cell *c) {
TIMER_TIC
;
TIMER_TIC
;
/* Anything to do here? */
if
(
c
->
ti_end_min
>
ti_current
)
return
;
/* Recurse? */
/* Recurse? */
if
(
c
->
split
)
{
if
(
c
->
split
)
{
for
(
int
k
=
0
;
k
<
8
;
k
++
)
for
(
int
k
=
0
;
k
<
8
;
k
++
)
...
@@ -928,15 +941,22 @@ void runner_do_kick(struct runner *r, struct cell *c, int timer) {
...
@@ -928,15 +941,22 @@ void runner_do_kick(struct runner *r, struct cell *c, int timer) {
struct
gpart
*
restrict
gparts
=
c
->
gparts
;
struct
gpart
*
restrict
gparts
=
c
->
gparts
;
const
double
const_G
=
r
->
e
->
physical_constants
->
const_newton_G
;
const
double
const_G
=
r
->
e
->
physical_constants
->
const_newton_G
;
int
updated
=
0
,
g_updated
=
0
;
TIMER_TIC
;
int
ti_end_min
=
max_nr_timesteps
,
ti_end_max
=
0
;
TIMER_TIC
/* Anything to do here? */
if
(
c
->
ti_end_min
>
ti_current
)
{
c
->
updated
=
0
;
c
->
g_updated
=
0
;
return
;
}
#ifdef TASK_VERBOSE
#ifdef TASK_VERBOSE
OUT
;
OUT
;
#endif
#endif
int
updated
=
0
,
g_updated
=
0
;
int
ti_end_min
=
max_nr_timesteps
,
ti_end_max
=
0
;
/* No children? */
/* No children? */
if
(
!
c
->
split
)
{
if
(
!
c
->
split
)
{
...
...
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