diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-04-14 14:20:57 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-04-14 14:20:57 -0400 |
commit | dc1a00d9d138d574d250ef8d4cf2cbcb59a592c9 (patch) | |
tree | fd786f2bfe758e9bc43f76a8341c613bbf768ffd | |
parent | 4b9db520c2817a5d0127b1111fac6855c92673da (diff) |
improve visualization of 32 cpus: more colors, better contrast, CPU numbers
-rw-r--r-- | asy/sched.asy | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/asy/sched.asy b/asy/sched.asy index 4dde796..7f64a6d 100644 --- a/asy/sched.asy +++ b/asy/sched.asy | |||
@@ -40,17 +40,53 @@ void prepare_schedule(picture pic=currentpicture, | |||
40 | } | 40 | } |
41 | 41 | ||
42 | pen[] task_fill = { | 42 | pen[] task_fill = { |
43 | rgb(1.0,0,0), | 43 | /* |
44 | rgb(0,0,1.0), | 44 | rgb(1.0,0,0), |
45 | rgb(0,1.0,0), | 45 | rgb(0,0,1.0), |
46 | rgb(1.0, 0, 1.0), | 46 | rgb(0,1.0,0), |
47 | rgb(0, 1.0, 1.0), | 47 | rgb(1.0, 0, 1.0), |
48 | rgb(1.0, 1.0, 0) | 48 | rgb(0, 1.0, 1.0), |
49 | rgb(1.0, 1.0, 0) | ||
50 | */ | ||
51 | rgb(0.0000, 0.1667, 1.0000), | ||
52 | rgb(1.0000, 0.0833, 0.0000), | ||
53 | rgb(0.0417, 1.0000, 0.0000), | ||
54 | rgb(0.9583, 0.0000, 1.0000), | ||
55 | rgb(0.9792, 1.0000, 0.0000), | ||
56 | rgb(0.0000, 1.0000, 0.8958), | ||
57 | rgb(0.3958, 0.0000, 1.0000), | ||
58 | rgb(1.0000, 0.0000, 0.4792), | ||
59 | rgb(0.6042, 1.0000, 0.0000), | ||
60 | rgb(0.0000, 0.7292, 1.0000), | ||
61 | rgb(0.0000, 1.0000, 0.3333), | ||
62 | rgb(1.0000, 0.4583, 0.0000), | ||
63 | rgb(0.0208, 0.0000, 1.0000), | ||
64 | rgb(1.0000, 0.8333, 0.0000), | ||
65 | rgb(0.2083, 0.0000, 1.0000), | ||
66 | rgb(0.7917, 1.0000, 0.0000), | ||
67 | rgb(0.5833, 0.0000, 1.0000), | ||
68 | rgb(0.4167, 1.0000, 0.0000), | ||
69 | rgb(0.7708, 0.0000, 1.0000), | ||
70 | rgb(0.2292, 1.0000, 0.0000), | ||
71 | rgb(1.0000, 0.0000, 0.8542), | ||
72 | rgb(0.0000, 1.0000, 0.1458), | ||
73 | rgb(1.0000, 0.0000, 0.6667), | ||
74 | rgb(0.0000, 1.0000, 0.5208), | ||
75 | rgb(1.0000, 0.0000, 0.2917), | ||
76 | rgb(0.0000, 1.0000, 0.7083), | ||
77 | rgb(1.0000, 0.0000, 0.1042), | ||
78 | rgb(0.0000, 0.9167, 1.0000), | ||
79 | rgb(1.0000, 0.2708, 0.0000), | ||
80 | rgb(0.0000, 0.5417, 1.0000), | ||
81 | rgb(1.0000, 0.6458, 0.0000), | ||
82 | rgb(0.0000, 0.3542, 1.0000) | ||
49 | }; | 83 | }; |
50 | 84 | ||
51 | pen[] cpu_fill = task_fill; | 85 | pen[] cpu_fill = task_fill; |
52 | 86 | ||
53 | pen grid_pen = solid + gray(0.75); | 87 | pen grid_pen = solid + gray(0.75); |
88 | |||
89 | pen cpu_label_pen = solid + rgb(0.0, 0.0, 0.0); | ||
54 | 90 | ||
55 | pen idx2color(int idx) { | 91 | pen idx2color(int idx) { |
56 | return cpu_fill[idx % cpu_fill.length]; | 92 | return cpu_fill[idx % cpu_fill.length]; |
@@ -90,6 +126,8 @@ real center = 0.2 - (0.7 / 2.0); | |||
90 | void scheduled(picture pic=currentpicture, int idx=0, int cpu=0, pair time) { | 126 | void scheduled(picture pic=currentpicture, int idx=0, int cpu=0, pair time) { |
91 | path g = (time.x, 0.2)--(time.y, 0.2)--(time.y, -0.5)--(time.x, -0.5)--cycle; | 127 | path g = (time.x, 0.2)--(time.y, 0.2)--(time.y, -0.5)--(time.x, -0.5)--cycle; |
92 | filldraw(pic, shift(task_offset(idx)) * g, idx2color(cpu)); | 128 | filldraw(pic, shift(task_offset(idx)) * g, idx2color(cpu)); |
129 | Label l = scale(0.6) * Label(format("%d", cpu)); | ||
130 | label(pic, l, task_y(idx, (time.x + 0.15, +0.05)), cpu_label_pen); | ||
93 | } | 131 | } |
94 | 132 | ||
95 | void release(picture pic=currentpicture, int idx=0, real when) { | 133 | void release(picture pic=currentpicture, int idx=0, real when) { |