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

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

function line(n, n0)
    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 n0 > 1
            "And an energy in Hartree"
        else
            "An energy in Hartree"
        end
    end
end

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