Skip to content
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
5fdf43b
Port external tools from sbg partitioner.
joaquinffernandez Dec 11, 2025
8ef09fe
generate graph from sbg input
francosansone Dec 22, 2025
b3cd191
Merge branch 'sb-graph-dev' into iss-121-port-external-tool-from-sb-g…
francosansone Jan 21, 2026
76d4b89
connecting graph partition with sbg
francosansone Jan 27, 2026
a2521e7
added memory monitor
francosansone Jan 27, 2026
542f8ae
improve compilation time
francosansone Feb 3, 2026
cb66c7b
prepare benchmarking
francosansone Feb 3, 2026
a88dd17
update script
francosansone Feb 4, 2026
fa91cc4
added memory benchmarking
francosansone Feb 6, 2026
84d87f7
removed annoying print
francosansone Feb 6, 2026
23dc928
fix metis
francosansone Feb 11, 2026
0c1a2b8
Use references in Scotch partitioner.
joaquinffernandez Feb 18, 2026
0277bf7
added two python scripts
francosansone Mar 12, 2026
ec9a876
temporal change with many lines of code commented to test edge-cut va…
francosansone Mar 16, 2026
d07f3c1
added data to test
francosansone Mar 16, 2026
dd9c7cf
make it work for Scotch
francosansone Mar 16, 2026
429c6d0
print connections
francosansone Mar 17, 2026
af998eb
upload air conditioner model input
francosansone Mar 25, 2026
0f86f3e
release by default
francosansone Mar 30, 2026
81fa01c
take into account if air conditioner cont is the input
francosansone Mar 30, 2026
030dc13
air cond with controllers
francosansone Apr 1, 2026
51277d2
pass number of sections to air cond with controller
francosansone Apr 7, 2026
ea2550c
update_diff working
francosansone Apr 10, 2026
655ab5f
compute ec and ic in each step
francosansone Apr 10, 2026
1891c70
compute all methods all at once
francosansone Apr 10, 2026
3da258b
call graph partitioner properly
francosansone Apr 10, 2026
1f0e428
just adapting memory monitor
francosansone Apr 24, 2026
2488f53
communication cost changes
francosansone Apr 29, 2026
41a8b05
change back function name
francosansone Apr 29, 2026
f49a44f
split sets according to their connections
francosansone Apr 29, 2026
17f8fcc
update graph partitioner according to changes
francosansone Apr 29, 2026
d70d818
disable test case
francosansone Apr 29, 2026
134d944
stop compiling partition_graph_cc
francosansone Apr 29, 2026
de917cc
ignore deploy directories
francosansone Apr 29, 2026
c814310
add code to compute metrics
francosansone Apr 29, 2026
6d35443
added 'dump-results' flag
francosansone May 4, 2026
cd4a6ae
added dump-results flag
francosansone May 4, 2026
8616702
duplicate N:N connections
francosansone May 8, 2026
5ee27c8
dump results
francosansone May 8, 2026
888301f
fixed internal comm
francosansone May 13, 2026
a4004fc
use size_t to avoid overflow
francosansone Jun 3, 2026
4b3c0a6
create sb graph for advection 2d
francosansone Jun 3, 2026
4d17902
make it work for 2-dimensional graphs
francosansone Jun 3, 2026
8c00927
make advection 2d work
francosansone Jun 3, 2026
1438978
dump graph edges for 2D
francosansone Jun 10, 2026
95cc381
make graph partitioner or 2D
francosansone Jun 10, 2026
91d127a
remove debug messages
francosansone Jun 10, 2026
58fc0a8
hack for 2d graphs
francosansone Jun 10, 2026
0c5739e
make partitioner handle two dimensions properly
francosansone Jun 12, 2026
131d87b
dump results for 2d
francosansone Jun 12, 2026
0fed4d3
write 2d graph properly
francosansone Jun 16, 2026
105b1e0
[iss-136]
joaquinffernandez Jun 18, 2026
d106d7e
removed annoying messages
francosansone Jun 24, 2026
32cf5d0
examples and simulation data for JAIIO 55
francosansone Jun 24, 2026
61004f0
removed annotiny messages
francosansone Jun 24, 2026
5480514
final changes to model implementations
francosansone Jun 29, 2026
7d770eb
dup conns
francosansone Jul 17, 2026
cc14372
add dup conns
francosansone Jul 22, 2026
567c99d
added input generators
francosansone Aug 28, 2026
7f2dbcf
last changes before tag
francosansone Sep 1, 2026
009dc0d
Remove obsolete sources
francosansone Oct 27, 2026
2872646
Merge sb-graph-dev
francosansone Oct 27, 2026
5445db7
make cut_interval_by_dimension work for every dimension
francosansone Oct 27, 2026
0f31dcb
Revert "make cut_interval_by_dimension work for every dimension"
francosansone Oct 27, 2026
02c4bd2
Revert "Merge sb-graph-dev"
francosansone Oct 27, 2026
2482f05
make external tools work
francosansone Oct 29, 2026
5b5b6dd
make cut_interval_by_dimension work for N dimensions
francosansone Oct 29, 2026
ad6cad9
added benchmark
francosansone Oct 29, 2026
04d3f47
Merge remote-tracking branch 'origin/sb-graph-dev' into iss-121-port-…
francosansone Oct 30, 2026
b807eca
rmove ground truth files
francosansone Nov 2, 2026
d3b431c
remove part files
francosansone Nov 3, 2026
ae16cf2
Merge branch 'sb-graph-dev' into iss-121-port-external-tool-from-sb-g…
francosansone Nov 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/partitioner-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Partitioner Benchmark

