Skip to content

Commit

Permalink
extract TiledFactorization module
Browse files Browse the repository at this point in the history
  • Loading branch information
maltezfaria committed Jun 22, 2022
1 parent 52ceae7 commit 0f57da6
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 310 deletions.
4 changes: 0 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
GraphViz = "f526b714-d49f-11e8-06ff-31ed36ee7ee0"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
Octavian = "6fd5a793-0b7e-452c-907f-f8bfe9c57db4"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
RecursiveFactorization = "f2c3362d-daeb-58d1-803e-2bc74f2840b4"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
ThreadPools = "b189fb0b-2eb5-4ed4-bc0c-d34c51242431"
TriangularSolve = "d5829a12-d9aa-46ab-831f-fb7c9ab06edf"

[compat]
julia = "^1"
Expand Down
3 changes: 1 addition & 2 deletions docs/src/references.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# [References](@id references-section)

```@autodocs
Modules = [DataFlowTasks,
DataFlowTasks.TiledFactorization]
Modules = [DataFlowTasks]
```
3 changes: 0 additions & 3 deletions src/DataFlowTasks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ export
@dasync,
@dspawn

# a module showcasing some usecases. To be removed eventually...
include("TiledFactorization/TiledFactorization.jl")

function __init__()
# default scheduler
capacity = 50
Expand Down
36 changes: 0 additions & 36 deletions src/TiledFactorization/TiledFactorization.jl

This file was deleted.

117 changes: 0 additions & 117 deletions src/TiledFactorization/cholesky.jl

This file was deleted.

73 changes: 0 additions & 73 deletions src/TiledFactorization/lu.jl

This file was deleted.

34 changes: 0 additions & 34 deletions src/TiledFactorization/tiledmatrix.jl

This file was deleted.

2 changes: 0 additions & 2 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TriangularSolve = "d5829a12-d9aa-46ab-831f-fb7c9ab06edf"
19 changes: 0 additions & 19 deletions test/juliascheduler_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ using Test
using DataFlowTasks
using DataFlowTasks: R,W,RW
using LinearAlgebra
using DataFlowTasks.TiledFactorization

include(joinpath(DataFlowTasks.PROJECT_ROOT,"test","testutils.jl"))

Expand Down Expand Up @@ -39,22 +38,4 @@ DataFlowTasks.setscheduler!(sch)
@test abs(t1-t2) < 1e-2
end

@testset "Tiled cholesky factorization" begin
m = 100
bsize = div(m,5)
# create an SPD matrix
A = rand(m,m)
A = (A + adjoint(A))/2
A = A + m*I
F = TiledFactorization.cholesky(A)
@test F.L*F.U A
end

@testset "Tiled lu factorization" begin
m = 100
bsize = div(m,5)
A = rand(m,m)
F = TiledFactorization.lu(A)
@test F.L*F.U A
end
end
47 changes: 47 additions & 0 deletions test/logging_dag_test.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using Test
using DataFlowTasks
using DataFlowTasks: Logger, parse!, PlotFinished, PlotRunnable, TiledFactorization
using LinearAlgebra
using Logging
using Plots

GC.gc()

sch = DataFlowTasks.JuliaScheduler(1000)
# sch = DataFlowTasks.PriorityScheduler(200,true)
DataFlowTasks.setscheduler!(sch)

include(joinpath(DataFlowTasks.PROJECT_ROOT,"test","testutils.jl"))

m = 4000
A = rand(m,m)
A = (A+A') + 2*size(A,1)*I

TiledFactorization.TILESIZE[] = 256
io = open("forkjoin.log","w+")
logger = Logger(io)
TiledFactorization.cholesky!(copy(A)) # run once to compile
DataFlowTasks.TASKCOUNTER[] = 0
with_logger(logger) do
DataFlowTasks.reset_timer!(logger)
F = TiledFactorization.cholesky!(A)
end
parse!(logger)

# plot(PlotRunnable(),logger)
# plot(PlotFinished(),logger)
@info DataFlowTasks.TASKCOUNTER[]
plot(logger)

# tl = logger.tasklogs
# chol = filter(t-> occursin("chol",t.task_label),tl)
# schur = filter(t-> occursin("schur",t.task_label),tl)
# ldiv = filter(t-> occursin("ldiv",t.task_label),tl)

# t_chol = map(t -> (t.time_finish-t.time_start)/1e9,chol)
# t_ldiv = map(t -> (t.time_finish-t.time_start)/1e9,ldiv)
# t_schur = map(t -> (t.time_finish-t.time_start)/1e9,schur)
# histogram(t_chol,label="cholesky",xlabel="time (s)",alpha=0.8)
# histogram!(t_ldiv,label="ldiv",xlabel="time (s)",alpha=0.5)
# histogram!(t_schur,label="schur",xlabel="time (s)",alpha=0.5)
# plot(p1,p2,p3,layout=(1,3))
Loading

0 comments on commit 0f57da6

Please sign in to comment.