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
b8eac828
Commit
b8eac828
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
The task timings are now dumped to a file at the end of the simulation.
Former-commit-id: f291796e0d8ceb8ad73411bfc16f32ecae1d05e3
parent
98124124
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/test.c
+44
-46
44 additions, 46 deletions
examples/test.c
with
44 additions
and
46 deletions
examples/test.c
+
44
−
46
View file @
b8eac828
...
@@ -737,7 +737,6 @@ int main(int argc, char *argv[]) {
...
@@ -737,7 +737,6 @@ int main(int argc, char *argv[]) {
parts
[
k
].
x
[
2
]
+=
shift
[
2
];
parts
[
k
].
x
[
2
]
+=
shift
[
2
];
}
}
/* Set default number of queues. */
/* Set default number of queues. */
if
(
nr_queues
<
0
)
nr_queues
=
nr_threads
;
if
(
nr_queues
<
0
)
nr_queues
=
nr_threads
;
...
@@ -827,10 +826,10 @@ int main(int argc, char *argv[]) {
...
@@ -827,10 +826,10 @@ int main(int argc, char *argv[]) {
e
.
nr_threads
,
e
.
sched
.
nr_queues
);
e
.
nr_threads
,
e
.
sched
.
nr_queues
);
fflush
(
stdout
);
fflush
(
stdout
);
/* Legend. */
/* Legend. */
/* if (myrank == 0) */
/* if (myrank == 0) */
/* printf("# step time e_tot e_kin e_temp dt dt_step count dt_min dt_max\n"); */
/* printf("# step time e_tot e_kin e_temp dt dt_step count dt_min
* dt_max\n"); */
/* Let loose a runner on the space. */
/* Let loose a runner on the space. */
for
(
j
=
0
;
j
<
runs
&&
e
.
time
<
clock
;
j
++
)
{
for
(
j
=
0
;
j
<
runs
&&
e
.
time
<
clock
;
j
++
)
{
...
@@ -864,21 +863,22 @@ int main(int argc, char *argv[]) {
...
@@ -864,21 +863,22 @@ int main(int argc, char *argv[]) {
}
}
/* Dump a line of agregate output. */
/* Dump a line of agregate output. */
/* if (myrank == 0) { */
/* if (myrank == 0) { */
/* printf("%i %e %.16e %.16e %.16e %.3e %.3e %i %.3e %.3e", j, e.time, */
/* printf("%i %e %.16e %.16e %.16e %.3e %.3e %i %.3e %.3e", j, e.time,
/* e.ekin + e.epot, e.ekin, e.epot, e.dt, e.dt_step, e.count_step, */
*/
/* e.dt_min, e.dt_max); */
/* e.ekin + e.epot, e.ekin, e.epot, e.dt, e.dt_step,
/* for (k = 0; k < timer_count; k++) */
* e.count_step, */
/* printf(" %.3f", ((double)timers[k]) / CPU_TPS * 1000); */
/* e.dt_min, e.dt_max); */
/* printf("\n"); */
/* for (k = 0; k < timer_count; k++) */
/* fflush(stdout); */
/* printf(" %.3f", ((double)timers[k]) / CPU_TPS * 1000); */
/* } */
/* printf("\n"); */
/* fflush(stdout); */
/* } */
if
(
myrank
==
0
)
{
if
(
myrank
==
0
)
{
if
(
j
==
0
)
if
(
j
==
0
)
printf
(
"# Step Time time-step CPU Wall-clock time [ms]
\n
"
);
printf
(
"# Step Time time-step CPU Wall-clock time [ms]
\n
"
);
printf
(
"%i %e %.3e"
,
j
,
e
.
time
,
e
.
dt
);
printf
(
"%i %e %.3e"
,
j
,
e
.
time
,
e
.
dt
);
printf
(
" %.3f"
,
((
double
)
timers
[
timer_count
-
1
])
/
CPU_TPS
*
1000
);
printf
(
" %.3f"
,
((
double
)
timers
[
timer_count
-
1
])
/
CPU_TPS
*
1000
);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
fflush
(
stdout
);
fflush
(
stdout
);
}
}
...
@@ -898,39 +898,37 @@ int main(int argc, char *argv[]) {
...
@@ -898,39 +898,37 @@ int main(int argc, char *argv[]) {
(
double
)
runner_hist_bins
[
k
]);
(
double
)
runner_hist_bins
[
k
]);
#endif
#endif
/* Dump the task data. */
/* Dump the task data. */
FILE
*
file
=
fopen
(
"thread_info.dat"
,
"w"
);
#ifdef WITH_MPI
#ifdef WITH_MPI
for
(
j
=
0
;
j
<
nr_nodes
;
j
++
)
{
for
(
j
=
0
;
j
<
nr_nodes
;
j
++
)
{
MPI_Barrier
(
MPI_COMM_WORLD
);
MPI_Barrier
(
MPI_COMM_WORLD
);
if
(
j
==
myrank
)
{
if
(
j
==
myrank
)
{
printf
(
" %03i 0 0 0 0 %lli 0 0 0 0
\n
"
,
myrank
,
e
.
tic_step
);
printf
(
" %03i 0 0 0 0 %lli 0 0 0 0
\n
"
,
myrank
,
e
.
tic_step
);
for
(
k
=
0
;
k
<
e
.
sched
.
nr_tasks
;
k
++
)
for
(
k
=
0
;
k
<
e
.
sched
.
nr_tasks
;
k
++
)
if
(
!
e
.
sched
.
tasks
[
k
].
skip
&&
!
e
.
sched
.
tasks
[
k
].
implicit
)
if
(
!
e
.
sched
.
tasks
[
k
].
skip
&&
!
e
.
sched
.
tasks
[
k
].
implicit
)
printf
(
" %03i %i %i %i %i %lli %lli %i %i %i
\n
"
,
fprintf
(
myrank
,
file
,
" %03i %i %i %i %i %lli %lli %i %i %i
\n
"
,
myrank
,
e
.
sched
.
tasks
[
k
].
rid
,
e
.
sched
.
tasks
[
k
].
type
,
e
.
sched
.
tasks
[
k
].
rid
,
e
.
sched
.
tasks
[
k
].
type
,
e
.
sched
.
tasks
[
k
].
subtype
,
e
.
sched
.
tasks
[
k
].
subtype
,
(
e
.
sched
.
tasks
[
k
].
cj
==
NULL
),
(
e
.
sched
.
tasks
[
k
].
cj
==
NULL
)
,
e
.
sched
.
tasks
[
k
].
tic
,
e
.
sched
.
tasks
[
k
].
tic
,
e
.
sched
.
tasks
[
k
].
toc
,
e
.
sched
.
tasks
[
k
].
toc
,
e
.
sched
.
tasks
[
k
].
ci
->
count
,
e
.
sched
.
tasks
[
k
].
ci
->
count
,
(
e
.
sched
.
tasks
[
k
].
cj
!=
NULL
)
?
e
.
sched
.
tasks
[
k
].
cj
->
count
:
0
,
(
e
.
sched
.
tasks
[
k
].
cj
!=
NULL
)
?
e
.
sched
.
tasks
[
k
].
cj
->
count
:
0
,
e
.
sched
.
tasks
[
k
].
flags
);
e
.
sched
.
tasks
[
k
].
flags
);
fflush
(
stdout
);
fflush
(
stdout
);
sleep
(
1
);
sleep
(
1
);
}
}
}
}
#else
#else
for
(
k
=
0
;
k
<
e
.
sched
.
nr_tasks
;
k
++
)
for
(
k
=
0
;
k
<
e
.
sched
.
nr_tasks
;
k
++
)
if
(
!
e
.
sched
.
tasks
[
k
].
skip
&&
!
e
.
sched
.
tasks
[
k
].
implicit
)
if
(
!
e
.
sched
.
tasks
[
k
].
skip
&&
!
e
.
sched
.
tasks
[
k
].
implicit
)
fprintf
(
stderr
,
" %i %i %i %i %lli %lli %i %i
\n
"
,
fprintf
(
file
,
" %i %i %i %i %lli %lli %i %i
\n
"
,
e
.
sched
.
tasks
[
k
].
rid
,
e
.
sched
.
tasks
[
k
].
rid
,
e
.
sched
.
tasks
[
k
].
type
,
e
.
sched
.
tasks
[
k
].
type
,
e
.
sched
.
tasks
[
k
].
subtype
,
e
.
sched
.
tasks
[
k
].
subtype
,
(
e
.
sched
.
tasks
[
k
].
cj
==
NULL
),
e
.
sched
.
tasks
[
k
].
tic
,
(
e
.
sched
.
tasks
[
k
].
cj
==
NULL
)
,
e
.
sched
.
tasks
[
k
].
tic
,
e
.
sched
.
tasks
[
k
].
toc
,
e
.
sched
.
tasks
[
k
].
ci
->
count
,
e
.
sched
.
tasks
[
k
].
toc
,
(
e
.
sched
.
tasks
[
k
].
cj
==
NULL
)
?
0
:
e
.
sched
.
tasks
[
k
].
cj
->
count
);
e
.
sched
.
tasks
[
k
].
ci
->
count
,
(
e
.
sched
.
tasks
[
k
].
cj
==
NULL
)
?
0
:
e
.
sched
.
tasks
[
k
].
cj
->
count
);
#endif
#endif
fclose
(
file
);
/* Write final output. */
/* Write final output. */
#if defined(WITH_MPI)
#if defined(WITH_MPI)
...
...
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