diff --git a/README.md b/README.md index e4dd83a..c1acd27 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,33 @@ **CFG_bench** is a tool for benchmarking the CFL algorithm from LAGraph. +## CLI Help + +```text +Usage: ./build/cfg_bench -c [options] + +Required: + -c Path to benchmark config file + +Benchmark options: + -r Number of benchmark rounds (default: 10) + --hot Enable HOT launch (warm-up run before measurements) + -a Algorithm to use (default: CFL_adv; options: CFL_adv, CFL, CFL_single_path, CFL_all_path, CFL_CFPQ_RSM, CFL_multsrc) + +Optimization flags: + -e Enable empty optimization + -f Enable format optimization + -l Enable lazy optimization + -b Enable block optimization + +Other: + -t Enable test mode + -h Print this help message + +Example: + ./build/cfg_bench -c configs/configs_my.csv -r 10 --hot +``` + ## Usage 1. Install **GraphBLAS**: @@ -48,6 +75,21 @@ The benchmark reads its input set from a CSV file passed with `-c`: Use `-r` to set the number of benchmark rounds and `--hot` to enable the HOT launch warm-up run. +The `CFL_adv` algorithm also supports optimization flags: + +| Flag | Optimization | +| ---- | ------------ | +| `-e` | empty | +| `-f` | format | +| `-l` | lazy | +| `-b` | block | + +These flags can be combined. For example, to enable all optimizations, run: + +```bash +./build/cfg_bench -efbl -c configs/configs_my.csv -r 10 --hot +``` + Each row in the config file has this format: ```text @@ -60,6 +102,54 @@ Example from `configs/configs_my.csv`: data/graphs/c_alias/init.g,data/grammars/c_alias.cnf,3783769 ``` +## Grammar Format + +Grammar files contain one production rule per line: + +```text + [RIGHT_SYMBOL_1] [RIGHT_SYMBOL_2] +``` + +- `` is the nonterminal on the left-hand side of the rule. +- `[RIGHT_SYMBOL_1]` and `[RIGHT_SYMBOL_2]` are optional right-hand side symbols. +- Symbols are separated by tabs. +- The `Count:` line is required. The start symbol must be placed on the next line. +- Indexed symbols must end with `_i`, for example `a_i` or `AS_i`. + +Example: + +```text +S AS_i b_i +AS_i a_i S +S c + +Count: +S +``` + +## Graph Format + +Graph files contain one edge per line: + +```text + [LABEL_INDEX] +``` + +- `` and `` are zero-based vertex ids. +- `` is the terminal label on the edge. +- `[LABEL_INDEX]` is optional and specifies the concrete index for labels ending with `_i`. +- Values are separated by tabs. +- For example, an edge labeled `x_9` is written as `x_i 9`. + +Example: + +```text +1 2 a_i 1 +2 3 b_i 1 +2 4 b_i 2 +1 5 c +``` + ## Adding a New Configuration To add a custom benchmark configuration: diff --git a/src/test.c b/src/test.c index 24b59ad..acd4d9d 100644 --- a/src/test.c +++ b/src/test.c @@ -111,7 +111,7 @@ static void print_usage(const char *program_name) { " -r Number of benchmark rounds (default: 10)\n" " --hot Enable HOT launch (warm-up run before measurements)\n" " -a Algorithm to use " - "(default: CFL_adv; options: CFL_adv, CFL, CFL_single_path, CFL_all_path)\n" + "(default: CFL_adv; options: CFL_adv, CFL, CFL_single_path, CFL_all_path, CFL_CFPQ_RSM, CFL_multsrc)\n" "\n" "Optimization flags:\n" " -e Enable empty optimization\n"