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
b3575963
Commit
b3575963
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Correct timers and documentation
parent
a26e112a
No related branches found
No related tags found
1 merge request
!420
Gravity speedup
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/gravity_cache.h
+8
-0
8 additions, 0 deletions
src/gravity_cache.h
src/timers.c
+5
-3
5 additions, 3 deletions
src/timers.c
src/timers.h
+1
-0
1 addition, 0 deletions
src/timers.h
with
14 additions
and
3 deletions
src/gravity_cache.h
+
8
−
0
View file @
b3575963
...
...
@@ -132,12 +132,19 @@ static INLINE void gravity_cache_init(struct gravity_cache *c, int count) {
/**
* @brief Fills a #gravity_cache structure with some #gpart and shift them.
*
* Also checks whether the #gpart can use a M2P interaction instead of the
* more expensive P2P.
*
* @param max_active_bin The largest active bin in the current time-step.
* @param c The #gravity_cache to fill.
* @param gparts The #gpart array to read from.
* @param gcount The number of particles to read.
* @param gcount_padded The number of particle to read padded to the next
* multiple of the vector length.
* @param shift A shift to apply to all the particles.
* @param CoM The position of the multipole.
* @param r_max2 The square of the multipole radius.
* @param theta_crit2 The square of the opening angle.
*/
__attribute__
((
always_inline
))
INLINE
static
void
gravity_cache_populate
(
timebin_t
max_active_bin
,
struct
gravity_cache
*
c
,
...
...
@@ -192,6 +199,7 @@ __attribute__((always_inline)) INLINE static void gravity_cache_populate(
/**
* @brief Fills a #gravity_cache structure with some #gpart and shift them.
*
* @param max_active_bin The largest active bin in the current time-step.
* @param c The #gravity_cache to fill.
* @param gparts The #gpart array to read from.
* @param gcount The number of particles to read.
...
...
This diff is collapsed.
Click to expand it.
src/timers.c
+
5
−
3
View file @
b3575963
...
...
@@ -54,8 +54,9 @@ const char* timers_names[timer_count] = {
"dopair_density"
,
"dopair_gradient"
,
"dopair_force"
,
"dopair_grav_
pm
"
,
"dopair_grav_
branch
"
,
"dopair_grav_mm"
,
"dopair_grav_pm"
,
"dopair_grav_pp"
,
"dograv_external"
,
"dograv_down"
,
...
...
@@ -119,8 +120,9 @@ void timers_reset_all() { timers_reset(timers_mask_all); }
void
timers_print
(
int
step
)
{
fprintf
(
timers_file
,
"%d
\t
"
,
step
);
for
(
int
k
=
0
;
k
<
timer_count
;
k
++
)
fprintf
(
timers_file
,
"%.3f
\t
"
,
clocks_from_ticks
(
timers
[
k
]));
fprintf
(
timers_file
,
"%
18
.3f
"
,
clocks_from_ticks
(
timers
[
k
]));
fprintf
(
timers_file
,
"
\n
"
);
fflush
(
timers_file
);
}
/**
...
...
@@ -136,7 +138,7 @@ void timers_open_file(int rank) {
fprintf
(
timers_file
,
"# timers:
\n
# step | "
);
for
(
int
k
=
0
;
k
<
timer_count
;
k
++
)
fprintf
(
timers_file
,
"%
s
\t
"
,
timers_names
[
k
]);
fprintf
(
timers_file
,
"%
18s
"
,
timers_names
[
k
]);
fprintf
(
timers_file
,
"
\n
"
);
}
...
...
This diff is collapsed.
Click to expand it.
src/timers.h
+
1
−
0
View file @
b3575963
...
...
@@ -56,6 +56,7 @@ enum {
timer_dopair_gradient
,
timer_dopair_force
,
timer_dopair_grav_branch
,
timer_dopair_grav_mm
,
timer_dopair_grav_pm
,
timer_dopair_grav_pp
,
timer_dograv_external
,
...
...
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