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
177b3821
Commit
177b3821
authored
8 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
add the option of dumping the timers in each time step.
parent
03b2046d
No related branches found
No related tags found
1 merge request
!327
Rebuild criteria
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/main.c
+17
-10
17 additions, 10 deletions
examples/main.c
with
17 additions
and
10 deletions
examples/main.c
+
17
−
10
View file @
177b3821
...
...
@@ -165,12 +165,13 @@ int main(int argc, char *argv[]) {
int
with_drift_all
=
0
;
int
verbose
=
0
;
int
nr_threads
=
1
;
int
with_verbose_timers
=
0
;
char
paramFileName
[
200
]
=
""
;
unsigned
long
long
cpufreq
=
0
;
/* Parse the parameters */
int
c
;
while
((
c
=
getopt
(
argc
,
argv
,
"acCdDef:FgGhn:sSt:v:y:"
))
!=
-
1
)
switch
(
c
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"acCdDef:FgGhn:sSt:
T
v:y:"
))
!=
-
1
)
switch
(
c
)
{
case
'a'
:
with_aff
=
1
;
break
;
...
...
@@ -229,6 +230,9 @@ int main(int argc, char *argv[]) {
return
1
;
}
break
;
case
'T'
:
with_verbose_timers
=
1
;
break
;
case
'v'
:
if
(
sscanf
(
optarg
,
"%d"
,
&
verbose
)
!=
1
)
{
if
(
myrank
==
0
)
printf
(
"Error parsing verbosity level (-v).
\n
"
);
...
...
@@ -600,10 +604,11 @@ int main(int argc, char *argv[]) {
printf
(
"# %6s %14s %14s %10s %10s %10s %16s [%s]
\n
"
,
"Step"
,
"Time"
,
"Time-step"
,
"Updates"
,
"g-Updates"
,
"s-Updates"
,
"Wall-clock time"
,
clocks_getunit
());
printf
(
"timers: "
);
for
(
int
k
=
0
;
k
<
timer_count
;
k
++
)
printf
(
"%s
\t
"
,
timers_names
[
k
]);
printf
(
"
\n
"
);
if
(
with_verbose_timers
)
{
printf
(
"timers: "
);
for
(
int
k
=
0
;
k
<
timer_count
;
k
++
)
printf
(
"%s
\t
"
,
timers_names
[
k
]);
printf
(
"
\n
"
);
}
}
/* Main simulation loop */
...
...
@@ -614,12 +619,14 @@ int main(int argc, char *argv[]) {
/* Take a step. */
engine_step
(
&
e
);
/* Print the timers. */
printf
(
"timers: "
);
for
(
int
k
=
0
;
k
<
timer_count
;
k
++
)
printf
(
"%.3f
\t
"
,
clocks_from_ticks
(
timers
[
k
]));
printf
(
"
\n
"
);
if
(
with_verbose_timers
)
{
printf
(
"timers: "
);
for
(
int
k
=
0
;
k
<
timer_count
;
k
++
)
printf
(
"%.3f
\t
"
,
clocks_from_ticks
(
timers
[
k
]));
printf
(
"
\n
"
);
}
#ifdef SWIFT_DEBUG_TASKS
/* Dump the task data using the given frequency. */
...
...
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