Module subspace_farmer::utils

source ·
Expand description

Various utilities used by farmer or with farmer

Modules§

  • Modified version of SS58 parser extracted from Substrate in order to not pull the whole sp-core into farmer application

Structs§

Functions§

  • Get all cpu cores, grouped into sets according to NUMA nodes or L3 cache groups on large CPUs.
  • Creates thread pool pairs for each of CPU core set pair with number of plotting and replotting threads corresponding to number of cores in each set and pins threads to all of those CPU cores (each thread to all cors in a set, not thread per core). Each thread will also have Tokio context available.
  • Parse space-separated set of groups of CPU cores (individual cores are coma-separated) into vector of CPU core sets that can be used for creation of plotting/replotting thread pools.
  • This function is supposed to be used with [rayon::ThreadPoolBuilder::spawn_handler()] to spawn handler with a custom logic defined by spawn_hook_builder.
  • Recommended number of thread pool size for farming, equal to number of CPU cores in the first NUMA node
  • Runs future on a dedicated thread with the specified name, will block on drop until background thread with future is stopped too, ensuring nothing is left in memory
  • Thread indices for each thread pool
  • This function is supposed to be used with [rayon::ThreadPoolBuilder::spawn_handler()] to inherit current tokio runtime.