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
b35e5126
Commit
b35e5126
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Prevent floating point excetion involving the padded gravity caches
parent
33bbf9ff
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gravity_cache.h
+4
-4
4 additions, 4 deletions
src/gravity_cache.h
src/runner_doiact_grav.h
+6
-6
6 additions, 6 deletions
src/runner_doiact_grav.h
with
10 additions
and
10 deletions
src/gravity_cache.h
+
4
−
4
View file @
b35e5126
...
...
@@ -131,7 +131,7 @@ static INLINE void gravity_cache_init(struct gravity_cache *c, int count) {
*/
__attribute__
((
always_inline
))
INLINE
void
gravity_cache_populate
(
struct
gravity_cache
*
c
,
const
struct
gpart
*
restrict
gparts
,
int
gcount
,
int
gcount_padded
,
const
double
shift
[
3
])
{
int
gcount_padded
,
const
double
shift
[
3
]
,
const
struct
cell
*
cell
)
{
/* Make the compiler understand we are in happy vectorization land */
float
*
restrict
x
=
c
->
x
;
...
...
@@ -161,9 +161,9 @@ __attribute__((always_inline)) INLINE void gravity_cache_populate(
/* Pad the caches */
for
(
int
i
=
gcount
;
i
<
gcount_padded
;
++
i
)
{
x
[
i
]
=
0
.
f
;
y
[
i
]
=
0
.
f
;
z
[
i
]
=
0
.
f
;
x
[
i
]
=
-
3
.
f
*
cell
->
width
[
0
]
;
y
[
i
]
=
-
3
.
f
*
cell
->
width
[
0
]
;
z
[
i
]
=
-
3
.
f
*
cell
->
width
[
0
]
;
epsilon
[
i
]
=
0
.
f
;
m
[
i
]
=
0
.
f
;
}
...
...
This diff is collapsed.
Click to expand it.
src/runner_doiact_grav.h
+
6
−
6
View file @
b35e5126
...
...
@@ -194,9 +194,9 @@ void runner_dopair_grav_pp_full(struct runner *r, struct cell *ci,
/* Fill the caches */
gravity_cache_populate
(
ci_cache
,
gparts_i
,
gcount_i
,
gcount_padded_i
,
loc_mean
);
loc_mean
,
ci
);
gravity_cache_populate
(
cj_cache
,
gparts_j
,
gcount_j
,
gcount_padded_j
,
loc_mean
);
loc_mean
,
cj
);
/* Ok... Here we go ! */
...
...
@@ -542,9 +542,9 @@ void runner_dopair_grav_pp_truncated(struct runner *r, struct cell *ci,
/* Fill the caches */
gravity_cache_populate
(
ci_cache
,
gparts_i
,
gcount_i
,
gcount_padded_i
,
loc_mean
);
loc_mean
,
ci
);
gravity_cache_populate
(
cj_cache
,
gparts_j
,
gcount_j
,
gcount_padded_j
,
loc_mean
);
loc_mean
,
cj
);
/* Ok... Here we go ! */
...
...
@@ -941,7 +941,7 @@ void runner_doself_grav_pp_full(struct runner *r, struct cell *c) {
/* Computed the padded counts */
const
int
gcount_padded
=
gcount
-
(
gcount
%
VEC_SIZE
)
+
VEC_SIZE
;
gravity_cache_populate
(
ci_cache
,
gparts
,
gcount
,
gcount_padded
,
loc
);
gravity_cache_populate
(
ci_cache
,
gparts
,
gcount
,
gcount_padded
,
loc
,
c
);
/* Ok... Here we go ! */
...
...
@@ -1155,7 +1155,7 @@ void runner_doself_grav_pp_truncated(struct runner *r, struct cell *c) {
/* Computed the padded counts */
const
int
gcount_padded
=
gcount
-
(
gcount
%
VEC_SIZE
)
+
VEC_SIZE
;
gravity_cache_populate
(
ci_cache
,
gparts
,
gcount
,
gcount_padded
,
loc
);
gravity_cache_populate
(
ci_cache
,
gparts
,
gcount
,
gcount_padded
,
loc
,
c
);
/* Ok... Here we go ! */
...
...
This diff is collapsed.
Click to expand it.
Matthieu Schaller
@matthieu
mentioned in issue
#356 (closed)
·
7 years ago
mentioned in issue
#356 (closed)
mentioned in issue #356
Toggle commit list
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