-
Notifications
You must be signed in to change notification settings - Fork 240
/
benchmark_beam.py
80 lines (52 loc) · 1.92 KB
/
benchmark_beam.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
"""
This benchmark documents a performance problem with data transfers that needs to be examined.
"""
import unittest
import openmdao.api as om
from openmdao.test_suite.test_examples.beam_optimization.multipoint_beam_group import MultipointBeamGroup
class BenchBeamNP1(unittest.TestCase):
N_PROCS = 1
def benchmark_beam_np1(self):
E = 1.
L = 1.
b = 0.1
volume = 0.01
num_elements = 50 * 32
num_cp = 4
num_load_cases = 32
prob = om.Problem(model=MultipointBeamGroup(E=E, L=L, b=b, volume=volume,
num_elements=num_elements, num_cp=num_cp,
num_load_cases=num_load_cases))
prob.setup()
prob.run_model()
class BenchBeamNP2(unittest.TestCase):
N_PROCS = 2
def benchmark_beam_np2(self):
E = 1.
L = 1.
b = 0.1
volume = 0.01
num_elements = 50 * 32
num_cp = 4
num_load_cases = 32
prob = om.Problem(model=MultipointBeamGroup(E=E, L=L, b=b, volume=volume,
num_elements=num_elements, num_cp=num_cp,
num_load_cases=num_load_cases))
prob.setup()
prob.run_model()
@unittest.skip("for debugging, not for routine benchmarking")
class BenchBeamNP4(unittest.TestCase):
N_PROCS = 4
def benchmark_beam_np4(self):
E = 1.
L = 1.
b = 0.1
volume = 0.01
num_elements = 50 * 32
num_cp = 4
num_load_cases = 32
prob = om.Problem(model=MultipointBeamGroup(E=E, L=L, b=b, volume=volume,
num_elements=num_elements, num_cp=num_cp,
num_load_cases=num_load_cases))
prob.setup()
prob.run_model()