Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
21db2b12
Commit
21db2b12
authored
Jul 08, 2011
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ModSim ass4 taddeus: some final changes to MPI python scripts.
parent
7f895397
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
20 deletions
+15
-20
modsim/ass4_taddeus/vibstring/Makefile
modsim/ass4_taddeus/vibstring/Makefile
+1
-1
modsim/ass4_taddeus/vibstring/combine.py
modsim/ass4_taddeus/vibstring/combine.py
+9
-10
modsim/ass4_taddeus/vibstring/draw.py
modsim/ass4_taddeus/vibstring/draw.py
+5
-9
No files found.
modsim/ass4_taddeus/vibstring/Makefile
View file @
21db2b12
...
...
@@ -7,4 +7,4 @@ seq: seq.o
par
:
par.o
clean
:
rm
-vf
*
.o
seq
par
rm
-vf
*
.o
seq
par
out
*
.txt
modsim/ass4_taddeus/vibstring/combine.py
100644 → 100755
View file @
21db2b12
#!/usr/bin/env python
from
sys
import
argv
,
exit
def
combine
(
numfiles
):
files
=
range
(
int
(
numfiles
))
lines
=
[
open
(
'out%d.txt'
%
i
).
readlines
()
for
i
in
files
]
return
[
' '
.
join
([
lines
[
j
][
i
][:
-
1
]
for
j
in
files
])
for
i
in
range
(
len
(
lines
[
0
]))]
if
__name__
==
'__main__'
:
if
len
(
argv
)
<
2
:
if
len
(
argv
)
<
2
:
print
'Usage: python %s TASKS'
%
argv
[
0
]
exit
()
print
'
\
n
'
.
join
(
combine
(
argv
[
1
]))
files
=
range
(
int
(
argv
[
1
]))
lines
=
[
open
(
'out%d.txt'
%
i
).
readlines
()
for
i
in
files
]
lines
=
[
' '
.
join
([
lines
[
j
][
i
][:
-
1
]
for
j
in
files
])
for
i
in
range
(
len
(
lines
[
0
]))]
print
'
\
n
'
.
join
(
lines
)
modsim/ass4_taddeus/vibstring/draw.py
View file @
21db2b12
...
...
@@ -2,20 +2,16 @@
from
sys
import
stdin
,
argv
,
exit
from
pylab
import
figure
,
plot
,
axis
,
draw
,
ion
,
clf
from
time
import
sleep
from
combine
import
combine
if
len
(
argv
)
<
3
:
print
'Usage: python %s T
ASKS T
IME_STEP [ DELAY ]'
%
argv
[
0
]
if
len
(
argv
)
<
2
:
print
'Usage: python %s TIME_STEP [ DELAY ]'
%
argv
[
0
]
exit
()
# tasks = 0 means sequential, above means parallel and having to combine the
# different output files
lines
=
combine
(
int
(
argv
[
1
]))
if
int
(
argv
[
1
])
else
stdin
.
readlines
()
stride
=
int
(
argv
[
2
])
delay
=
.
1
if
len
(
argv
)
<
4
else
float
(
argv
[
3
])
stride
=
int
(
argv
[
1
])
delay
=
.
1
if
len
(
argv
)
<
3
else
float
(
argv
[
2
])
# Collect data
lines
=
stdin
.
readlines
()
y
=
[]
x
=
map
(
float
,
lines
[
0
].
split
(
' '
))
for
line
in
lines
[
1
::
stride
]:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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