test_05.txt 8.24 KB
Newer Older
René Schöne's avatar
René Schöne committed
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
// One request, target component requires two different components, each requiring two other components
//  Also more resources than needed
// Expected solution
// Request0:
//  configA0 ->         r0 + cpu0_0
//   |- configB0 ->     r1 + cpu1_0
//   |   |- configC0 -> r4 + cpu1_0
//   |   |- configD0 -> r3 + cpu1_0
//   |- configE0 ->     r2 + cpu2_0
//   |   |- configF0 -> r5 + cpu2_0
//   |   |- configG0 -> r6 + cpu2_0

container resource type ComputeNode {
    resource type CPU {
        property frequency [Hz]
        property load [%]
    }
    property flops [ops/s]
    property STATE []
}
resource r0:ComputeNode { resource cpu0_0:CPU { frequency = 2930 load = 30 } flops =   3000 }
resource r1:ComputeNode { resource cpu1_0:CPU { frequency =  930 load = 10 } flops =   3100 }
resource r2:ComputeNode { resource cpu2_0:CPU { frequency =  930 load =  2 } flops =   3200 }
resource r3:ComputeNode { resource cpu0_0:CPU { frequency = 2430 load = 30 } flops =   3300 }
resource r4:ComputeNode { resource cpu0_0:CPU { frequency = 1830 load = 40 } flops =   3400 }
resource r5:ComputeNode { resource cpu0_0:CPU { frequency =  430 load =  5 } flops =   3500 }
resource r6:ComputeNode { resource cpu0_0:CPU { frequency = 3330 load = 30 } flops =   3600 }
resource r7:ComputeNode { resource cpu0_0:CPU { frequency = 4230 load = 75 } flops = 423000 }

meta size
property energy [J]
property quality [%]

component A {
    using property quality
    contract configA0 {
        // can run only on r0, r3, r6, r7
        requires component beta of type B
        requires component epsilon of type E
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring beta.quality >= 95
        requiring epsilon.quality >= 55
        requiring compute_resource_0.cpu_1.frequency >= 2159
        providing quality = 300
        providing energy = (((0.59*(size^2))+(0.89*compute_resource_0.flops))+compute_resource_0.cpu_1.frequency)
    }
    contract configA1 {
        // not satisfied at all
        requires component beta of type B
        requires component epsilon of type E
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring beta.quality >= 95
        requiring epsilon.quality >= 55
        requiring compute_resource_0.cpu_1.frequency >= 14159
        providing quality = 90
        providing energy = ((0.11*(size^2))+(0.34*compute_resource_0.flops))
    }
}

component B {
    using property quality
    contract configB0 {
        // can run on all but r7
        requires component chi of type C
        requires component delta of type D
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring chi.quality >= 950
        requiring delta.quality >= 550
        requiring compute_resource_0.cpu_1.load <= (90 / size)
        // fulfills A requirement
        providing quality = 1004
        providing energy = ((0.45*(size^2))+(0.34*compute_resource_0.flops))
    }
    contract configB1 {
        // could run on r1, r2, r5
        requires component chi of type C
        requires component delta of type D
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring chi.quality >= 950
        requiring delta.quality >= 550
        requiring compute_resource_0.cpu_1.load <= (20 / size)
        // does not fulfill A requirement
        providing quality = 3
        providing energy = ((0.25*(size^2))+(0.14*compute_resource_0.flops))
    }
    contract configB2 {
        // not satisfied at all
        requires component chi of type C
        requires component delta of type D
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring chi.quality >= 950
        requiring delta.quality >= 550
        requiring compute_resource_0.cpu_1.load <= (1 / size)
        // would fulfill A requirement
        providing quality = 200
        providing energy = ((0.02*(size^2))+(0.11*compute_resource_0.flops))
    }
}

component C {
    using property quality
    contract configC0 {
        // can run only on r0, r3, r4, r6,r7
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.frequency >= 1759
        providing quality = 3000
        providing energy = ((0.59*(size^2))+(0.89*compute_resource_0.flops))
    }
    contract configC1 {
        // not satisfied at all
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.frequency >= 14159
        providing quality = 900
        providing energy = ((0.11*(size^2))+(0.34*compute_resource_0.flops))
    }
}

component D {
    using property quality
    contract configD0 {
        // can run only on r0, r3, r6,r7
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.frequency >= 2159
        providing quality = 3000
        providing energy = ((0.59*(size^2))+(0.89*compute_resource_0.cpu_1.frequency))
    }
    contract configD1 {
        // not satisfied at all
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.frequency >= 14159
        providing quality = 90
        providing energy = ((0.11*(size^2))+(0.34*compute_resource_0.cpu_1.frequency))
    }
}

component E {
    using property quality
    contract configE0 {
        // can run only on r1, r2, r5
        requires component phi of type F
        requires component gamma of type G
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring phi.quality >= 9500
        requiring gamma.quality >= 5500
        requiring compute_resource_0.cpu_1.frequency <= 1500
        requiring compute_resource_0.cpu_1.load <= (size + 4)
        providing quality = 70
        providing energy = ((0.59*(size^2))+(0.89*compute_resource_0.flops))
    }
    contract configE1 {
        // not satisfied at all
        requires component phi of type F
        requires component gamma of type G
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring phi.quality >= 9500
        requiring gamma.quality >= 5500
        requiring compute_resource_0.cpu_1.frequency >= 14159
        providing quality = 90
        providing energy = ((0.11*(size^2))+(0.14*compute_resource_0.flops))
    }
}

component F {
    using property quality
    contract configF0 {
        // can run only on r1, r2, r5
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.frequency <= 1159
        providing quality = 30000
        providing energy = (((0.59*(size^2))+(0.89*compute_resource_0.flops))+(2*compute_resource_0.cpu_1.frequency))
    }
    contract configF1 {
        // not satisfied at all
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.frequency >= 14159
        providing quality = 90
        providing energy = ((0.11*(size^2))+(0.34*compute_resource_0.flops))
    }
}

component G {
    using property quality
    contract configG0 {
        // can run only on r0, r3, r6,r7
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.frequency >= 2159
        providing quality = 30000
        providing energy = ((0.59*(size^2))+(0.89*compute_resource_0.flops))
    }
    contract configG1 {
        // not satisfied at all
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.frequency >= 14159
        providing quality = 90
        providing energy = ((0.11*(size^2))+(0.34*compute_resource_0.flops))
    }
}

229
request for A {
René Schöne's avatar
René Schöne committed
230
231
232
233
    meta size = 2
    requiring quality >= 35
}
minimize sum(energy)