test_04.txt 3.85 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
// One request, target component requires two different components
// Expected solution
// Request0:
//  config_0i0m0 -> r0 + cpu0_0
//  config_1i0m0 -> r1 + cpu1_0
//  config_2i0m0 -> r2 + 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 = 293000
}
resource r1:ComputeNode {
    resource cpu1_0:CPU {
        frequency = 930
        load = 10
    }
    flops = 93000
}
resource r2:ComputeNode {
    resource cpu2_0:CPU {
        frequency = 930
        load = 2
    }
    flops = 93000
}
meta size
property energy [J]
property quality [%]

component c0 {
    using property quality
    contract config_0i0m0 {
        // can run only on r0
        requires component alpha of type c1
        requires component beta of type c2
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring alpha.quality >= 95
        requiring beta.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))
    }
    contract config_0i0m1 {
        // not satisfied at all
        requires component alpha of type c1
        requires component beta of type c2
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring alpha.quality >= 95
        requiring beta.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 c1 {
    using property quality
    contract config_1i0m0 {
        // can run on all
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.load <= (90 / size)
        // fulfills c0 requirement
        providing quality = 1004
        providing energy = ((0.45*(size^2))+(0.34*compute_resource_0.flops))
    }
    contract config_1i0m1 {
        // could run on r1 and r2
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.load <= (20 / size)
        // does not fulfill c0 requirement
        providing quality = 3
        providing energy = ((0.25*(size^2))+(0.14*compute_resource_0.flops))
    }
    contract config_1i0m2 {
        // not satisfied at all
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.load <= (1 / size)
        // would fulfill c0 requirement
        providing quality = 200
        providing energy = ((0.02*(size^2))+(0.11*compute_resource_0.flops))
    }
}
component c2 {
    using property quality
    contract config_2i0m0 {
        // can run only on r2
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        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 config_2i0m1 {
        // 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.14*compute_resource_0.flops))
    }
}

127
request for c0 {
René Schöne's avatar
René Schöne committed
128
129
130
131
    meta size = 2
    requiring quality >= 35
}
minimize sum(energy)