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
7e10f43e
Commit
7e10f43e
authored
Jul 10, 2011
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ModSim ass4 taddeus: Finished benchmark script.
parent
3f2e25b4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
12 deletions
+28
-12
modsim/ass4_taddeus/vibstring/.gitignore
modsim/ass4_taddeus/vibstring/.gitignore
+1
-1
modsim/ass4_taddeus/vibstring/benchmark.sh
modsim/ass4_taddeus/vibstring/benchmark.sh
+10
-4
modsim/ass4_taddeus/vibstring/plot_benchmark.py
modsim/ass4_taddeus/vibstring/plot_benchmark.py
+17
-7
No files found.
modsim/ass4_taddeus/vibstring/.gitignore
View file @
7e10f43e
seq
seq
par
par
out
*.txt
*.txt
modsim/ass4_taddeus/vibstring/benchmark.sh
View file @
7e10f43e
#!/bin/bash
#!/bin/bash
if
[
$#
-lt
3
]
;
then
if
[
$#
-lt
3
]
;
then
echo
"Usage: bash
$0
MAX STEP STRING_STEPS"
echo
"Usage: bash
$0
RESULTS_FILE
MAX STEP STRING_STEPS"
exit
1
exit
1
fi
fi
dx
=
`
echo
"1/
$3
"
| bc
-l
`
REPEAT
=
3
dx
=
`
echo
"1/
$4
"
| bc
-l
`
args
=
"sinus 1000 1
$dx
1 2"
args
=
"sinus 1000 1
$dx
1 2"
# Execute sequential program
# Execute sequential program
#/usr/bin/time -f "%e" --quiet ./seq $args
#/usr/bin/time -f "%e" --quiet ./seq $args
# Clear results file
echo
""
>
$1
# Execute parallel program for different numbers of nodes
# Execute parallel program for different numbers of nodes
for
((
i
=
2
;
i <
=
$1
;
i +
=
$2
))
;
do
for
((
i
=
2
;
i <
=
$2
;
i +
=
$3
))
;
do
echo
`
/usr/bin/time
-f
"
$i
%e"
--quiet
./par.sh
$i
$args
`
for
j
in
seq
$REPEAT
;
do
/usr/bin/time
-f
"
$i
%e"
--quiet
-ao
$1
./par.sh
$i
$args
done
done
done
modsim/ass4_taddeus/vibstring/plot_benchmark.py
View file @
7e10f43e
#!/usr/bin/env python
#!/usr/bin/env python
from
sys
import
stdin
,
argv
from
sys
import
stdin
,
argv
,
exit
from
pylab
import
plot
,
show
,
savefig
from
pylab
import
plot
,
show
,
savefig
if
len
(
argv
)
<
2
:
print
'Usage: python %s BENCHMARK_FILE'
%
argv
[
0
]
exit
(
1
)
# Collect data
# Collect data
x
=
[]
x
=
[]
y
=
[]
y
=
[]
print
stdin
.
readlines
()
results
=
open
(
argv
[
1
])
for
line
in
stdin
.
readlines
():
n
,
t
=
line
.
split
(
' '
)
for
line
in
results
.
readlines
()[
1
:]:
n
,
t
=
line
[:
-
1
].
split
(
' '
)
# Use the minimum of all measurements
if
len
(
x
)
and
x
[
-
1
]
is
int
(
n
)
and
y
[
-
1
]
>
float
(
t
):
y
[
-
1
]
=
float
(
t
)
continue
x
.
append
(
int
(
n
))
x
.
append
(
int
(
n
))
y
.
append
(
float
(
t
))
y
.
append
(
float
(
t
))
# Plot data
# Plot data
print
x
,
y
plot
(
x
,
y
,
'o-'
)
plot
(
x
,
y
,
'o-'
)
if
len
(
argv
)
==
2
:
if
len
(
argv
)
==
3
:
savefig
(
argv
[
1
])
savefig
(
argv
[
2
])
show
()
show
()
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