Skip to content

Commit

Permalink
fix(graph-properties-tool): add option to read graph with parhip format
Browse files Browse the repository at this point in the history
  • Loading branch information
dsalwasser committed Apr 23, 2024
1 parent 58b3227 commit 214c996
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/io/shm_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include "kaminpar-shm/datastructures/compressed_graph.h"
#include "kaminpar-shm/datastructures/csr_graph.h"
#include "kaminpar-shm/datastructures/graph.h"
#include "kaminpar-shm/kaminpar.h"

#include "kaminpar-common/datastructures/static_array.h"
Expand Down
17 changes: 15 additions & 2 deletions apps/tools/shm_graph_properties_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,30 @@ void print_graph_properties(const Graph &graph, const Context ctx, std::ostream
int main(int argc, char *argv[]) {
Context ctx = create_default_context();
std::string graph_filename;
io::GraphFileFormat graph_file_format = io::GraphFileFormat::METIS;

CLI::App app("Shared-memory graph properties tool");
app.add_option("-G,--graph", graph_filename, "Input graph in METIS format")->required();
app.add_option("-t,--threads", ctx.parallel.num_threads, "Number of threads");
app.add_option("-f,--graph-file-format", graph_file_format)
->transform(CLI::CheckedTransformer(io::get_graph_file_formats()).description(""))
->description(R"(Graph file formats:
- metis
- parhip)")
->capture_default_str();
create_graph_compression_options(&app, ctx);
CLI11_PARSE(app, argc, argv);

tbb::global_control gc(tbb::global_control::max_allowed_parallelism, ctx.parallel.num_threads);

Graph graph =
io::read(graph_filename, ctx.compression.enabled, ctx.compression.may_dismiss, false, false);
Graph graph = io::read(
graph_filename,
graph_file_format,
ctx.compression.enabled,
ctx.compression.may_dismiss,
false,
false
);

ctx.debug.graph_name = str::extract_basename(graph_filename);
ctx.compression.setup(graph);
Expand Down

0 comments on commit 214c996

Please sign in to comment.