Skip to content

Commit

Permalink
Rename macro and identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
s1ck committed Oct 14, 2023
1 parent f3e90b8 commit 1c1f0ab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions crates/app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{path::PathBuf, time::Instant};

use graph::prelude::*;

use crate::runner::runner;
use crate::runner::gen_runner;
use kommandozeile::*;
use log::info;

Expand All @@ -11,9 +11,9 @@ mod runner;
mod serialize;
mod triangle_count;

runner!(unweighted: page_rank, graph::page_rank::page_rank, PageRankConfig);
runner!(unweighted: wcc, graph::wcc::wcc_afforest_dss, WccConfig);
runner!(weighted: sssp, graph::sssp::delta_stepping, DeltaSteppingConfig, f32);
gen_runner!(directed+unweighted: page_rank, graph::page_rank::page_rank, PageRankConfig);
gen_runner!(directed+unweighted: wcc, graph::wcc::wcc_afforest_dss, WccConfig);
gen_runner!(directed+weighted: sssp, graph::sssp::delta_stepping, DeltaSteppingConfig, f32);

fn main() -> Result<()> {
let args = setup_clap::<Args>().run()?;
Expand Down
24 changes: 12 additions & 12 deletions crates/app/src/runner.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
macro_rules! runner {
(unweighted: $algo_name:ident, $algo_func:expr, $algo_config:ty) => {
macro_rules! gen_runner {
(directed+unweighted: $algo_name:ident, $algo_func:expr, $algo_config:ty) => {
mod $algo_name {
use graph::prelude::*;
crate::runner!(__entry: $algo_config);
crate::runner!(__run_file_format_all: $algo_config, ());
crate::runner!(__run_graph_format: $algo_config, ());
crate::runner!(__bench: $algo_func, $algo_config, DirectedNeighbors<NI>, ());
crate::gen_runner!(__entry: $algo_config);
crate::gen_runner!(__run_file_format_all: $algo_config, ());
crate::gen_runner!(__run_graph_format: $algo_config, ());
crate::gen_runner!(__bench: $algo_func, $algo_config, DirectedNeighbors<NI>, ());
}
};

(weighted: $algo_name:ident, $algo_func:expr, $algo_config:ty, $ev_type:ty) => {
(directed+weighted: $algo_name:ident, $algo_func:expr, $algo_config:ty, $ev_type:ty) => {
mod $algo_name {
use graph::prelude::*;
crate::runner!(__entry: $algo_config);
crate::runner!(__run_file_format_edge_list: $algo_config, $ev_type);
crate::runner!(__run_graph_format: $algo_config, $ev_type);
crate::runner!(__bench: $algo_func, $algo_config, DirectedNeighborsWithValues<NI, $ev_type>, $ev_type);
crate::gen_runner!(__entry: $algo_config);
crate::gen_runner!(__run_file_format_edge_list: $algo_config, $ev_type);
crate::gen_runner!(__run_graph_format: $algo_config, $ev_type);
crate::gen_runner!(__bench: $algo_func, $algo_config, DirectedNeighborsWithValues<NI, $ev_type>, $ev_type);
}
};

Expand Down Expand Up @@ -133,4 +133,4 @@ macro_rules! runner {
};
}

pub(crate) use runner;
pub(crate) use gen_runner;

0 comments on commit 1c1f0ab

Please sign in to comment.