Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 20 additions & 25 deletions Manifest.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name = "SecretAnalysis"
uuid = "8dfca4dd-ef31-4e42-8ec3-c12533c9aecd"
authors = ["Matt Bauman"]
version = "0.1.5"
version = "0.1.6"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[compat]
Expand Down
11 changes: 8 additions & 3 deletions bin/main.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
using SecretAnalysis, JSON, Printf, Distributed
using SecretAnalysis, JSON3, Printf, Distributed

n = parse(Int64, replace(get(ENV, "n", "10_000_000_000"), '_'=>""))
n = parse(Int64, replace(get(ENV, "n", "10_000_000_000"), '_' => ""))

println("#### Estimating π with $n throws ####")

t = @timed @show estimate_pi(n)

out = Dict(:pi => t[1], :time => @sprintf("%.1fs", t[2]), :workers => nworkers())
ENV["OUTPUTS"] = JSON.json(out)
open("results.json", "w") do io
JSON3.pretty(io, JSON3.write(out))
end

ENV["RESULTS"] = JSON3.write(out)
ENV["RESULTS_FILE"] = "results.json"