The Twelve Days of Cluster

A Christmas carol about giving in the season of high-performance computing. Sung to the melody of The Twelve Days of Christmas.

 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
#!/usr/bin/env julia

const ord = ["first", "second", "third", "fourth",
             "fifth", "sixth", "seventh", "eighth",
             "ninth", "tenth", "eleventh", "twelfth"]

function line(n, m)
    if n == 12
        "Twelve RAID controllers"
    elseif n == 11
        "Eleven NFS shares"
    elseif n == 10
        "Ten integrators"
    elseif n == 9
        "Nine network switches"
    elseif n == 8
        "Eight Intel compilers"
    elseif n == 7
        "Seven drives a-spinning"
    elseif n == 6
        "Six rackmount servers"
    elseif n == 5
        "Five GPUs"
    elseif n == 4
        "Four Xeon cores"
    elseif n == 3
        "Three USB hubs"
    elseif n == 2
        "Two sticks of RAM"
    elseif n == 1
        if m > 1
            "And an energy in Hartree"
        else
            "An energy in Hartree"
        end
    end
end

for m in 1:12
    println("On the $(ord[m]) day of Christmas my admin sent to me")
    for n in m:-1:1
        println(line(n, m))
    end
    m < 12 && println()
end