From 1c1f0ab59d927918623abd39528b18906cbe2ca4 Mon Sep 17 00:00:00 2001 From: Martin Junghanns Date: Sat, 14 Oct 2023 18:03:00 +0200 Subject: [PATCH] Rename macro and identifiers --- crates/app/src/app.rs | 8 ++++---- crates/app/src/runner.rs | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/crates/app/src/app.rs b/crates/app/src/app.rs index 5bac78c..d250027 100644 --- a/crates/app/src/app.rs +++ b/crates/app/src/app.rs @@ -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; @@ -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::().run()?; diff --git a/crates/app/src/runner.rs b/crates/app/src/runner.rs index d8fe18d..042a840 100644 --- a/crates/app/src/runner.rs +++ b/crates/app/src/runner.rs @@ -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, ()); + 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, ()); } }; - (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, $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, $ev_type); } }; @@ -133,4 +133,4 @@ macro_rules! runner { }; } -pub(crate) use runner; +pub(crate) use gen_runner;