Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
finam
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FINAM
finam
Commits
98ffc749
Commit
98ffc749
authored
2 years ago
by
Martin Lange
Browse files
Options
Downloads
Patches
Plain Diff
add benchmarks for run with units conversion
parent
7c18d966
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!221
Benchmark full run, profiling
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/README.md
+3
-0
3 additions, 0 deletions
benchmarks/README.md
benchmarks/run/test_run.py
+79
-35
79 additions, 35 deletions
benchmarks/run/test_run.py
with
82 additions
and
35 deletions
benchmarks/README.md
+
3
−
0
View file @
98ffc749
...
...
@@ -7,7 +7,10 @@ Note that plot panels have different units!
## Full runs
### Simple link, 365 steps
Simple run over one year with two coupled components with daily time step.
Left without, right with units conversion.
The source component copies the data array and assigns time each step.
Remaining time is data exchange and scheduling (negligible).
...
...
This diff is collapsed.
Click to expand it.
benchmarks/run/test_run.py
+
79
−
35
View file @
98ffc749
...
...
@@ -6,31 +6,26 @@ import pytest
import
finam
as
fm
class
TestSimpleRun
(
unittest
.
TestCase
):
@pytest.fixture
(
autouse
=
True
)
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
self
.
start_time
=
dt
.
datetime
(
2000
,
1
,
1
)
self
.
end_time
=
dt
.
datetime
(
2000
,
12
,
31
)
class
SimpleRunBase
(
unittest
.
TestCase
):
def
gen_data
(
self
,
t
):
d
=
self
.
data
.
copy
()
d
=
fm
.
data
.
assign_time
(
d
,
t
)
return
d
def
setup_data
(
self
,
size
):
self
.
info
=
fm
.
Info
(
time
=
None
,
grid
=
fm
.
UniformGrid
(
size
),
units
=
"
m
"
)
self
.
data
=
fm
.
data
.
full
(
0.0
,
"
input
"
,
self
.
info
,
self
.
start_time
)
self
.
info1
=
fm
.
Info
(
time
=
None
,
grid
=
fm
.
UniformGrid
(
size
),
units
=
"
m
"
)
self
.
info2
=
fm
.
Info
(
time
=
None
,
grid
=
fm
.
UniformGrid
(
size
),
units
=
"
m
"
)
self
.
data
=
fm
.
data
.
full
(
0.0
,
"
input
"
,
self
.
info1
,
self
.
start_time
)
def
run_simulation
(
self
):
source
=
fm
.
modules
.
CallbackGenerator
(
callbacks
=
{
"
Out
"
:
(
self
.
gen_data
,
self
.
info
.
copy
())},
callbacks
=
{
"
Out
"
:
(
self
.
gen_data
,
self
.
info
1
.
copy
())},
start
=
self
.
start_time
,
step
=
dt
.
timedelta
(
days
=
1
),
)
sink
=
fm
.
modules
.
DebugConsumer
(
inputs
=
{
"
In
"
:
self
.
info
.
copy
(),
"
In
"
:
self
.
info
2
.
copy
(),
},
start
=
self
.
start_time
,
step
=
dt
.
timedelta
(
days
=
1
),
...
...
@@ -43,42 +38,91 @@ class TestSimpleRun(unittest.TestCase):
self
.
composition
.
run
(
end_time
=
self
.
end_time
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_01_2x1
(
self
):
self
.
setup_data
(
size
=
(
2
,
1
))
def
run_test
(
self
,
sx
,
sy
):
self
.
setup_data
(
size
=
(
sx
,
sy
))
self
.
benchmark
(
self
.
run_simulation
)
class
TestSimpleRun
(
SimpleRunBase
):
@pytest.fixture
(
autouse
=
True
)
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
self
.
start_time
=
dt
.
datetime
(
2000
,
1
,
1
)
self
.
end_time
=
dt
.
datetime
(
2000
,
12
,
31
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_02_32x16
(
self
):
self
.
setup_data
(
size
=
(
32
,
16
))
self
.
benchmark
(
self
.
run_simulation
)
def
test_run_simple_01_2x1
(
self
):
self
.
run_test
(
2
,
1
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_03_64x32
(
self
):
self
.
setup_data
(
size
=
(
64
,
32
))
self
.
benchmark
(
self
.
run_simulation
)
def
test_run_simple_02_32x16
(
self
):
self
.
run_test
(
32
,
16
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_04_128x64
(
self
):
self
.
setup_data
(
size
=
(
128
,
64
))
self
.
benchmark
(
self
.
run_simulation
)
def
test_run_simple_03_64x32
(
self
):
self
.
run_test
(
64
,
32
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_05_256x128
(
self
):
self
.
setup_data
(
size
=
(
256
,
128
))
self
.
benchmark
(
self
.
run_simulation
)
def
test_run_simple_04_128x64
(
self
):
self
.
run_test
(
128
,
64
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_06_512x256
(
self
):
self
.
setup_data
(
size
=
(
512
,
256
))
self
.
benchmark
(
self
.
run_simulation
)
def
test_run_simple_05_256x128
(
self
):
self
.
run_test
(
256
,
128
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_07_1024x512
(
self
):
self
.
setup_data
(
size
=
(
1024
,
512
))
self
.
benchmark
(
self
.
run_simulation
)
def
test_run_simple_06_512x256
(
self
):
self
.
run_test
(
512
,
256
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_08_2048x1024
(
self
):
self
.
setup_data
(
size
=
(
2048
,
1024
))
self
.
benchmark
(
self
.
run_simulation
)
def
test_run_simple_07_1024x512
(
self
):
self
.
run_test
(
1024
,
512
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_simple_08_2048x1024
(
self
):
self
.
run_test
(
2048
,
1024
)
class
TestSimpleRunUnits
(
SimpleRunBase
):
@pytest.fixture
(
autouse
=
True
)
def
setupBenchmark
(
self
,
benchmark
):
self
.
benchmark
=
benchmark
self
.
start_time
=
dt
.
datetime
(
2000
,
1
,
1
)
self
.
end_time
=
dt
.
datetime
(
2000
,
12
,
31
)
def
setup_data
(
self
,
size
):
self
.
info1
=
fm
.
Info
(
time
=
None
,
grid
=
fm
.
UniformGrid
(
size
),
units
=
"
m
"
)
self
.
info2
=
fm
.
Info
(
time
=
None
,
grid
=
fm
.
UniformGrid
(
size
),
units
=
"
km
"
)
self
.
data
=
fm
.
data
.
full
(
0.0
,
"
input
"
,
self
.
info1
,
self
.
start_time
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_units_01_2x1
(
self
):
self
.
run_test
(
2
,
1
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_units_02_32x16
(
self
):
self
.
run_test
(
32
,
16
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_units_03_64x32
(
self
):
self
.
run_test
(
64
,
32
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_units_04_128x64
(
self
):
self
.
run_test
(
128
,
64
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_units_05_256x128
(
self
):
self
.
run_test
(
256
,
128
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_units_06_512x256
(
self
):
self
.
run_test
(
512
,
256
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_units_07_1024x512
(
self
):
self
.
run_test
(
1024
,
512
)
@pytest.mark.benchmark
(
group
=
"
run-sim
"
)
def
test_run_units_08_2048x1024
(
self
):
self
.
run_test
(
2048
,
1024
)
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