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
4306572d
Commit
4306572d
authored
May 20, 2016
by
Matthieu Schaller
Browse files
Make the script work also in MPI mode.
parent
f8fb297f
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/main.c
View file @
4306572d
...
...
@@ -236,8 +236,8 @@ int main(int argc, char *argv[]) {
"Executing a dry run. No i/o or time integration will be performed."
);
/* Report CPU frequency. */
cpufreq
=
clocks_get_cpufreq
();
if
(
myrank
==
0
)
{
cpufreq
=
clocks_get_cpufreq
();
message
(
"CPU frequency used for tick conversion: %llu Hz"
,
cpufreq
);
}
...
...
examples/plot_tasks_MPI.py
View file @
4306572d
...
...
@@ -119,13 +119,13 @@ data = pl.loadtxt( infile )
# Recover the start and end time
full_step
=
data
[
0
,:]
tic_step
=
int
(
full_step
[
4
])
toc_step
=
int
(
full_step
[
5
])
tic_step
=
int
(
full_step
[
5
])
toc_step
=
int
(
full_step
[
6
])
CPU_CLOCK
=
float
(
full_step
[
-
1
])
data
=
data
[
1
:,:]
print
"CPU frequency:"
,
CPU_CLOCK
/
1.e9
nranks
=
int
(
max
(
data
[:,
0
]))
+
1
print
"Number of ranks:"
,
nranks
nthread
=
int
(
max
(
data
[:,
1
]))
+
1
...
...
@@ -150,7 +150,12 @@ if delta_t == 0:
for
rank
in
range
(
nranks
):
data
=
sdata
[
sdata
[:,
0
]
==
rank
]
start_t
=
min
(
data
[:,
5
])
full_step
=
data
[
0
,:]
tic_step
=
int
(
full_step
[
5
])
toc_step
=
int
(
full_step
[
6
])
data
=
data
[
1
:,:]
start_t
=
tic_step
data
[:,
5
]
-=
start_t
data
[:,
6
]
-=
start_t
end_t
=
(
toc_step
-
start_t
)
/
CPU_CLOCK
*
1000
...
...
@@ -160,7 +165,7 @@ for rank in range(nranks):
for
i
in
range
(
nthread
):
tasks
[
i
]
=
[]
num_lines
=
pl
.
s
iz
e
(
data
)
/
10
num_lines
=
pl
.
s
hap
e
(
data
)
[
0
]
for
line
in
range
(
num_lines
):
thread
=
int
(
data
[
line
,
1
])
tasks
[
thread
].
append
({})
...
...
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