From 618db140283a70e2da1f0acbfecc4215b776b2ac Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Wed, 20 Dec 2023 15:08:49 +0200 Subject: [PATCH] Farm during initial plotting by default on large (more than 8 logical cores) CPUs --- .../src/bin/subspace-farmer/commands/farm.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs b/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs index 08dab6b1c8..93bb9f3fb1 100644 --- a/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs +++ b/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs @@ -59,6 +59,10 @@ fn available_parallelism() -> usize { } } +fn should_farm_during_initial_plotting() -> bool { + available_parallelism() > 8 +} + /// Arguments for farmer #[derive(Debug, Parser)] pub(crate) struct FarmingArgs { @@ -125,7 +129,7 @@ pub(crate) struct FarmingArgs { /// intense on CPU and memory that farming will likely not work properly, yet it will /// significantly impact plotting speed, delaying the time when farming can actually work /// properly. - #[arg(long)] + #[arg(long, default_value_t = should_farm_during_initial_plotting(), action = clap::ArgAction::Set)] farm_during_initial_plotting: bool, /// Size of PER FARM thread pool used for farming (mostly for blocking I/O, but also for some /// compute-intensive operations during proving), defaults to number of CPU cores available in @@ -170,8 +174,8 @@ struct DsnArgs { /// Multiaddr to listen on for subspace networking, for instance `/ip4/0.0.0.0/tcp/0`, /// multiple are supported. #[arg(long, default_values_t = [ - "/ip4/0.0.0.0/udp/30533/quic-v1".parse::().expect("Manual setting"), - "/ip4/0.0.0.0/tcp/30533".parse::().expect("Manual setting"), + "/ip4/0.0.0.0/udp/30533/quic-v1".parse::().expect("Statically correct; qed"), + "/ip4/0.0.0.0/tcp/30533".parse::().expect("Statically correct; qed"), ])] listen_on: Vec, /// Determines whether we allow keeping non-global (private, shared, loopback..) addresses in