From f9371a2acd070a8983fe697dda453552c15f2927 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Mon, 24 Apr 2023 16:43:39 -0500 Subject: [PATCH] Migrate from SnoopPrecompile to PrecompileTools --- Project.toml | 4 ++-- src/precompile.jl | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 71e6f47..b8f86e2 100644 --- a/Project.toml +++ b/Project.toml @@ -7,7 +7,7 @@ version = "0.2.3" Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" PeriodicGraphs = "18c5b727-b240-4874-878a-f2e242435bab" -SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c" +PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Tokenize = "0796e94c-ce3b-5d07-9a54-7f471281c624" spglib_jll = "ac4a9f1e-bdb2-5204-990c-47c8b2f70d4e" @@ -15,7 +15,7 @@ spglib_jll = "ac4a9f1e-bdb2-5204-990c-47c8b2f70d4e" [compat] Graphs = "1.3" PeriodicGraphs = "0.9.5" -SnoopPrecompile = "1" +PrecompileTools = "1" StaticArrays = "1.0" Tokenize = "0.5.8" julia = "1.6" diff --git a/src/precompile.jl b/src/precompile.jl index 184c599..c884e77 100644 --- a/src/precompile.jl +++ b/src/precompile.jl @@ -1,5 +1,5 @@ using PeriodicGraphEmbeddings, PeriodicGraphs, Graphs, StaticArrays -using SnoopPrecompile +using PrecompileTools @static if VERSION < v"1.7-" Returns(a) = (_ -> a) @@ -47,7 +47,7 @@ macro _precompile_pge(N, _name) return esc(ret) end -@precompile_setup begin +@setup_workload begin apd_g = PeriodicGraph("3 1 3 0 0 0 1 44 0 0 0 2 5 1 0 0 2 21 0 0 0 2 84 0 0 0 2 93 0 0 0 3 46 0 0 0 3 50 0 0 0 3 79 0 0 0 4 6 0 0 0 4 43 0 0 0 4 60 0 0 0 4 74 0 0 0 5 78 0 0 0 6 17 0 0 0 7 69 0 0 0 7 73 0 0 0 8 35 0 0 0 8 52 0 0 0 8 62 0 0 0 8 76 0 0 0 9 16 0 0 0 9 22 0 0 0 9 30 1 0 0 9 86 0 0 0 10 13 0 0 0 10 54 0 0 0 10 85 0 0 0 10 87 0 1 0 11 45 1 0 0 11 58 0 0 0 11 81 0 0 0 11 92 0 0 0 12 40 0 0 0 12 69 0 0 0 13 77 0 0 0 14 26 0 0 -1 14 66 0 0 0 15 51 0 0 0 15 61 0 0 0 16 55 0 0 -1 17 31 0 0 0 17 35 0 0 0 17 96 0 0 0 18 24 0 0 0 18 28 0 0 0 18 50 0 0 0 18 72 0 0 1 19 51 0 0 0 19 55 0 0 0 20 36 1 0 0 20 68 0 0 1 20 82 0 0 0 20 95 0 0 0 21 26 0 0 0 22 66 0 0 0 23 48 0 0 0 23 83 0 0 0 23 93 0 0 0 23 96 1 0 0 24 57 -1 0 0 25 29 0 0 0 25 38 0 0 0 26 71 0 0 0 26 91 0 0 0 27 29 0 0 0 27 37 0 0 0 28 70 0 0 0 29 49 1 0 0 29 94 0 0 0 30 53 0 0 0 31 78 0 0 0 32 41 0 0 0 32 42 0 0 0 32 64 0 0 0 32 72 0 0 0 33 37 0 0 0 33 57 0 0 -1 34 61 0 0 0 34 69 0 0 0 36 73 0 0 0 37 42 0 0 0 37 56 0 0 0 38 65 0 1 0 38 67 0 0 0 38 85 0 0 0 39 44 0 0 0 39 57 0 0 0 40 65 0 0 0 40 81 0 0 0 40 95 0 0 0 41 77 0 0 0 43 53 0 0 0 44 84 0 0 0 44 94 0 0 0 45 61 0 0 0 46 77 0 0 0 47 51 0 0 0 47 73 0 0 0 48 59 0 0 0 49 77 0 0 0 51 75 0 0 1 52 61 0 0 0 53 75 0 0 0 53 76 0 0 0 54 88 0 0 0 55 82 0 0 0 55 92 0 0 0 56 89 0 0 0 57 91 0 0 0 58 59 0 0 0 59 62 0 0 0 59 86 0 0 0 60 70 0 0 -1 63 70 0 0 0 63 78 0 0 0 64 88 0 0 0 66 74 0 0 0 66 83 0 0 0 67 89 0 0 0 68 89 0 -1 0 69 87 0 0 0 70 71 0 0 0 73 90 0 0 1 78 79 0 0 0 80 88 0 0 0 80 89 -1 0 0 88 90 0 1 0") apd_pos_float = SVector{3, Float64}[[0.5, 0.7027, 0.6094], [0.8185, 0.5552, 0.6114], [0.316, 0.6986, 0.6073], [0.3185, 0.4448, 0.1114], [0.0, 0.5673, 0.6258], [0.25, 0.4698, 0.25], [0.25, 0.0302, 0.75], [0.316, 0.3014, 0.3927], [0.816, 0.3014, 0.1073], [0.3185, 0.9448, 0.3886], [0.816, 0.1986, 0.6073], [0.5, 0.0673, 0.6258], [0.2366, 0.876, 0.4299], [0.7137, 0.5, 0.0], [0.25, 0.218, 0.75], [0.75, 0.25, 0.0], [0.1815, 0.4448, 0.3886], [0.184, 0.6986, 0.8927], [0.5, 0.2027, 0.8906], [0.8185, 0.0552, 0.8886], [0.75, 0.5302, 0.75], [0.7634, 0.376, 0.0701], [0.8185, 0.4448, 0.3886], [0.0, 0.7027, 0.8906], [0.7634, 0.876, 0.4299], [0.6815, 0.5552, 0.8886], [0.75, 0.782, 0.25], [0.2366, 0.624, 0.9299], [0.816, 0.8014, 0.3927], [0.0, 0.2973, 0.1094], [0.2137, 0.5, 0.5], [0.316, 0.8014, 0.1073], [0.75, 0.75, 0.0], [0.2366, 0.124, 0.5701], [0.2634, 0.376, 0.4299], [0.0, 0.0673, 0.8742], [0.684, 0.8014, 0.1073], [0.6815, 0.9448, 0.3886], [0.75, 0.718, 0.75], [0.6815, 0.0552, 0.6114], [0.25, 0.782, 0.25], [0.5, 0.7973, 0.1094], [0.2366, 0.376, 0.0701], [0.684, 0.6986, 0.6073], [0.0, 0.2027, 0.6094], [0.25, 0.75, 0.5], [0.2634, 0.124, 0.9299], [0.7366, 0.376, 0.4299], [0.0, 0.7973, 0.3906], [0.25, 0.718, 0.75], [0.316, 0.1986, 0.8927], [0.25, 0.25, 0.5], [0.184, 0.3014, 0.1073], [0.25, 0.9698, 0.25], [0.684, 0.1986, 0.8927], [0.7366, 0.876, 0.0701], [0.816, 0.6986, 0.8927], [0.75, 0.25, 0.5], [0.684, 0.3014, 0.3927], [0.2863, 0.5, 0.0], [0.184, 0.1986, 0.6073], [0.5, 0.2973, 0.3906], [0.25, 0.5302, 0.75], [0.2634, 0.876, 0.0701], [0.7137, 0.0, 0.5], [0.6815, 0.4448, 0.1114], [0.75, 0.9698, 0.25], [0.7863, 0.0, 0.0], [0.3185, 0.0552, 0.6114], [0.3185, 0.5552, 0.8886], [0.5, 0.5673, 0.8742], [0.25, 0.75, 0.0], [0.1815, 0.0552, 0.8886], [0.5, 0.4327, 0.1258], [0.25, 0.25, 0.0], [0.25, 0.282, 0.25], [0.184, 0.8014, 0.3927], [0.1815, 0.5552, 0.6114], [0.2634, 0.624, 0.5701], [0.0, 0.9327, 0.1258], [0.7634, 0.124, 0.5701], [0.7366, 0.124, 0.9299], [0.75, 0.4698, 0.25], [0.7366, 0.624, 0.5701], [0.5, 0.9327, 0.3742], [0.75, 0.282, 0.25], [0.2863, 0.0, 0.5], [0.1815, 0.9448, 0.1114], [0.8185, 0.9448, 0.1114], [0.2137, 0.0, 0.0], [0.7634, 0.624, 0.9299], [0.75, 0.218, 0.75], [0.7863, 0.5, 0.5], [0.75, 0.75, 0.5], [0.75, 0.0302, 0.75], [0.0, 0.4327, 0.3742]] apd_pos_float_stacked = reduce(hcat, apd_pos_float) @@ -72,7 +72,7 @@ end onev2 = PeriodicVertex(2, (1,0)) t = tempname(; cleanup=false) types = [:Si for _ in 1:length(apd_pos_float)] - @precompile_all_calls begin + @compile_workload begin string(parse(EquivalentPosition, " - y; x+0.3, z-x")) parse(EquivalentPosition, "a+c, - a +x, c", ("x","a","c"))(onepos3) PeriodicGraphEmbeddings.find_refid(["X+1/2,-A,Z","+X,+Z,+A"])