on:
push:
pull_request:
branches: [ sb-graph-dev ]

concurrency:
group: partitioner-benchmark-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
benchmark:
runs-on: ubuntu-24.04
timeout-minutes: 120

steps:
- uses: actions/checkout@v2

- name: Install deps.
run: |
sudo apt-get update
sudo apt-get install libboost1.83-dev
sudo apt-get install libboost-program-options-dev
sudo apt-get install cmake
sudo apt-get install g++
sudo apt-get install rapidjson-dev

- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

- name: Build sbg-partitioner
run: cmake --build build -j --target sbg-partitioner

- name: Run benchmark
run: |
python3 test/partitioner/benchmark/run_benchmark.py \
--binary build/algorithms/partitioner/sbg-partitioner \
--output bench.json \
--repetitions 3 \
--timeout 900

- name: Upload raw results
if: always()
uses: actions/upload-artifact@v4
with:
name: partitioner-bench-${{ github.run_id }}
path: bench.json
retention-days: 90

- name: Compare against history / store baseline
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'customSmallerIsBetter'
output-file-path: bench.json
github-token: ${{ secrets.GITHUB_TOKEN }}
benchmark-data-dir-path: dev/bench/partitioner
alert-threshold: '120%'
fail-on-alert: true
comment-on-alert: false
auto-push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/sb-graph-dev' }}
save-data-file: ${{ github.event_name == 'push' && github.ref == 'refs/heads/sb-graph-dev' }}
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,32 @@ extension. The bin/sbg-parser and bin/sbg-eval binaries accept these files as
their input. Also, the `make test` command in the root directory will execute
all of the existing tests.

## Partitioner Benchmark

`test/partitioner/benchmark/run_benchmark.py` runs `sbg-partitioner` over a
fixed set of models, sizes and partition counts, checks that every run
succeeds, and reports the median execution time (build + partition) across a
few repetitions. To run it locally:

```
cmake --build build --target sbg-partitioner
python3 test/partitioner/benchmark/run_benchmark.py \
--binary build/algorithms/partitioner/sbg-partitioner \
--output bench.json
```

The `partitioner-benchmark` GitHub workflow runs this on every push and on
pull requests targeting `sb-graph-dev`. Results are compared against the
latest history stored on the `gh-pages` branch
(`dev/bench/partitioner`, viewable as a chart if GitHub Pages is enabled for
that branch); only pushes to `sb-graph-dev` update that history. If any case
is more than 20% slower than the stored baseline, the workflow fails and
GitHub e-mails whoever pushed the change (per their notification settings).

One case, `air_conditioners_cont` with size 1000 and 16 partitions, is
excluded: the KL refinement does not converge for it in a reasonable time.
This is tracked as a separate issue, not a benchmark limitation.

## Licensing

Please see the file called LICENSE.
Expand Down
2 changes: 1 addition & 1 deletion algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
add_subdirectory(cc)
add_subdirectory(matching)
add_subdirectory(mfvs)
#add_subdirectory(partitioner)
add_subdirectory(partitioner)
add_subdirectory(scc)
add_subdirectory(sorting)
6 changes: 3 additions & 3 deletions algorithms/cc/cc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ PWMap connectedComponents(const SBG& sbg)
rmap = aux_rmap;
rmap = rmap.mapInf();
}
} while (rmap != old_rmap);
} while (rmap != old_rmap);

