Skip to content

Commit 20f9fe8

Browse files
committed
🐛 select best config by default
1 parent 42f5426 commit 20f9fe8

File tree

2 files changed

+5
-33
lines changed

2 files changed

+5
-33
lines changed

inc/leidenLowmem.hxx

+4-4
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ inline W leidenLowmemDeltaModularityMajority(const G& x, K u, K d, K c, const ve
283283
* @param fa is vertex allowed to be updated?
284284
* @returns iterations performed (0 if converged already)
285285
*/
286-
template <bool REFINE=false, bool MULTI=false, class G, class K, class V, class W, class B, size_t SLOTS, class FC, class FA>
286+
template <bool REFINE=false, bool MULTI=true, class G, class K, class V, class W, class B, size_t SLOTS, class FC, class FA>
287287
inline int leidenLowmemMoveOmpW(vector<K>& vcom, vector<W>& ctot, vector<B>& vaff, vector<array<K, SLOTS>*>& mcs, vector<array<V, SLOTS>*>& mws, const G& x, const vector<K>& vcob, const vector<W>& vtot, double M, double R, int L, FC fc, FA fa) {
288288
size_t S = x.span();
289289
int l = 0;
@@ -342,7 +342,7 @@ inline int leidenLowmemMoveOmpW(vector<K>& vcom, vector<W>& ctot, vector<B>& vaf
342342
* @param fc has local moving phase converged?
343343
* @returns iterations performed (0 if converged already)
344344
*/
345-
template <bool REFINE=false, bool MULTI=false, class G, class K, class V, class W, class B, size_t SLOTS, class FC>
345+
template <bool REFINE=false, bool MULTI=true, class G, class K, class V, class W, class B, size_t SLOTS, class FC>
346346
inline int leidenLowmemMoveOmpW(vector<K>& vcom, vector<W>& ctot, vector<B>& vaff, vector<array<K, SLOTS>*>& mcs, vector<array<V, SLOTS>*>& mws, const G& x, const vector<K>& vcob, const vector<W>& vtot, double M, double R, int L, FC fc) {
347347
auto fa = [](auto u) { return true; };
348348
return leidenLowmemMoveOmpW<REFINE, MULTI>(vcom, ctot, vaff, mcs, mws, x, vcob, vtot, M, R, L, fc, fa);
@@ -425,7 +425,7 @@ inline void leidenLowmemAggregateOmpW(vector<size_t>& yoff, vector<K>& ydeg, vec
425425
* @param fa is vertex allowed to be updated? (u)
426426
* @returns leiden result
427427
*/
428-
template <bool MULTI=false, size_t SLOTS=4, class G, class FI, class FM, class FA>
428+
template <bool MULTI=true, size_t SLOTS=64, class G, class FI, class FM, class FA>
429429
inline auto leidenLowmemInvokeOmp(const G& x, const LeidenOptions& o, FI fi, FM fm, FA fa) {
430430
using K = typename G::key_type;
431431
using V = typename G::edge_value_type;
@@ -554,7 +554,7 @@ inline auto leidenLowmemInvokeOmp(const G& x, const LeidenOptions& o, FI fi, FM
554554
* @param o leiden options
555555
* @returns leiden result
556556
*/
557-
template <bool MULTI=false, size_t SLOTS=4, class G>
557+
template <bool MULTI=true, size_t SLOTS=64, class G>
558558
inline auto leidenLowmemStaticOmp(const G& x, const LeidenOptions& o={}) {
559559
using B = char;
560560
using W = LEIDEN_WEIGHT_TYPE;

main.cxx

+1-29
Original file line numberDiff line numberDiff line change
@@ -64,37 +64,9 @@ void runExperiment(const G& x) {
6464
}
6565
// Get community memberships on original graph (low memory).
6666
{
67-
auto b1 = leidenLowmemStaticOmp<false>(x, repeat);
68-
flog(b1, "leidenLowmemStaticOmpMajority", 0);
69-
}
70-
{
71-
auto b1 = leidenLowmemStaticOmp<true, 4>(x, repeat);
72-
flog(b1, "leidenLowmemStaticOmpMajorities", 4);
73-
}
74-
{
75-
auto b1 = leidenLowmemStaticOmp<true, 8>(x, repeat);
76-
flog(b1, "leidenLowmemStaticOmpMajorities", 8);
77-
}
78-
{
79-
auto b1 = leidenLowmemStaticOmp<true, 16>(x, repeat);
80-
flog(b1, "leidenLowmemStaticOmpMajorities", 16);
81-
}
82-
{
83-
auto b1 = leidenLowmemStaticOmp<true, 32>(x, repeat);
84-
flog(b1, "leidenLowmemStaticOmpMajorities", 32);
85-
}
86-
{
87-
auto b1 = leidenLowmemStaticOmp<true, 64>(x, repeat);
67+
auto b1 = leidenLowmemStaticOmp(x, {repeat});
8868
flog(b1, "leidenLowmemStaticOmpMajorities", 64);
8969
}
90-
{
91-
auto b1 = leidenLowmemStaticOmp<true, 128>(x, repeat);
92-
flog(b1, "leidenLowmemStaticOmpMajorities", 128);
93-
}
94-
{
95-
auto b1 = leidenLowmemStaticOmp<true, 256>(x, repeat);
96-
flog(b1, "leidenLowmemStaticOmpMajorities", 256);
97-
}
9870
}
9971

10072

0 commit comments

Comments
 (0)