Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
swiftmpistepsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
swiftmpistepsim
Commits
1e3af608
Commit
1e3af608
authored
5 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Add output graphics
parent
b8562482
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
post-process.py
+44
-1
44 additions, 1 deletion
post-process.py
with
44 additions
and
1 deletion
post-process.py
+
44
−
1
View file @
1e3af608
...
@@ -28,7 +28,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
...
@@ -28,7 +28,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
"""
import
matplotlib
import
matplotlib
matplotlib
.
use
(
"
Agg
"
)
#matplotlib.use("Agg")
import
matplotlib.pyplot
as
plt
import
numpy
import
numpy
import
pylab
as
pl
import
pylab
as
pl
import
sys
import
sys
...
@@ -118,6 +119,7 @@ with open(infile, "r") as fp:
...
@@ -118,6 +119,7 @@ with open(infile, "r") as fp:
nrecvs
=
nrecvs
+
1
nrecvs
=
nrecvs
+
1
# Now output. Note we could have unmatched recv keys, we don't check for that.
# Now output. Note we could have unmatched recv keys, we don't check for that.
msends
=
[
None
]
*
nsends
with
open
(
outfile
,
"
w
"
)
as
fp
:
with
open
(
outfile
,
"
w
"
)
as
fp
:
fp
.
write
(
"
# send_logticin send_logtic send_injtic send_endtic send_dtic send_step send_rank send_otherrank send_itype send_isubtype send_tag send_size send_nr_tests send_tsum send_tmin send_tmax recv_logticin recv_logtic recv_injtic recv_endtic recv_dtic recv_step recv_rank recv_otherrank recv_itype recv_isubtype recv_tag recv_size recv_nr_tests recv_tsum recv_tmin recv_tmax
\n
"
)
fp
.
write
(
"
# send_logticin send_logtic send_injtic send_endtic send_dtic send_step send_rank send_otherrank send_itype send_isubtype send_tag send_size send_nr_tests send_tsum send_tmin send_tmax recv_logticin recv_logtic recv_injtic recv_endtic recv_dtic recv_step recv_rank recv_otherrank recv_itype recv_isubtype recv_tag recv_size recv_nr_tests recv_tsum recv_tmin recv_tmax
\n
"
)
for
key
in
keysends
:
for
key
in
keysends
:
...
@@ -125,11 +127,52 @@ with open(outfile, "w") as fp:
...
@@ -125,11 +127,52 @@ with open(outfile, "w") as fp:
if
len
(
keysends
[
key
])
==
1
and
len
(
keyrecvs
[
key
])
==
1
:
if
len
(
keysends
[
key
])
==
1
and
len
(
keyrecvs
[
key
])
==
1
:
isend
=
keysends
[
key
][
0
]
isend
=
keysends
[
key
][
0
]
irecv
=
keyrecvs
[
key
][
0
]
irecv
=
keyrecvs
[
key
][
0
]
msends
[
isend
]
=
irecv
fp
.
write
(
"
"
.
join
(
sends
[
isend
])
+
"
"
+
"
"
.
join
(
recvs
[
irecv
])
+
"
\n
"
)
fp
.
write
(
"
"
.
join
(
sends
[
isend
])
+
"
"
+
"
"
.
join
(
recvs
[
irecv
])
+
"
\n
"
)
else
:
else
:
print
"
# ERROR: found
"
,
len
(
keysends
[
key
]),
"
/
"
,
len
(
keyrecvs
[
key
]),
"
matches for key:
"
,
key
,
"
should be 1/1
"
print
"
# ERROR: found
"
,
len
(
keysends
[
key
]),
"
/
"
,
len
(
keyrecvs
[
key
]),
"
matches for key:
"
,
key
,
"
should be 1/1
"
else
:
else
:
print
"
# ERROR: missing recv key:
"
,
key
print
"
# ERROR: missing recv key:
"
,
key
print
"
# Matched sends and recvs written to file:
"
,
outfile
# Reorder recvs to same order as sends.
recvs
=
[
recvs
[
i
]
for
i
in
msends
]
# Do a plot. Display and saves the graphic, uncomment the "Agg" line above to just save.
def
doplot
(
x
,
y
,
xlabel
,
ylabel
,
title
,
outpng
):
axmax1
=
max
(
x
)
axmax2
=
max
(
y
)
axmax
=
max
([
axmax1
,
axmax2
])
fig
,
ax
=
plt
.
subplots
()
ax
.
set_xlim
(
0
,
axmax
)
ax
.
set_ylim
(
0
,
axmax
)
ax
.
plot
(
x
,
y
,
'
,
'
)
ax
.
set_xlabel
(
xlabel
)
ax
.
set_ylabel
(
ylabel
)
ax
.
set_title
(
"
SWIFTmpistepsim plot:
"
+
title
)
fig
.
tight_layout
()
plt
.
savefig
(
outpng
,
bbox_inches
=
"
tight
"
)
print
"
# Saved plot to:
"
,
outpng
plt
.
show
()
# Plot no. 1: sends injection time against time of local handoff.
send_injects
=
[
float
(
send
[
injcol
])
for
send
in
[
line
for
line
in
sends
]]
send_ends
=
[
float
(
send
[
endcol
])
for
send
in
[
line
for
line
in
sends
]]
doplot
(
send_injects
,
send_ends
,
"
Message start time
"
,
"
Message local completion time
"
,
"
local send completions
"
,
"
local_sends.png
"
)
# Plot no. 2: recv injection time against time of local handoff.
recv_injects
=
[
float
(
recv
[
injcol
])
for
recv
in
[
line
for
line
in
recvs
]]
recv_ends
=
[
float
(
recv
[
endcol
])
for
recv
in
[
line
for
line
in
recvs
]]
doplot
(
recv_injects
,
recv_ends
,
"
Message start time
"
,
"
Message local completion time
"
,
"
local recv completions
"
,
"
local_recvs.png
"
)
# Plot no. 3: send injection time against time of remote completion.
doplot
(
send_injects
,
recv_ends
,
"
Message start time
"
,
"
Global message completion time
"
,
"
message completion times
"
,
"
completions.png
"
)
sys
.
exit
(
0
)
sys
.
exit
(
0
)
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