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
2ac55aea
Commit
2ac55aea
authored
8 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Created max_d for each cache.
parent
08a7e2fd
No related branches found
No related tags found
1 merge request
!320
Dopair1 vectorisation merge
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cache.h
+6
-20
6 additions, 20 deletions
src/cache.h
with
6 additions
and
20 deletions
src/cache.h
+
6
−
20
View file @
2ac55aea
...
...
@@ -85,11 +85,8 @@ struct cache {
/* Particle z velocity. */
float
*
restrict
vz
__attribute__
((
aligned
(
CACHE_ALIGN
)));
/* Maximum distance of pi particles into cj. */
float
*
restrict
max_di
__attribute__
((
aligned
(
CACHE_ALIGN
)));
/* Maximum distance of pj particles into ci. */
float
*
restrict
max_dj
__attribute__
((
aligned
(
CACHE_ALIGN
)));
/* Maximum distance of particles into neighbouring cell. */
float
*
restrict
max_d
__attribute__
((
aligned
(
CACHE_ALIGN
)));
/* Cache size. */
int
count
;
...
...
@@ -99,8 +96,6 @@ struct cache {
#ifdef DOPAIR1_AUTO_VEC
struct
cache
ci_cache
,
cj_cache
;
#else
struct
cache
cj_cache
;
#endif
/* Secondary cache struct to hold a list of interactions between two
...
...
@@ -157,8 +152,7 @@ __attribute__((always_inline)) INLINE void cache_init(struct cache *c,
free
(
c
->
vy
);
free
(
c
->
vz
);
free
(
c
->
h
);
free
(
c
->
max_di
);
free
(
c
->
max_dj
);
free
(
c
->
max_d
);
}
error
+=
posix_memalign
((
void
**
)
&
c
->
x
,
alignment
,
sizeBytes
);
...
...
@@ -169,8 +163,7 @@ __attribute__((always_inline)) INLINE void cache_init(struct cache *c,
error
+=
posix_memalign
((
void
**
)
&
c
->
vy
,
alignment
,
sizeBytes
);
error
+=
posix_memalign
((
void
**
)
&
c
->
vz
,
alignment
,
sizeBytes
);
error
+=
posix_memalign
((
void
**
)
&
c
->
h
,
alignment
,
sizeBytes
);
error
+=
posix_memalign
((
void
**
)
&
c
->
max_di
,
alignment
,
sizeBytes
);
error
+=
posix_memalign
((
void
**
)
&
c
->
max_dj
,
alignment
,
sizeBytes
);
error
+=
posix_memalign
((
void
**
)
&
c
->
max_d
,
alignment
,
sizeBytes
);
if
(
error
!=
0
)
error
(
"Couldn't allocate cache, no. of particles: %d"
,
(
int
)
count
);
...
...
@@ -424,6 +417,7 @@ __attribute__((always_inline)) INLINE void cache_read_two_cells_sorted_2(
#endif
}
}
__attribute__
((
always_inline
))
INLINE
static
void
cache_write_sorted_particles
(
const
struct
cache
*
const
ci_cache
,
const
struct
cache
*
const
cj_cache
,
const
struct
cell
*
const
ci
,
const
struct
cell
*
const
cj
,
const
struct
entry
*
restrict
sort_i
,
const
struct
entry
*
restrict
sort_j
)
{
#ifdef DOPAIR1_AUTO_VEC
...
...
@@ -472,15 +466,7 @@ static INLINE void cache_clean(struct cache *c) {
free
(
c
->
vy
);
free
(
c
->
vz
);
free
(
c
->
h
);
//free(c->rho);
//free(c->rho_dh);
//free(c->wcount);
//free(c->wcount_dh);
//free(c->div_v);
//free(c->curl_vx);
//free(c->curl_vy);
//free(c->curl_vz);
free
(
c
->
max_d
);
}
}
...
...
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