rmap.compact();
return rmap;
Expand All @@ -72,6 +72,6 @@ PWMap connectedComponents(const SBG& sbg)
return PWMap{};
}

} // namespace LIB
} // namespace LIB

} // namespace SBG
} // namespace SBG
23 changes: 8 additions & 15 deletions algorithms/matching/bfs_matching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,17 @@ namespace detail {
// BFS Matching Algorithm ------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////

BFSMatching::ExitCondition::ExitCondition(bool full_match, bool found_paths)
: full_match_(full_match), found_paths_(found_paths) {}
BFSMatching::ExitCondition::ExitCondition(bool full_match, bool found_paths) : full_match_(full_match), found_paths_(found_paths) {}

bool BFSMatching::ExitCondition::full_match() { return full_match_; }

bool BFSMatching::ExitCondition::found_paths() { return found_paths_; }

bool BFSMatching::ExitCondition::isSatisfied()
{
return full_match_ || !found_paths_;
}
bool BFSMatching::ExitCondition::isSatisfied() { return full_match_ || !found_paths_; }

// Algorithm -------------------------------------------------------------------

BFSMatching::BFSMatching() : _M(), _dsbg() , _direction(Direction::kForward)
, _X(), _Y() {}
BFSMatching::BFSMatching() : _M(), _dsbg(), _direction(Direction::kForward), _X(), _Y() {}

void BFSMatching::swapEdgesDirection(const Set& E)
{
Expand Down Expand Up @@ -75,8 +70,7 @@ PWMap BFSMatching::partitionSubsetEdges() const
std::size_t arity = free_edges.arity();
unsigned int j = 1;
PWMap Emap = _dsbg.Emap();
_dsbg.foreachSetEdge([&](const IntTuple& SE)
{
_dsbg.foreachSetEdge([&](const IntTuple& SE) {
Set domain_edges = Emap.preImage(Set{SE});

Expression matched_expr{IntTuple{arity, j}};
Expand All @@ -100,8 +94,7 @@ Set BFSMatching::directedStep(const Set& E)
// Calculate unmatched vertices in the side determined by the current
// direction of edges
Set matched_forward_vertices = mapB.image(_M);
Set unmatched_forward_vertices
= _X.difference(matched_forward_vertices);
Set unmatched_forward_vertices = _X.difference(matched_forward_vertices);

// Detect paths leading to unmatched_forward_vertices
DirectedSBG restricted_dsbg{_dsbg.V(), _dsbg.Vmap(), mapB, mapD, Emap};
Expand Down Expand Up @@ -186,8 +179,8 @@ MatchData BFSMatching::calculate(const BipartiteSBG& bsbg)
return result;
}

} // namespace detail
} // namespace detail

} // namespace LIB
} // namespace LIB

} // namespace SBG
} // namespace SBG
12 changes: 6 additions & 6 deletions algorithms/matching/bfs_paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Set BFSPaths::calculate(const DirectedSBG& dsbg, const Set& endings)
// A record of allowed edges to keep out cycle edges
Set E = dsbg.E();
// Ingoing edges to vertices that reach endings
Set ingoing = mapD.preImage(endings);
Set ingoing = mapD.preImage(endings);
// A record of visited set-edges
Set visitedSE;
do {
Expand All @@ -61,11 +61,11 @@ Set BFSPaths::calculate(const DirectedSBG& dsbg, const Set& endings)
// Edges that lead to a successor
Set Ei = auxD.equalImage(ith_smap.composition(auxB));
// Visited set-edges
Set repeatedSE = visitedSE.intersection(Emap.image(Ei));
Set repeatedSE = visitedSE.intersection(Emap.image(Ei));
if (!repeatedSE.isEmpty()) {
// Propose candidate successors for repetitive paths
Set Eplus = Emap.preImage(repeatedSE);
PWMap smap_plus = auxB.restrict(Eplus).minAdj(auxD.restrict(Eplus));
PWMap smap_plus = auxB.restrict(Eplus).minAdj(auxD.restrict(Eplus));
Util::DEBUG_LOG << "smap_plus: " << smap_plus << "\n";
ith_smap = ith_smap.combine(smap_plus);
visitedSE = visitedSE.difference(repeatedSE);
Expand Down Expand Up @@ -99,8 +99,8 @@ Set BFSPaths::calculate(const DirectedSBG& dsbg, const Set& endings)
return P;
}

} // namespace detail
} // namespace detail

} // namespace LIB
} // namespace LIB

} // namespace SBG
} // namespace SBG
35 changes: 17 additions & 18 deletions algorithms/matching/match_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,26 @@ namespace LIB {
std::ostream& operator<<(std::ostream& out, const Direction& direction)
{
switch (direction) {
case Direction::kForward: {
out << "forward";
break;
}

case Direction::kBackward: {
out << "backward";
break;
}

default: {
Util::ERROR("Unsupported direction");
break;
}
case Direction::kForward: {
out << "forward";
break;
}

case Direction::kBackward: {
out << "backward";
break;
}

default: {
Util::ERROR("Unsupported direction");
break;
}
}

return out;
}

MatchData::MatchData(BipartiteSBG bsbg, Set M, bool full_match)
: _bsbg(bsbg), _M(M), _full_match(full_match) {}
MatchData::MatchData(BipartiteSBG bsbg, Set M, bool full_match) : _bsbg(bsbg), _M(M), _full_match(full_match) {}

const BipartiteSBG& MatchData::bsbg() const { return _bsbg; }

Expand All @@ -67,6 +66,6 @@ std::ostream& operator<<(std::ostream& out, const MatchData& data)
return out;
}

} // namespace LIB
} // namespace LIB

} // namespace SBG
} // namespace SBG
26 changes: 13 additions & 13 deletions algorithms/matching/matching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ namespace SBG {
namespace LIB {

////////////////////////////////////////////////////////////////////////////////
// Matching Algorithm Interface ------------------------------------------------
// Matching Algorithm Interface ------------------------------------------------
////////////////////////////////////////////////////////////////////////////////

Matching::Matching() : _impl()
{
MatchKind kind = MATCH_IMPL.kind();
switch (kind) {
case MatchKind::kBFSPaths: {
_impl = detail::BFSMatching{};
break;
}

default: {
Util::ERROR("Unsupported matching algorithm implementation");
break;
}
}
case MatchKind::kBFSPaths: {
_impl = detail::BFSMatching{};
break;
}

default: {
Util::ERROR("Unsupported matching algorithm implementation");
break;
}
}
}

MatchData Matching::calculate(const BipartiteSBG& bsbg)
Expand All @@ -53,6 +53,6 @@ MatchData Matching::calculate(const BipartiteSBG& bsbg)
return std::visit([&](auto& a) { return a.calculate(bsbg); }, _impl);
}

} // namespace LIB
} // namespace LIB

} // namespace SBG
} // namespace SBG
22 changes: 11 additions & 11 deletions algorithms/matching/matching_impl.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ namespace LIB {
std::ostream& operator<<(std::ostream& out, const MatchKind kind)
{
switch (kind) {
case MatchKind::kBFSPaths: {
out << "BFS paths";
break;
}

default: {
Util::ERROR("Unsupported matching algorithm implementation");
break;
}
case MatchKind::kBFSPaths: {
out << "BFS paths";
break;
}

default: {
Util::ERROR("Unsupported matching algorithm implementation");
break;
}
}

return out;
Expand All @@ -57,6 +57,6 @@ const MatchKind& MatchImplementation::kind() const { return _kind; }

void MatchImplementation::set_match_fact(MatchKind kind) { _kind = kind; }

} // namespace LIB
} // namespace LIB

} // namespace SBG
} // namespace SBG
8 changes: 4 additions & 4 deletions algorithms/mfvs/greedy_mfvs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace detail {
GreedyMFVS::GreedyMFVS() {}

/**
* @brief It calculates the minimum vertex with maximum degree.
* @brief It calculates the minimum vertex with maximum degree.
*/
IntTuple maxDegreeVertex(const DirectedSBG& dsbg)
{
Expand Down Expand Up @@ -104,8 +104,8 @@ Set GreedyMFVS::calculate(const DirectedSBG& input_dsbg) const
return fvs_result;
}

} // namespace detail
} // namespace detail

} // namespace LIB
} // namespace LIB

} // namespace SBG
} // namespace SBG
Loading
Loading