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
c4df98e7
Commit
c4df98e7
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Only call the vectorized SEFL routine for Gadget-2 SPH.
parent
3ee51c2b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cache.h
+4
-0
4 additions, 0 deletions
src/cache.h
src/runner.c
+1
-1
1 addition, 1 deletion
src/runner.c
src/tools.c
+10
-0
10 additions, 0 deletions
src/tools.c
with
15 additions
and
1 deletion
src/cache.h
+
4
−
0
View file @
c4df98e7
...
@@ -143,6 +143,8 @@ __attribute__((always_inline)) INLINE void cache_init(struct cache *c,
...
@@ -143,6 +143,8 @@ __attribute__((always_inline)) INLINE void cache_init(struct cache *c,
__attribute__
((
always_inline
))
INLINE
void
cache_read_particles
(
__attribute__
((
always_inline
))
INLINE
void
cache_read_particles
(
const
struct
cell
*
const
ci
,
struct
cache
*
const
ci_cache
)
{
const
struct
cell
*
const
ci
,
struct
cache
*
const
ci_cache
)
{
#if defined(GADGET2_SPH)
/* Shift the particles positions to a local frame so single precision can be
/* Shift the particles positions to a local frame so single precision can be
* used instead of double precision. */
* used instead of double precision. */
for
(
int
i
=
0
;
i
<
ci
->
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
ci
->
count
;
i
++
)
{
...
@@ -156,6 +158,8 @@ __attribute__((always_inline)) INLINE void cache_read_particles(
...
@@ -156,6 +158,8 @@ __attribute__((always_inline)) INLINE void cache_read_particles(
ci_cache
->
vy
[
i
]
=
ci
->
parts
[
i
].
v
[
1
];
ci_cache
->
vy
[
i
]
=
ci
->
parts
[
i
].
v
[
1
];
ci_cache
->
vz
[
i
]
=
ci
->
parts
[
i
].
v
[
2
];
ci_cache
->
vz
[
i
]
=
ci
->
parts
[
i
].
v
[
2
];
}
}
#endif
}
}
#endif
/* SWIFT_CACHE_H */
#endif
/* SWIFT_CACHE_H */
This diff is collapsed.
Click to expand it.
src/runner.c
+
1
−
1
View file @
c4df98e7
...
@@ -1095,7 +1095,7 @@ void *runner_main(void *data) {
...
@@ -1095,7 +1095,7 @@ void *runner_main(void *data) {
switch
(
t
->
type
)
{
switch
(
t
->
type
)
{
case
task_type_self
:
case
task_type_self
:
if
(
t
->
subtype
==
task_subtype_density
)
{
if
(
t
->
subtype
==
task_subtype_density
)
{
#ifdef
WITH_VECTORIZATION
#if
def
ined(
WITH_VECTORIZATION
) && defined(GADGET2_SPH)
runner_doself1_density_vec
(
r
,
ci
);
runner_doself1_density_vec
(
r
,
ci
);
#else
#else
runner_doself1_density
(
r
,
ci
);
runner_doself1_density
(
r
,
ci
);
...
...
This diff is collapsed.
Click to expand it.
src/tools.c
+
10
−
0
View file @
c4df98e7
...
@@ -600,6 +600,9 @@ int compare_values(double a, double b, double threshold, double *absDiff,
...
@@ -600,6 +600,9 @@ int compare_values(double a, double b, double threshold, double *absDiff,
* @return 1 if difference found, 0 otherwise
* @return 1 if difference found, 0 otherwise
*/
*/
int
compare_particles
(
struct
part
a
,
struct
part
b
,
double
threshold
)
{
int
compare_particles
(
struct
part
a
,
struct
part
b
,
double
threshold
)
{
#ifdef GADGET2_SPH
int
result
=
0
;
int
result
=
0
;
double
absDiff
=
0
.
0
,
absSum
=
0
.
0
,
relDiff
=
0
.
0
;
double
absDiff
=
0
.
0
,
absSum
=
0
.
0
,
relDiff
=
0
.
0
;
...
@@ -720,6 +723,13 @@ int compare_particles(struct part a, struct part b, double threshold) {
...
@@ -720,6 +723,13 @@ int compare_particles(struct part a, struct part b, double threshold) {
}
}
return
result
;
return
result
;
#else
error
(
"Function not supported for this flavour of SPH"
);
return
0
;
#endif
}
}
/** @brief Computes the forces between all g-particles using the N^2 algorithm
/** @brief Computes the forces between all g-particles using the N^2 algorithm
...
...
This diff is collapsed.
Click to expand it.
Matthieu Schaller
@matthieu
mentioned in merge request
!287 (merged)
·
8 years ago
mentioned in merge request
!287 (merged)
mentioned in merge request !287
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