-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* qr and lq both work. lu doesnt * need to fix QRColPiv - will come back to it * lu fixed, cholesky started * non distributed cholesky, lu, qr and lq all pass * test distributed too * move helper functions into core * add convenience setindex! with warning if used with scalars * whitespace * add more convenience functions * qol functions with darray * not going to do pivoting this time * delete trailing whitespace * test/factor.jl wasnt designed to be run in loop * delete commented code from test/factor * delete calls to elemental library that were never needed * change indentation to 4 spaces as appears to be used already * AbstractArray -> Array * typeof -> isa, but potentially delete this one * error when setindex! with scalars * added type signatures to factorisation struct outer constructors * remove outdated comment * do not test functions with preprended _ * clearer types to throw error on scalar setindex
- Loading branch information
Showing
9 changed files
with
505 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using MPI, MPIClusterManagers, Distributed | ||
|
||
man = MPIManager(np = 2); | ||
|
||
addprocs(man); | ||
|
||
@everywhere using LinearAlgebra, Elemental | ||
|
||
const M = 400 | ||
const N = M | ||
|
||
@mpi_do man M = @fetchfrom 1 M | ||
@mpi_do man N = @fetchfrom 1 N | ||
|
||
const Ahost = rand(Float64, M, N) | ||
Ahost .+= Ahost' | ||
Ahost .+= M * I(M) | ||
const bhost = rand(Float64, M) | ||
|
||
@mpi_do man Aall = @fetchfrom 1 Ahost | ||
@mpi_do man ball = @fetchfrom 1 bhost | ||
|
||
@mpi_do man A = Elemental.DistMatrix(Float64); | ||
@mpi_do man b = Elemental.DistMatrix(Float64); | ||
|
||
@mpi_do man A = Elemental.resize!(A, M, N); | ||
@mpi_do man b = Elemental.resize!(b, M); | ||
|
||
@mpi_do man copyto!(A, Aall) | ||
@mpi_do man copyto!(b, ball) | ||
|
||
@mpi_do man chA = Elemental.cholesky!(A); | ||
|
||
@mpi_do man x = chA \ b; | ||
|
||
@mpi_do man localx = zeros(Float64, Elemental.localHeight(x), Elemental.localWidth(x)) | ||
@mpi_do man copyto!(localx, Elemental.localpart(x)) | ||
|
||
using Test | ||
x = vcat((fetch(@spawnat p localx)[:] for p in workers())...) | ||
@testset "Cholesky" begin | ||
@test x ≈ Ahost \ bhost | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using MPI, MPIClusterManagers, Distributed | ||
|
||
man = MPIManager(np = 2); | ||
|
||
addprocs(man); | ||
|
||
@everywhere using LinearAlgebra, Elemental | ||
|
||
const M = 300 | ||
const N = 400 | ||
|
||
@mpi_do man M = @fetchfrom 1 M | ||
@mpi_do man N = @fetchfrom 1 N | ||
|
||
const Ahost = rand(Float64, M, N) | ||
const bhost = rand(Float64, M) | ||
|
||
@mpi_do man Aall = @fetchfrom 1 Ahost | ||
@mpi_do man ball = @fetchfrom 1 bhost | ||
|
||
@mpi_do man A = Elemental.DistMatrix(Float64); | ||
@mpi_do man b = Elemental.DistMatrix(Float64); | ||
|
||
@mpi_do man A = Elemental.resize!(A, M, N); | ||
@mpi_do man b = Elemental.resize!(b, M); | ||
|
||
@mpi_do man copyto!(A, Aall) | ||
@mpi_do man copyto!(b, ball) | ||
|
||
@mpi_do man lqA = Elemental.lq!(A); | ||
|
||
@mpi_do man x = lqA \ b; | ||
|
||
@mpi_do man localx = zeros(Float64, Elemental.localHeight(x), Elemental.localWidth(x)) | ||
@mpi_do man copyto!(localx, Elemental.localpart(x)) | ||
|
||
using Test | ||
x = vcat((fetch(@spawnat p localx)[:] for p in workers())...) | ||
@testset "lq" begin | ||
@test x ≈ Ahost \ bhost | ||
end |
Oops, something went wrong.