Skip to content

Commit

Permalink
Add fold_scan and reduce_scan, update examples args
Browse files Browse the repository at this point in the history
  • Loading branch information
imDema committed Apr 16, 2024
1 parent 15a329f commit d4a0357
Show file tree
Hide file tree
Showing 27 changed files with 587 additions and 450 deletions.
97 changes: 52 additions & 45 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ homepage = "https://github.com/deib-polimi/renoir"
readme = "README.md"

[features]
default = ["clap", "ssh", "timestamp"]
default = ["clap", "ssh", "timestamp",]
timestamp = []
ssh = ["ssh2", "whoami", "shell-escape", "sha2", "base64"]
tokio = ["dep:tokio", "futures", "tokio/net", "tokio/io-util", "tokio/time", "tokio/rt-multi-thread", "tokio/macros"]
Expand All @@ -35,7 +35,7 @@ derivative = "2.2.0"

# serialization
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.115"
serde_json = "1.0.116"
bincode = "1.3.3"
toml = "0.8.12"

Expand Down
6 changes: 3 additions & 3 deletions examples/car_accidents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,14 @@ fn print_query3(

fn main() {
let (config, args) = RuntimeConfig::from_args();
if args.len() != 2 {
if args.len() != 3 {
panic!(
"Usage: {} dataset share_source",
std::env::args().next().unwrap()
);
}
let path = &args[0];
let share_source = &args[1];
let path = &args[1];
let share_source = &args[2];
let share_source = match share_source.as_str() {
"true" => true,
"false" => false,
Expand Down
4 changes: 2 additions & 2 deletions examples/collatz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

fn main() {
let (config, args) = RuntimeConfig::from_args();
if args.len() != 1 {
if args.len() != 2 {
panic!("Pass the number of integers to check");
}
let limit: u64 = args[0].parse().unwrap();
let limit: u64 = args[1].parse().unwrap();
let num_iter = 1000;

config.spawn_remote_workers();
Expand Down
10 changes: 5 additions & 5 deletions examples/connected_components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ impl State {

fn main() {
let (config, args) = RuntimeConfig::from_args();
if args.len() != 4 {
if args.len() != 5 {
panic!("Pass the number of iterations, number of vertices, vertex dataset and edges dataset as arguments");
}
let num_iterations: usize = args[0].parse().expect("Invalid number of iterations");
let num_vertices: usize = args[1].parse().expect("Invalid number of vertices");
let path_vertices = &args[2];
let path_edges = &args[3];
let num_iterations: usize = args[1].parse().expect("Invalid number of iterations");
let num_vertices: usize = args[2].parse().expect("Invalid number of vertices");
let path_vertices = &args[3];
let path_edges = &args[4];

config.spawn_remote_workers();
let env = StreamContext::new(config);
Expand Down
8 changes: 4 additions & 4 deletions examples/kmeans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ impl State {

fn main() {
let (config, args) = RuntimeConfig::from_args();
if args.len() != 3 {
if args.len() != 4 {
panic!("Pass the number of centroid, the number of iterations and the dataset path as arguments");
}
let num_centroids: usize = args[0].parse().expect("Invalid number of centroids");
let num_iters: usize = args[1].parse().expect("Invalid number of iterations");
let path = &args[2];
let num_centroids: usize = args[1].parse().expect("Invalid number of centroids");
let num_iters: usize = args[2].parse().expect("Invalid number of iterations");
let path = &args[3];

config.spawn_remote_workers();
let env = StreamContext::new(config);
Expand Down
10 changes: 5 additions & 5 deletions examples/pagerank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ const DAMPENING: f64 = 0.85;

fn main() {
let (config, args) = RuntimeConfig::from_args();
if args.len() != 4 {
if args.len() != 5 {
panic!("Pass the number of iterations, number of pages, pages dataset and links dataset as arguments");
}
let num_iterations: usize = args[0].parse().expect("Invalid number of iterations");
let num_pages: usize = args[1].parse().expect("Invalid number of pages");
let path_pages = &args[2];
let path_links = &args[3];
let num_iterations: usize = args[1].parse().expect("Invalid number of iterations");
let num_pages: usize = args[2].parse().expect("Invalid number of pages");
let path_pages = &args[3];
let path_links = &args[4];

config.spawn_remote_workers();
let env = StreamContext::new(config);
Expand Down
10 changes: 5 additions & 5 deletions examples/pagerank_stateful.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ const DAMPENING: f64 = 0.85;

fn main() {
let (config, args) = RuntimeConfig::from_args();
if args.len() != 4 {
if args.len() != 5 {
panic!("Pass the number of iterations, number of pages, pages dataset and links dataset as arguments");
}
let num_iterations: usize = args[0].parse().expect("Invalid number of iterations");
let num_pages: usize = args[1].parse().expect("Invalid number of pages");
let path_pages = &args[2];
let path_links = &args[3];
let num_iterations: usize = args[1].parse().expect("Invalid number of iterations");
let num_pages: usize = args[2].parse().expect("Invalid number of pages");
let path_pages = &args[3];
let path_links = &args[4];

config.spawn_remote_workers();
let env = StreamContext::new(config);
Expand Down
Loading

0 comments on commit d4a0357

Please sign in to comment.