From 14300684118e3564165c6cc10b54e54aede68a36 Mon Sep 17 00:00:00 2001 From: reeceneffpnnl Date: Tue, 6 Jun 2023 13:44:28 -0700 Subject: [PATCH 1/2] Added top-level configuration and static assertion for binary loading/dumping --- include/ripples/configuration.h | 5 ++++- include/ripples/generate_rrr_sets.h | 4 ++-- include/ripples/graph.h | 6 ++++++ include/ripples/imm.h | 4 ++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/include/ripples/configuration.h b/include/ripples/configuration.h index 3b260e61..b52d718f 100644 --- a/include/ripples/configuration.h +++ b/include/ripples/configuration.h @@ -56,6 +56,7 @@ namespace ripples { struct GraphInputConfiguration { std::string IFileName{""}; //!< The input file name std::string metall_dir{"/tmp/graph"}; //!< Where is the metall directory? + std::string rr_dir{"/tmp/rr"}; //!< Where is the rr directory? bool weighted{false}; //!< is Graph weighted? bool undirected{false}; //!< is Graph undirected? bool disable_renumbering{false}; //!< trust the input to be clean. @@ -74,7 +75,9 @@ struct GraphInputConfiguration { ->group("Input Options") ->required(); app.add_flag("--metall-store-dir", metall_dir, - "Directory to store metall graph data.") + "Directory to store metall graph data.") + ->group("Input Options") + app.add_flag("--rr-store-dir", rr_dir, "Directory to store RR data.") ->group("Input Options"); app.add_flag("--reload-binary", reload, "Reload a graph from binary input") ->group("Input Options"); diff --git a/include/ripples/generate_rrr_sets.h b/include/ripples/generate_rrr_sets.h index 919b0631..8567f14b 100644 --- a/include/ripples/generate_rrr_sets.h +++ b/include/ripples/generate_rrr_sets.h @@ -78,8 +78,8 @@ using RRRsetAllocator = libmemkind::pmem::allocator; template using RRRsetAllocator = metall::manager::allocator_type; -metall::manager &metall_manager_instance() { - static metall::manager manager(metall::create_only, "/dev/shm/metall_tmp"); +metall::manager &metall_manager_instance(std::string path) { + static metall::manager manager(metall::create_only, path.c_str()); return manager; } diff --git a/include/ripples/graph.h b/include/ripples/graph.h index 1af0a851..622c026c 100644 --- a/include/ripples/graph.h +++ b/include/ripples/graph.h @@ -591,6 +591,12 @@ class Graph { template void load_binary(FStream &FS) { + #ifdef ENABLE_METALL + // Static assert 0 + std::static_assert(0, "Not implemented yet, don't use with Metall"); + #endif + + if (!FS.is_open()) throw "Bad things happened!!!"; FS.read(reinterpret_cast(&numNodes), sizeof(numNodes)); diff --git a/include/ripples/imm.h b/include/ripples/imm.h index 3c15351f..f26e8354 100644 --- a/include/ripples/imm.h +++ b/include/ripples/imm.h @@ -180,7 +180,7 @@ auto Sampling(const GraphTy &G, const ConfTy &CFG, double l, double LB = 0; #if defined ENABLE_MEMKIND - RRRsetAllocator allocator("/mnt/bb/reeceneff/memkind_tmp", 0); + RRRsetAllocator allocator(CFG.rr_dir.c_str(), 0); #elif defined ENABLE_METALL_RRRSETS RRRsetAllocator allocator = metall_manager_instance().get_allocator(); #else @@ -266,7 +266,7 @@ auto Sampling(const GraphTy &G, const ConfTy &CFG, double l, double LB = 0; #if defined ENABLE_MEMKIND - RRRsetAllocator allocator("/mnt/bb/reeceneff/memkind_tmp", 0); + RRRsetAllocator allocator(CFG.rr_dir.c_str(), 0); #elif defined ENABLE_METALL_RRRSETS RRRsetAllocator allocator = metall_manager_instance().get_allocator(); #else From 86921ad3d2456f11102d97ab07f690dd93cdcc46 Mon Sep 17 00:00:00 2001 From: reeceneffpnnl Date: Tue, 6 Jun 2023 14:18:25 -0700 Subject: [PATCH 2/2] QOL bugfixes --- include/ripples/configuration.h | 2 +- include/ripples/graph.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ripples/configuration.h b/include/ripples/configuration.h index b52d718f..97791ffc 100644 --- a/include/ripples/configuration.h +++ b/include/ripples/configuration.h @@ -76,7 +76,7 @@ struct GraphInputConfiguration { ->required(); app.add_flag("--metall-store-dir", metall_dir, "Directory to store metall graph data.") - ->group("Input Options") + ->group("Input Options"); app.add_flag("--rr-store-dir", rr_dir, "Directory to store RR data.") ->group("Input Options"); app.add_flag("--reload-binary", reload, "Reload a graph from binary input") diff --git a/include/ripples/graph.h b/include/ripples/graph.h index 622c026c..df4ec6a4 100644 --- a/include/ripples/graph.h +++ b/include/ripples/graph.h @@ -593,7 +593,7 @@ class Graph { void load_binary(FStream &FS) { #ifdef ENABLE_METALL // Static assert 0 - std::static_assert(0, "Not implemented yet, don't use with Metall"); + throw 0 && "Not implemented yet, don't use with Metall"; #endif