|
1 | | -precompile(Tuple{typeof(DistributedNext.remotecall),Function,Int,Module,Vararg{Any, 100}}) |
2 | | -precompile(Tuple{typeof(DistributedNext.procs)}) |
3 | | -precompile(Tuple{typeof(DistributedNext.finalize_ref), DistributedNext.Future}) |
4 | | -precompile(Tuple{typeof(DistributedNext.setup_launched_worker), DistributedNext.LocalManager, DistributedNext.WorkerConfig, Vector{Int}}) |
5 | | -precompile(Tuple{typeof(DistributedNext.process_tcp_streams), Sockets.TCPSocket, Sockets.TCPSocket, Bool}) |
6 | | -precompile(Tuple{typeof(Serialization.serialize), DistributedNext.ClusterSerializer{Sockets.TCPSocket}, Array{Any, 1}}) |
7 | | -precompile(Tuple{typeof(DistributedNext.parse_connection_info), String}) |
8 | | -precompile(Tuple{typeof(DistributedNext._run_callbacks_concurrently), String, Base.Dict{Any, Union{Function, Type}}, Int64, Array{Tuple{DistributedNext.LocalManager, Base.Dict{Symbol, Any}}, 1}}) |
9 | | -precompile(Tuple{typeof(DistributedNext._run_callbacks_concurrently), String, Base.Dict{Any, Union{Function, Type}}, Int64, Array{Int64, 1}}) |
10 | | -precompile(Tuple{typeof(DistributedNext.read_worker_host_port), Base.PipeEndpoint}) |
11 | | -precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Int64}) |
12 | | -precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, WeakRef}) |
| 1 | +using PrecompileTools: @compile_workload |
13 | 2 |
|
14 | | -precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.IdentifySocketMsg, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber}) |
15 | | -precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.CallWaitMsg, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber}) |
16 | | -precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.CallMsg{:call}, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber}) |
17 | | -precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.CallMsg{:call_fetch}, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber}) |
18 | | -precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.ResultMsg, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber}) |
19 | | -precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.IdentifySocketAckMsg, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber}) |
20 | | -precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.RemoteDoMsg, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber}) |
21 | | -precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.JoinPGRPMsg, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber}) |
22 | | -precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.JoinCompleteMsg, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber}) |
23 | | - |
24 | | -# These lines were obtained from `addprocs(1; exeflags=`--trace-compile=compilation.txt --trace-compile-timing`)` |
25 | | -precompile(Tuple{typeof(DistributedNext.start_worker)}) |
26 | | -precompile(Tuple{typeof(DistributedNext.start_worker), Base.PipeEndpoint, String}) |
27 | | -precompile(Tuple{typeof(DistributedNext.set_valid_processes), Array{Int64, 1}}) |
28 | | -precompile(Tuple{typeof(DistributedNext.terminate_all_workers)}) |
29 | | - |
30 | | -# This is disabled because it doesn't give much benefit |
31 | | -# and the code in Distributed is poorly typed causing many invalidations |
32 | | -# TODO: Maybe reenable now that Distributed is not in sysimage. |
33 | | -#= |
34 | | - precompile_script *= """ |
35 | | - using Distributed |
36 | | - addprocs(2) |
37 | | - pmap(x->iseven(x) ? 1 : 0, 1:4) |
38 | | - @distributed (+) for i = 1:100 Int(rand(Bool)) end |
39 | | - """ |
40 | | -=# |
| 3 | +@compile_workload begin |
| 4 | + # Run the workload in a separate ClusterContext so the default one stays clean |
| 5 | + ClusterContext() do |
| 6 | + # Use an in-process worker to avoid spawning a real process during precompilation |
| 7 | + pid = only(addprocs(LocalManager(1, true, true))) |
| 8 | + rmprocs(pid) |
| 9 | + end |
| 10 | +end |
0 commit comments