Skip to content

Commit

Permalink
Latest deps
Browse files Browse the repository at this point in the history
  • Loading branch information
michel2323 committed Sep 25, 2023
1 parent e99918b commit f703cd4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
15 changes: 14 additions & 1 deletion main.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
using AMDGPU
using Milepost7
using MPI
using Logging


MPI.Init()

if MPI.Comm_rank(MPI.COMM_WORLD) != 0
disable_logging(Info)
disable_logging(Warn)
else
if AMDGPU.has_rocm_gpu()
@show AMDGPU.libhsaruntime_path
@show AMDGPU.use_artifacts
end
end

if !isinteractive()
args = parse_cmd()
profile = args["profile"]
Expand Down Expand Up @@ -41,4 +54,4 @@ info = milepost7(
proxal_iter=proxal_iter,
exatron_inner_iter=exatron_inner_iter,
exatron_outer_iter=exatron_outer_iter
);
);
15 changes: 1 addition & 14 deletions src/Milepost7.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@ using ProxAL

export milepost7, parse_cmd

function ProxAL.ExaAdmm.KAArray{T}(n::Int, device::CUDABackend) where {T}
return CuArray{T}(undef, n)
end
function ProxAL.ExaAdmm.KAArray{T}(n1::Int, n2::Int, device::CUDABackend) where {T}
return CuArray{T}(undef, n1, n2)
end

function ProxAL.ExaAdmm.KAArray{T}(n::Int, device::ROCBackend) where {T}
return ROCArray{T}(undef, n)
end
function ProxAL.ExaAdmm.KAArray{T}(n1::Int, n2::Int, device::ROCBackend) where {T}
return ROCArray{T}(undef, n1, n2)
end

function milepost7(
case::String,
demandfiles::String,
Expand Down Expand Up @@ -74,6 +60,7 @@ algparams.verbose = 1
algparams.tol = 1e-3
algparams.decompCtgs = (K > 0)
algparams.iterlim = proxal_iter
algparams.verbose_inner = 0

# choose backend
if configuration == 1
Expand Down
16 changes: 9 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ MPI.Init()
maxviol_c_actual = info.maxviol_c_actual[end]
maxviol_d = info.maxviol_d[end]
end
@testset "Testing on CUDA" begin
info = milepost7(case, load, T, K, 3; profile=false, rhopq=rhopq, rhova=rhova, proxal_iter=proxal_iter)
if CUDA.has_cuda_gpu()
@testset "Testing on CUDA" begin
info = milepost7(case, load, T, K, 3; profile=false, rhopq=rhopq, rhova=rhova, proxal_iter=proxal_iter)

@test isapprox(info.maxviol_t[end], maxviol_t)
@test isapprox(info.maxviol_t_actual[end], maxviol_t_actual)
@test isapprox(info.maxviol_c[end], maxviol_c)
@test isapprox(info.maxviol_c_actual[end], maxviol_c_actual)
@test isapprox(info.maxviol_d[end], maxviol_d)
@test isapprox(info.maxviol_t[end], maxviol_t)
@test isapprox(info.maxviol_t_actual[end], maxviol_t_actual)
@test isapprox(info.maxviol_c[end], maxviol_c)
@test isapprox(info.maxviol_c_actual[end], maxviol_c_actual)
@test isapprox(info.maxviol_d[end], maxviol_d)
end
end
@testset "Testing on KA" begin
info = milepost7(case, load, T, K, 4; profile=false, rhopq=rhopq, rhova=rhova, proxal_iter=proxal_iter)
Expand Down

0 comments on commit f703cd4

Please sign in to comment.