Skip to content

Commit

Permalink
Merge remote branch
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannz committed Aug 27, 2024
2 parents 7eb65f6 + 3796ef1 commit 27646b5
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The Multi-Threaded Karlsruhe Graph and Hypergraph Partitioning Framework require
on which we rely on which causes on our side a segmentation fault in really rare cases. If you want to ignore these
warning, you can add `-DKAHYPAR_ENFORCE_MINIMUM_TBB_VERSION=OFF` to the cmake build command.
- The [Portable Hardware Locality][hwloc] library (hwloc)
- The [Scalable Library for Eigenvalue Problem Computations][slepc]
- For spectral refinement, the dependencies listed in spectral.md

### Linux

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# adapted from [K-SpecPart](https://github.com/TILOS-AI-Institute/HypergraphPartitioning/tree/main/K_SpecPart) under [BSD license](https://github.com/TILOS-AI-Institute/HypergraphPartitioning/blob/main/LICENSE)

include("../utils.jl")
include("../config.jl")

function hgr_laplacian(hg::__hypergraph__, x::AbstractArray)
n = hg.num_vertices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ include("graph/matrices.jl")
include("cmg/CombinatorialMultigrid.jl")
include("utils.jl")

include("config.jl")

function LinearAlgebra.ldiv!(c::AbstractVecOrMat{T},
P::CombinatorialMultigrid.lPreconditioner,
b::AbstractVecOrMat{T}) where {T}
Expand Down
14 changes: 10 additions & 4 deletions mt-kahypar/partition/refinement/spectral/solvers/julia/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include("tree_distill.jl")


# generic main method, not to be called directly
function main(input, method)
function main(input, method, rescue=true)
inform("julia launched")
n = convert(Int, input[1][1])
inform_dbg(n, false, () -> "transmitted (hyper)graph data: " * string(convert(AbstractArray{Int64}, input[1])))
Expand Down Expand Up @@ -48,13 +48,17 @@ function main(input, method)
inform("failed due to " * sprint(showerror, e))
@print_backtrace

return ones(Float64, n)
if rescue
return ones(Float64, n)
else
exit(1)
end
end
end

# only solve gevp with lobpcg and return fiedler vector
function main_lobpcg(hgr_data::AbstractArray, hint::AbstractArray, deflation_evecs::AbstractArray)
return main((hgr_data, hint, deflation_evecs), (g, h, e, a) -> solve_lobpcg(g, h, e, 1, a))
function main_lobpcg(hgr_data::AbstractArray, hint::AbstractArray, deflation_evecs::AbstractArray, rescue=true)
return main((hgr_data, hint, deflation_evecs, rescue), (g, h, e, a) -> solve_lobpcg(g, h, e, 1, a))
end

# solve gevp and then perform tree distilling
Expand All @@ -79,6 +83,8 @@ function main_kspecpart(hgr_data::AbstractArray, hint::AbstractArray, deflation_
end)
end

main_lobpcg_unsafe(g, h, d) = main_lobpcg(g, h, d, false)

main_nothing = (d, h, e) -> ones(Float64, d[1])

# retrieve main variant from config file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# adapted from [K-SpecPart](https://github.com/TILOS-AI-Institute/HypergraphPartitioning/tree/main/K_SpecPart) under [BSD license](https://github.com/TILOS-AI-Institute/HypergraphPartitioning/blob/main/LICENSE)

include("utils.jl")
include("config.jl")
include("tree_partition/tree_partition.jl")
include("tree_partition/triton_part_refine.jl")
include("overlay.jl")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# adapted from [K-SpecPart](https://github.com/TILOS-AI-Institute/HypergraphPartitioning/tree/main/K_SpecPart) under [BSD license](https://github.com/TILOS-AI-Institute/HypergraphPartitioning/blob/main/LICENSE)

include("../config.jl")

# using Metis
using SparseArrays
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include("config.jl")
using DelimitedFiles

# logging functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ namespace mt_kahypar {

DBG << "solution vec prepared";

for (int i = 0; i < 1/* params.numCandidates */; i++) {
for (int i = 0; i < params.numCandidates; i++) {
DBG << "generating embedding...";
vec<spectral::Vector> embedding; /* TODO type alias */
if (k == 2) {
Expand Down
84 changes: 84 additions & 0 deletions spectral.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
To use spectral refinement, you'll need the following steps to install the dependencies to a local folder (just follow the respective official instructions for installation with root):

# spdlog

- `git clone --branch v1.8.1 https://github.com/gabime/spdlog.git spdlog-1.8.1`
- install via `cmake` with install prefix

# lemon

- download from https://lemon.cs.elte.hu/trac/lemon
- install via `cmake` with install prefix

# or-tools

- `git clone https://github.com/google/or-tools`
- install via `cmake` with install prefix and `BUILD_DEPS=ON`

# boost

- download from https://www.boost.org/users/history/version_1_80_0.html
- install with `bootstrap.sh --prefix=/install/prefix/`and `b2 install`

# tcl

- download from http://prdownloads.sourceforge.net/tcl/tcl8.6.14-src.tar.gz
- installation:
```
cd unix
configure --prefix=/install/prefix/
make install install-private-headers
cd /install/prefix/bin
ln -s tclsh8.6 tclsh
chmod +x tclsh
```

# swig

- download from https://swig.org/svn.html
- install via `autogen.sh`, `configure` (with install prefix) and `make`

# bison

- download from http://ftp.gnu.org/gnu/bison/bison-3.8.tar.gz
- install via `configure` with install prefix and `make`

# flex

- download from https://github.com/westes/flex/files/981163/flex-2.6.4.tar.gz
- install via `configure` with install prefix and `make`

# openroad

- download from https://github.com/juliannz/TritonPart_OpenROAD.git
- installation:
```
cmake .. -DENABLE_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/install/prefix/ -DTCL_LIBRARY=/install/prefix/lib/libtcl8.6.so -DUSE_SYSTEM_OR_TOOLS=ON
rm /install/prefix/bin/openroad
ln build/src/openroad /install/prefix/bin/openroad
```

# GKlib

- download from https://github.com/KarypisLab/GKlib
- install via `make` with install prefix

# METIS
- download from https://github.com/KarypisLab/METIS
- install via `make` with install prefix

# hmetis

- download from http://glaros.dtc.umn.edu/gkhome/fetch/sw/hmetis/hmetis-1.5-linux.tar.gz
- installation:
```
cp hmetis khmetis shmetis /install/prefix/bin
cp libhmetis.a /install/prefix/lib
cd /install/prefix/bin
chmod +x hmetis khmetis shmetis
```

# ilp_partitioner

- `git clone https://github.com/juliannz/ilp_partitioner.git`
- `cmake .. -DILP_USE_CPLEX=OFF -DCMAKE_INSTALL_PREFIX=/install/prefix/`

0 comments on commit 27646b5

Please sign in to comment.