Skip to main content

Crate webgraph_cli

Crate webgraph_cli 

Source
Expand description

§CLI for WebGraph

crates.io badge docs.rs badge rustc badge CI badge license badge downloads badge

Command-line interface for the Rust implementation of the WebGraph framework for graph compression.

This crate provides the webgraph CLI tool with various subcommands for working with compressed graphs. The tool can be installed with cargo install webgraph-cli, or by invoking cargo build and retrieving it from your target directory.

The tool supports:

  • Building accessory data structures (Elias–Fano offsets, DCF)
  • Converting graphs between formats (arcs, ASCII, endianness)
  • Transforming graphs (transpose, simplify)
  • Analyzing graphs (code statistics)
  • Running algorithms (Layered Label Propagation)
  • Benchmarking graph operations

Each module corresponds to a group of commands, and each command is implemented as a submodule.

The command webgraph build complete will generate completion code for several commonly used shells, making it easier to use the CLI tool. For example if you are using bash, you can run:

source <(webgraph build complete bash)

to have completions in the current shell session.

§Subcommands

  • analyze: computes statistics on graphs;
  • bench: benchmarks graph operations;
  • build: builds accessory graph data structures;
  • check: checks coherence of graph files;
  • from: ingests data into graphs;
  • perm: creates and manipulates permutations;
  • run: runs algorithms on graph;
  • to: converts graphs between representations;
  • transform: applies transformations to graphs.

§Separate Binaries

This crate also provides specialized standalone binaries:

  • webgraph-dist: tools for computing graph properties based on distances, including measures of centrality (HyperBall, ExactSumSweep);
  • webgraph-sccs: computes strongly connected components;
  • webgraph-rank: computes centrality measures on graphs.

§Environment Variables

  • RUST_MIN_STACK: Minimum thread stack size (in bytes); we suggest RUST_MIN_STACK=8388608 (8MiB)
  • TMPDIR: Where to store temporary files (potentially very large ones)
  • RUST_LOG: Configuration for env_logger

§Acknowledgments

This software has been partially supported by project SERICS (PE00000014) under the NRRP MUR program funded by the EU - NGEU, and by project ANR COREGRAPHIE, grant ANR-20-CE23-0002 of the French Agence Nationale de la Recherche. Views and opinions expressed are however those of the authors only and do not necessarily reflect those of the European Union or the Italian MUR. Neither the European Union nor the Italian MUR can be held responsible for them.

Modules§

analyze
bench
build
build_info
check
dist
from
perm
rank
run
sccs
seq
to
transform

Macros§

dispatch_int_slice
Dispatches on an IntSlice, binding the concrete inner SliceByValue type to $var and evaluating $body for each variant.
par_comp
Calls par_comp dispatching on a runtime endianness string.

Structs§

ArcsArgs
Shared CLI arguments for reading files containing arcs.​
Cli
WebGraph tools to build, convert, modify, and analyze graphs.​
CompressArgs
Shared CLI arguments for compression.​
GranularityArgs
Shared CLI arguments for commands that specify a granularity.​
LogIntervalArg
Shared CLI arguments for commands that use a log interval.​
MemoryUsageArg
Shared CLI arguments for commands that specify a memory usage.
NumThreadsArg
Shared CLI arguments for commands that specify a number of threads.​

Enums§

FloatSliceFormat
Formats for storing and loading slices of floats.​
IntSlice
Loaded integer slice, returned by IntSliceFormat::load.
IntSliceFormat
How to store slices of integers.​
PrivCode
Enum for instantaneous codes.
SubCommands

Functions§

__par_comp_dispatch
Implementation detail of par_comp!. Dispatches to the correct endianness-specific par_comp.
cli_main
The entry point of the command-line interface.
create_parent_dir
Creates all parent directories of the given file path.
cutpoints
Computes cutpoints for splitting a graph into num_parts chunks for parallel compression.
get_thread_pool
Creates a ThreadPool with the given number of threads.
init_env_logger
Initializes the env_logger logger with a custom format including timestamps with elapsed time since initialization.
load_dcf
Memory-maps the degree cumulative function (DCF) of the graph with given basename, checking that it is consistent with the given number of nodes and arcs.
max_ref_count_parser
Parses the value of --max-ref-count: a nonnegative integer, or -1 for an infinite recursion depth.
memory_usage_parser
Parses a batch size.
num_threads_parser
Parses the number of threads from a string.
par_graph
Wraps a graph in a ParGraph splitting it into num_parts parts using the cutpoints computed for the graph with given basename.