test_03.txt 3.32 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
// Two requests, two components, first requires second one, request target different one
//  Using metaparameter size in clauses with different values in requests
// Expected solution
// Request0:
//  config_0i0m0 -> r0 + cpu0_0
//  config_1i0m0 -> r1 + cpu1_0
// Request1:
//  config_1i0m0 -> 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 other of type c1
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring other.quality >= 95
        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 other of type c1
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring other.quality >= 95
        requiring compute_resource_0.cpu_1.frequency >= 14159
        providing quality = 90
        providing energy = ((0.11*(size^2))+(0.94*compute_resource_0.flops))
    }
}

component c1 {
    using property quality
    contract config_1i0m0 {
        // req0: can run on all
        // req1: can only run on r2
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.load <= (90 / size)
        // req0: fulfills c0 requirement
        // req1: fulfills req requirement
        providing quality = 1004
        providing energy = ((0.45*(size^2))+(0.34*compute_resource_0.flops))
    }
    contract config_1i0m1 {
        // req0: could run on r1
        // req1: can not run on any
        requires resource compute_resource_0 of type ComputeNode with {
            cpu_1 of type CPU
        }
        requiring compute_resource_0.cpu_1.load <= (20 / size)
        // req0: does not fulfill c0 requirement
        // req1: does not fulfill req requirement
        providing quality = 3
        providing energy = ((0.25*(size^2))+(0.34*compute_resource_0.flops))
    }
    contract config_1i0m2 {
        // req0: 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)
        // req0: would fulfill c0 requirement
        // req1: would fulfill req requirement
        providing quality = 200
        providing energy = ((0.02*(size^2))+(0.71*compute_resource_0.flops))
    }
}
107
request for c0 {
René Schöne's avatar
René Schöne committed
108
109
110
    meta size = 1
    requiring quality >= 35
}
111
request for c1 {
René Schöne's avatar
René Schöne committed
112
113
114
115
    meta size = 40
    requiring quality >= 35
}
minimize sum(energy)