Skip to content

Commit 164eed9

Browse files
committed
precompile
1 parent b5e4199 commit 164eed9

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
1414
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
1515
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
1616
PhysicalParticles = "78724250-4eb2-11e9-0f34-13a7aab864c5"
17+
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
1718
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1819
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
1920
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
@@ -29,10 +30,11 @@ CSV = "0.9, 0.10"
2930
Combinatorics = "1"
3031
ConfParser = "0.1"
3132
FileIO = "1"
32-
HDF5 = "0.15, 0.16"
33+
HDF5 = "0.15, 0.16, 0.17"
3334
IterTools = "1.3"
3435
JLD2 = "0.4"
3536
PhysicalParticles = "1"
37+
PrecompileTools = "1"
3638
ProgressMeter = "1"
3739
Reexport = "1"
3840
StaticArrays = "1"

src/AstroIO.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module AstroIO
22

3+
using PrecompileTools
34
using Reexport
45
using Unitful, UnitfulAstro
56
using FileIO, JLD2, HDF5
@@ -90,4 +91,5 @@ include("PrettyPrint.jl")
9091
include("Tools.jl")
9192
include("ConfParser.jl")
9293

94+
include("precompile.jl")
9395
end # module

src/precompile.jl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@setup_workload begin
2+
@compile_workload begin
3+
foldertest = joinpath(@__DIR__, "../test")
4+
5+
h, d = read_gadget2(joinpath(foldertest, "gassphere_littleendian.gadget2"), uAstro)
6+
write_gadget2(joinpath(foldertest, "testGadget.gadget2"), h, d)
7+
write_gadget2(joinpath(foldertest, "testGadgetHeaderGeneration.gadget2"), d)
8+
pos = read_gadget2_pos(joinpath(foldertest, "gassphere_littleendian.gadget2"), uAstro, uGadget2)
9+
h, d = read_gadget2(joinpath(foldertest, "pot_acc.format2.gadget2"), uAstro, uGadget2)
10+
h, d = read_gadget2(joinpath(foldertest, "pot_acc.format2.gadget2"), nothing, uGadget2)
11+
h, d = read_gadget2(joinpath(foldertest, "pot_acc.format2.gadget2"), nothing, nothing)
12+
pos = read_gadget2_pos(joinpath(foldertest, "pot_acc.format2.gadget2"), uGadget2)
13+
14+
h, d = read_gadget2(joinpath(foldertest, "pot_acc.format2.gadget2"), uAstro, uGadget2)
15+
write_gadget2_format2(joinpath(foldertest, "pot_acc.format2.test.gadget2"), h, d, acc = true, pot = true)
16+
# h, d = load(joinpath(foldertest, "gassphere_littleendian.gadget2"), uAstro)
17+
stars2d = [Star2D() for i = 1:10]
18+
write_csv(joinpath(foldertest, "testcsvStar2D"), stars2d, nothing)
19+
stars = [Star(uAstro) for i = 1:10]
20+
write_csv(joinpath(foldertest, "testcsvStar"), stars, uAstro)
21+
data = [[Star() for i = 1:10]; [Ball() for i = 1:10]]
22+
write_csv(joinpath(foldertest, "testcsvGeneral"), data, nothing)
23+
write_ramses(joinpath(foldertest, "ramses.csv"), stars)
24+
header, data = read_gadget2(joinpath(foldertest, "gassphere_littleendian.gadget2"), uAstro)
25+
d = [Star2D() for i = 1:10]
26+
write_gadget2_jld(joinpath(foldertest, "testjldGadget.jld2"), header, d)
27+
h, d = read_gadget2_jld(joinpath(foldertest, "testjldGadget.jld2"))
28+
write_jld(joinpath(foldertest, "testjldGeneral.jld2"), d)
29+
d = read_jld(joinpath(foldertest, "testjldGadget.jld2"))
30+
end
31+
end

0 commit comments

Comments
 (0)