Skip to content

Cleanup imports with ExplicitImports.jl #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2024
Merged
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
2 changes: 1 addition & 1 deletion ext/GraphVizExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ end
import Dagger
import Dagger: EagerThunk, Chunk, Processor
import Dagger.TimespanLogging: Timespan
using Dagger.Graphs
import Graphs: SimpleDiGraph, add_edge!, add_vertex!, inneighbors, outneighbors, vertices, is_directed, edges, nv

function pretty_time(t; digits=3)
r(t) = round(t; digits)
Expand Down
26 changes: 16 additions & 10 deletions src/Dagger.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
module Dagger

using Distributed, SharedArrays, Serialization
import Serialization
import Serialization: AbstractSerializer, serialize, deserialize
import SparseArrays: sprand, SparseMatrixCSC

using MemPool
import MemPool
import MemPool: DRef, FileRef, poolget, poolset

import Base: collect, adjoint, reduce
import Distributed: procs
import Base: collect, reduce
import Distributed
import Distributed: Future, RemoteChannel, myid, workers, nworkers, procs, remotecall, remotecall_wait, remotecall_fetch

using LinearAlgebra
import LinearAlgebra: transpose
import LinearAlgebra
import LinearAlgebra: Adjoint, BLAS, Diagonal, LAPACK, LowerTriangular, PosDefException, Transpose, UpperTriangular, diagind, ishermitian, issymmetric

using UUIDs
import UUIDs: UUID, uuid4

if !isdefined(Base, :ScopedValues)
import ScopedValues: ScopedValue, with
Expand All @@ -22,15 +26,17 @@ if !isdefined(Base, :get_extension)
using Requires
end

using MacroTools
using TimespanLogging
import TimespanLogging
import TimespanLogging: timespan_start, timespan_finish

include("lib/util.jl")
include("utils/dagdebug.jl")

# Distributed data
include("utils/locked-object.jl")
include("utils/tasks.jl")

import MacroTools: @capture
include("options.jl")
include("processor.jl")
include("threadproc.jl")
Expand Down Expand Up @@ -85,7 +91,7 @@ include("utils/logging-events.jl")
include("utils/logging.jl")

# Precompilation
using PrecompileTools
import PrecompileTools: @compile_workload
include("precompile.jl")

function __init__()
Expand Down
3 changes: 1 addition & 2 deletions src/array/alloc.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Base: cat
using SparseArrays, Random
import SparseArrays: sprand
import Random: MersenneTwister
export partition

mutable struct AllocateArray{T,N} <: ArrayOp{T,N}
Expand Down
2 changes: 0 additions & 2 deletions src/array/darray.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Base: ==, fetch
using Serialization
import Serialization: serialize, deserialize

###### Array Domains ######

Expand Down
2 changes: 1 addition & 1 deletion src/array/indexing.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using TaskLocalValues
import TaskLocalValues: TaskLocalValue

### getindex

Expand Down
7 changes: 0 additions & 7 deletions src/array/operators.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import Base: exp, expm1, log, log10, log1p, sqrt, cbrt, exponent,
significand, sin, sinpi, cos, cospi, tan, sec, cot, csc,
sinh, cosh, tanh, coth, sech, csch,
asin, acos, atan, acot, asec, acsc,
asinh, acosh, atanh, acoth, asech, acsch, sinc, cosc,
+, -, %, &, *

import Base: broadcast
import Base: Broadcast
import Base.Broadcast: Broadcasted, BroadcastStyle, combine_eltypes
Expand Down
6 changes: 3 additions & 3 deletions src/array/sort.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Base.Sort: Forward, Ordering, Algorithm, lt
using Distributed
import Base.Sort: Forward, Ordering, lt
import SharedArrays: SharedArray

using StatsBase
import StatsBase: fit!, sample


function getmedians(x, n)
Expand Down
1 change: 0 additions & 1 deletion src/array/sparse_partition.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export partition_sparse
using SparseArrays

function partition_sparse(colptr, nnz, sz, nparts)
nnz_per_chunk = nnz/nparts
Expand Down
2 changes: 0 additions & 2 deletions src/chunks.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Serialization

export domain, UnitDomain, project, alignfirst, ArrayDomain

import Base: isempty, getindex, intersect, ==, size, length, ndims
Expand Down
2 changes: 1 addition & 1 deletion src/datadeps.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Graphs
import Graphs: SimpleDiGraph, add_edge!, add_vertex!, inneighbors, outneighbors, nv

export In, Out, InOut, spawn_datadeps

Expand Down
9 changes: 4 additions & 5 deletions src/sch/Sch.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
module Sch

using Distributed
import Distributed: Future, ProcessExitedException, RemoteChannel, RemoteException, myid, remote_do, remotecall_fetch, remotecall_wait, workers
import MemPool
import MemPool: DRef, StorageResource
import MemPool: poolset, storage_available, storage_capacity, storage_utilized, externally_varying
import Statistics: mean
import MemPool: poolset, storage_capacity, storage_utilized
import Random: randperm
import Base: @invokelatest

import ..Dagger
import ..Dagger: Context, Processor, Thunk, WeakThunk, ThunkFuture, ThunkFailedException, Chunk, WeakChunk, OSProc, AnyScope, DefaultScope, LockedObject
import ..Dagger: order, dependents, noffspring, istask, inputs, unwrap_weak_checked, affinity, tochunk, timespan_start, timespan_finish, procs, move, chunktype, processor, default_enabled, get_processors, get_parent, execute!, rmprocs!, addprocs!, thunk_processor, constrain, cputhreadtime
import ..Dagger: order, dependents, noffspring, istask, inputs, unwrap_weak_checked, affinity, tochunk, timespan_start, timespan_finish, procs, move, chunktype, processor, get_processors, get_parent, execute!, rmprocs!, thunk_processor, constrain, cputhreadtime
import ..Dagger: @dagdebug, @safe_lock_spin1
import DataStructures: PriorityQueue, enqueue!, dequeue_pair!, peek

Expand Down Expand Up @@ -1473,7 +1472,7 @@ function do_task(to_proc, task_desc)
break
end
if est_alloc_util + real_alloc_util > storage_cap
if externally_varying(to_storage)
if MemPool.externally_varying(to_storage)
debug_storage("WARN: Insufficient space and allocation behavior is externally varying on $to_storage_name, proceeding anyway")
break
end
Expand Down
3 changes: 1 addition & 2 deletions src/utils/logging-events.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ module Events
import ..Dagger
import ..Dagger: Context, Chunk

using ..TimespanLogging
import ..TimespanLogging
import .TimespanLogging: Event, init_similar
import .TimespanLogging.Events: EventSaturation

TimespanLogging.log_sink(ctx::Context) = ctx.log_sink
TimespanLogging.profile(ctx::Context, category, id, tl) =
Expand Down
Loading