Skip to content

Commit

Permalink
clean bench script
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekGardas committed Dec 22, 2023
1 parent e7cfaa7 commit 9996629
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
28 changes: 16 additions & 12 deletions benchmarks/pegasus_rau_bench.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
using MPI
#using MPI
using LinearAlgebra
using MKL
using SpinGlassEngine
using SpinGlassNetworks
using SpinGlassTensors
using SpinGlassExhaustive
#using SpinGlassExhaustive
using Logging
using CSV
using DataFrames
using Memoization
using JSON3

#=
function brute_force_gpu(ig::IsingGraph; num_states::Int)
brute_force(ig, :GPU, num_states=num_states)
end
=#

#MPI.Init()
size = 1 #MPI.Comm_size(MPI.COMM_WORLD)
rank = 0 #MPI.Comm_rank(MPI.COMM_WORLD)

MPI.Init()
size = MPI.Comm_size(MPI.COMM_WORLD)
rank = MPI.Comm_rank(MPI.COMM_WORLD)

M, N, T = 7, 7, 3
INSTANCE_DIR = "$(@__DIR__)/../test/instances/pegasus_random/P8/RAU/SpinGlass/inst3-5"
Expand All @@ -29,10 +32,10 @@ end

BETAS = [0.5,]
LAYOUT = (GaugesEnergy,)
TRANSFORM = all_lattice_transformations
TRANSFORM = all_lattice_transformations

GAUGE = NoUpdate
STRATEGY = Zipper
STRATEGY = Zipper
SPARSITY = Sparse
graduate_truncation = :graduate_truncate

Expand All @@ -48,10 +51,11 @@ ITERS_VAR = 1
DTEMP_MULT = 2
METHOD = :psvd_sparse
I = [1,]
eng = [40, ]
hamming_dist = 74
eng = [40, ]
hamming_dist = 74

disable_logging(LogLevel(1))
BLAS.set_num_threads(1)
#BLAS.set_num_threads(1)

function pegasus_sim(inst, trans, β, Layout, bd, ms, eng, hamming_dist, mstates)
δp = 0.0
Expand All @@ -61,7 +65,7 @@ function pegasus_sim(inst, trans, β, Layout, bd, ms, eng, hamming_dist, mstates
spectrum=full_spectrum,
cluster_assignment_rule=pegasus_lattice((M, N, T))
)

params = MpsParameters(bd, VAR_TOL, ms, TOL_SVD, ITERS_SVD, ITERS_VAR, DTEMP_MULT, METHOD)
search_params = SearchParameters(mstates, δp)

Expand All @@ -87,7 +91,7 @@ function run_bench(inst::String, β::Real, t, l, bd, ms, eng, hamming_dist, msta
else
data = try
tic_toc = @elapsed sol, ctr, cRAM, schmidts, ldrop, droplets, ig_states = pegasus_sim(inst, t, β, l, bd, ms, eng, hamming_dist, mstates)

data = DataFrame(
:instance => inst,
=> β,
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/run_bench.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mpiexec -n 1 ~/julia-1.8.1/bin/julia ./pegasus_rau_bench.jl
mpiexec -n 1 ~/julia-1.9.0/bin/julia ./pegasus_rau_bench.jl

0 comments on commit 9996629

Please sign in to comment.