Skip to content

Commit 71db6e9

Browse files
authored
Merge pull request #49 from JuliaParallel/pr48
update libelemental to v0.87.7 v2
2 parents 94e1a5e + 44a65f6 commit 71db6e9

File tree

4 files changed

+43
-15
lines changed

4 files changed

+43
-15
lines changed

deps/build.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Libdl, LibGit2, LinearAlgebra
22

3-
# Use this version of Elemental
4-
Elsha = "79987d38b04838acf6b6195be1967177521ee908"
3+
# Use Elemental version 0.87.7
4+
Elsha = "477e503a7a840cc1a75173552711b980505a0b06"
55

66
if Sys.iswindows()
77
error("Elemental only works on Unix Platforms")
@@ -49,6 +49,7 @@ cd(builddir) do
4949
-D MATH_LIBS=$mathlib
5050
-D EL_BLAS_SUFFIX=$blas_suffix
5151
-D EL_LAPACK_SUFFIX=$blas_suffix
52+
-D CMAKE_INSTALL_LIBDIR=$prefix/lib
5253
-D CMAKE_INSTALL_RPATH=$prefix/lib
5354
$srcdir`)
5455
run(`make -j $build_procs`)

src/io.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ for (elty, ext) in ((:Float32, :s),
44
(:Float64, :d),
55
(:ComplexF32, :c),
66
(:ComplexF64, :z))
7-
for mattype in ("", "Dist")
7+
for mattype in ("", "Dist", "Sparse", "DistSparse")
88
mat = Symbol(mattype, "Matrix")
99
@eval begin
1010
function print(A::$mat{$elty}, title::String)

src/optimization/solvers.jl

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ struct MehrotraCtrl{T<:ElFloatType}
3333
ruizMaxIter::ElInt
3434
diagEquilTol::T
3535
checkResiduals::ElBool
36+
37+
reg0Tmp::T
38+
reg1Tmp::T
39+
reg2Tmp::T
40+
reg0Perm::T
41+
reg1Perm::T
42+
reg2Perm::T
3643
end
3744
function MehrotraCtrl(::Type{T};
3845
primalInit::Bool = false,
@@ -55,7 +62,15 @@ function MehrotraCtrl(::Type{T};
5562
ruizEquilTol = eps(T)^(-0.25),
5663
ruizMaxIter = 3,
5764
diagEquilTol = eps(T)^(-0.15),
58-
checkResiduals = false) where {T<:ElFloatType}
65+
checkResiduals = false,
66+
67+
reg0Tmp = eps(T)^0.25,
68+
reg1Tmp = eps(T)^0.25,
69+
reg2Tmp = eps(T)^0.25,
70+
71+
reg0Perm = eps(T)^0.35,
72+
reg1Perm = eps(T)^0.35,
73+
reg2Perm = eps(T)^0.35) where {T<:ElFloatType}
5974

6075
MehrotraCtrl{T}(ElBool(primalInit),
6176
ElBool(dualInit),
@@ -77,7 +92,13 @@ function MehrotraCtrl(::Type{T};
7792
T(ruizEquilTol),
7893
ElInt(ruizMaxIter),
7994
T(diagEquilTol),
80-
ElBool(checkResiduals))
95+
ElBool(checkResiduals),
96+
T(reg0Tmp),
97+
T(reg1Tmp),
98+
T(reg2Tmp),
99+
T(reg0Perm),
100+
T(reg1Perm),
101+
T(reg2Perm))
81102
end
82103

83104
struct LPAffineCtrl{T<:ElFloatType}

test/lav.jl

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ function randDArray(m,n,sparsity=0.01)
2222
return A
2323
end
2424

25+
# Stack two 2D finite-difference matrices on top of each other
26+
# and make the last column dense
2527
function stackedFD2D(n0, n1)
2628
height = 2*n0*n1
2729
width = n0*n1
@@ -67,7 +69,7 @@ function stackedFD2D(n0, n1)
6769
end
6870

6971
# The dense last column
70-
El.queueUpdate(A, s, width, -div(10.0, height))
72+
El.queueUpdate(A, s, width, floor(-10/height))
7173
end
7274
El.processQueues(A)
7375
return A
@@ -88,16 +90,20 @@ bHeight = El.height(b)
8890
bWidth = El.width(b)
8991

9092
if display
91-
show(IO, A)
93+
El.print(A, "A")
94+
# El.print(b, "b")
9295
end
93-
ctrl = El.LPAffineCtrl(Float64,
94-
mehrotraCtrl = El.MehrotraCtrl(Float64,
95-
solveCtrl = El.RegSolveCtrl(Float64, progress = true),
96-
print = true,
97-
outerEquil = true,
98-
time = true))
9996

100-
elapsedLAV = @elapsed x = El.lav(A, b)
97+
ctrl = El.LPAffineCtrl(Float64,
98+
mehrotraCtrl=El.MehrotraCtrl(Float64,
99+
solveCtrl=El.RegSolveCtrl(Float64,
100+
progress=true),
101+
print=true,
102+
outerEquil=true,
103+
time=true)
104+
)
105+
106+
# elapsedLAV = @elapsed x = El.lav(A, b);#Elemental.print(A, "Matrix A")
101107
elapsedLAV = @elapsed x = El.lav(A, b, ctrl)
102108

103109
if El.MPI.commRank(El.MPI.CommWorld[]) == 0
@@ -128,7 +134,7 @@ end
128134
rLS = copy(b)
129135
mul!(rLS, A, xLS, -1.0, 1.0)
130136
if display
131-
El.Display( rLS, "A x_{LS} - b" )
137+
El.print( rLS, "A x_{LS} - b" )
132138
end
133139

134140
rLSTwoNorm = El.nrm2(rLS)

0 commit comments

Comments
 (0)