-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathmake.jl
More file actions
66 lines (59 loc) · 1.45 KB
/
make.jl
File metadata and controls
66 lines (59 loc) · 1.45 KB
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
cd(@__DIR__)
include("make_flags.jl")
for cmd in make_cmds
try
run(`g++ $cmd`)
@info "success"
catch e
@warn "failed command" exception = e
end
end
fasta_input = "fasta.txt"
fasta_gen = joinpath(@__DIR__, "..", "fasta", "fasta.jl")
run(pipeline(`$(Base.julia_cmd()) $fasta_gen 25000000` ;stdout = fasta_input))
benchmarks = [
("binarytrees", 21),
("fannkuchredux", 12),
("fasta", 25000000),
("knucleotide", fasta_input),
("mandelbrot", 16000),
("nbody", 50000000),
("pidigits", 10000),
("regexredux", fasta_input),
("revcomp", fasta_input),
("spectralnorm", 5500),
]
dir = joinpath(@__DIR__, "..")
map(benchmarks) do (bench, arg)
cmd = if arg == -1
`./$bench`
else
`./$bench $arg`
end
end
cd(@__DIR__)
timings = map(benchmarks) do (bench, arg)
println(bench)
root = joinpath(dir, bench)
jl = joinpath(root, string(bench, "-fast.jl"))
if !isfile(jl)
jl = replace(jl, "-fast" => "")
end
@assert isfile(jl)
isfile("result.bin") && rm("result.bin")
args = [:stdout => "result.bin"]
argcmd = ``
cmd = if arg isa String
@assert isfile(arg)
push!(args, :stdin => arg)
else
argcmd = `$arg`
end
# jltime = withenv("JULIA_NUM_THREADS" => 16) do
# @elapsed run(pipeline(`julia -O3 $jl $argcmd`; args...))
# end
jltime = 0.0
ctime = @elapsed run(pipeline(`./$bench $argcmd`; args...))
(jltime, ctime)
end
run(pipeline(`./revcomp $argcmd`, stdin = fasta_gen))