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
9f16ab4b
Commit
9f16ab4b
authored
5 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Sort of works, does what I wanted but isn't accepted by swiftmpistepsim
parent
63cf8177
No related branches found
No related tags found
1 merge request
!7
Add a scale factor for messages
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testdata/doubledata.py
+22
-12
22 additions, 12 deletions
testdata/doubledata.py
with
22 additions
and
12 deletions
testdata/doubledata.py
+
22
−
12
View file @
9f16ab4b
...
...
@@ -88,7 +88,7 @@ with open(infile, "r") as fp:
if
line
[
0
]
==
'
#
'
:
continue
words
=
line
.
split
()
if
words
[
activationcol
]
==
0
:
if
words
[
activationcol
]
==
"
0
"
:
continue
if
words
[
itypecol
]
==
"
22
"
:
...
...
@@ -123,20 +123,26 @@ print "# Read " + str(nsends) + " sends and " + str(nrecvs) + " recvs"
msends
=
[
None
]
*
nsends
for
key
in
keysends
:
if
key
in
keyrecvs
:
isend
=
keysends
[
key
][
0
]
irecv
=
keyrecvs
[
key
][
0
]
msends
[
isend
]
=
irecv
if
len
(
keysends
[
key
])
==
1
and
len
(
keyrecvs
[
key
])
==
1
:
isend
=
keysends
[
key
][
0
]
irecv
=
keyrecvs
[
key
][
0
]
msends
[
isend
]
=
irecv
else
:
print
"
# ERROR: found
"
,
len
(
keysends
[
key
]),
"
/
"
,
len
(
keyrecvs
[
key
]),
"
matches for key:
"
,
key
,
"
should be 1/1
"
else
:
print
"
# ERROR: missing recv key:
"
,
key
# Reorder recvs to same order as sends.
recvs
=
[
recvs
[
i
]
for
i
in
msends
]
# Now we can split and retag.
nrecvs
=
[
recvs
[
i
]
for
i
in
msends
]
# Now we can split and retag. XXX if you run out of tags need to
# split by rank and then maybe itype and use tag count with these.
splits
=
[]
ctag
=
0
for
i
in
range
(
nsends
):
swords
=
sends
[
i
]
rwords
=
recvs
[
i
]
size
=
str
(
float
(
swords
[
sizecol
])
/
2.0
)
size
=
str
(
int
(
float
(
swords
[
sizecol
])
/
2.0
)
)
swords
[
sizecol
]
=
size
rwords
[
sizecol
]
=
size
...
...
@@ -149,10 +155,12 @@ for i in range(nsends):
ctag
=
ctag
+
1
stag
=
str
(
ctag
)
swords
[
tagcol
]
=
stag
rwords
[
tagcol
]
=
stag
splits
.
append
(
swords
)
splits
.
append
(
rwords
)
cswords
=
list
(
swords
)
cswords
[
tagcol
]
=
stag
crwords
=
list
(
rwords
)
crwords
[
tagcol
]
=
stag
splits
.
append
(
cswords
)
splits
.
append
(
crwords
)
# Sort by tic.
splits
=
sorted
(
splits
,
key
=
lambda
x
:
int
(
x
[
sticcol
]))
...
...
@@ -163,4 +171,6 @@ with open(outfile, "w") as fp:
for
line
in
splits
:
fp
.
write
(
"
"
.
join
(
line
)
+
"
\n
"
)
print
"
# Finished
"
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