Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
17cf7788
Commit
17cf7788
authored
Jan 29, 2016
by
Matthieu Schaller
Browse files
Added timers to the init tasks
parent
c900b14e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/runner.c
View file @
17cf7788
...
...
@@ -489,31 +489,47 @@ void runner_dogsort(struct runner *r, struct cell *c, int flags, int clock) {
* @param c The cell.
*/
void
runner_doinit
(
struct
runner
*
r
,
struct
cell
*
c
)
{
void
runner_doinit
(
struct
runner
*
r
,
struct
cell
*
c
,
int
timer
)
{
struct
part
*
p
,
*
parts
=
c
->
parts
;
const
int
count
=
c
->
count
;
const
float
t_end
=
r
->
e
->
time
;
TIMER_TIC
;
/* Recurse? */
if
(
c
->
split
)
{
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
runner_doinit
(
r
,
c
->
progeny
[
k
]);
if
(
c
->
progeny
[
k
]
!=
NULL
)
runner_doinit
(
r
,
c
->
progeny
[
k
]
,
0
);
return
;
}
else
{
/* Loop over the parts in this cell. */
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
/* Get a direct pointer on the part. */
p
=
&
parts
[
i
];
if
(
p
->
t_end
<=
t_end
)
{
/* Get ready for a density calculation */
hydro_init_part
(
p
);
/* Loop over the parts in this cell. */
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
/* Get a direct pointer on the part. */
p
=
&
parts
[
i
];
if
(
p
->
t_end
<=
t_end
)
{
/* Get ready for a density calculation */
hydro_init_part
(
p
);
}
}
}
if
(
timer
)
{
#ifdef TIMER_VERBOSE
message
(
"runner %02i: %i parts at depth %i took %.3f ms."
,
r
->
id
,
c
->
count
,
c
->
depth
,
((
double
)
TIMER_TOC
(
timer_init
))
/
CPU_TPS
*
1000
);
fflush
(
stdout
);
#else
TIMER_TOC
(
timer_init
);
#endif
}
}
/**
...
...
@@ -1026,7 +1042,7 @@ void *runner_main(void *data) {
error
(
"Unknown task subtype."
);
break
;
case
task_type_init
:
runner_doinit
(
r
,
ci
);
runner_doinit
(
r
,
ci
,
1
);
break
;
case
task_type_ghost
:
runner_doghost
(
r
,
ci
);
...
...
src/runner.h
View file @
17cf7788
...
...
@@ -52,7 +52,7 @@ void runner_dosort(struct runner *r, struct cell *c, int flag, int clock);
void
runner_dogsort
(
struct
runner
*
r
,
struct
cell
*
c
,
int
flag
,
int
clock
);
void
runner_dokick
(
struct
runner
*
r
,
struct
cell
*
c
,
int
timer
);
void
runner_dodrift
(
struct
runner
*
r
,
struct
cell
*
c
,
int
timer
);
void
runner_doinit
(
struct
runner
*
r
,
struct
cell
*
c
);
void
runner_doinit
(
struct
runner
*
r
,
struct
cell
*
c
,
int
timer
);
void
*
runner_main
(
void
*
data
);
#endif
/* SWIFT_RUNNER_H */
src/timers.h
View file @
17cf7788
...
...
@@ -27,6 +27,7 @@
enum
{
timer_none
=
0
,
timer_prepare
,
timer_init
,
timer_drift
,
timer_kick
,
timer_dosort
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment