Module utils

Source
Expand description

Various utilities used by farmer or with farmer

Modules§

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

Structs§

AsyncJoinOnDrop
Joins async join handle on drop
CpuCoreSet
Abstraction for CPU core set

Functions§

all_cpu_cores
Get all cpu cores, grouped into sets according to NUMA nodes or L3 cache groups on large CPUs.
create_plotting_thread_pool_manager
Create thread pools manager.
parse_cpu_cores_sets
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.
rayon_custom_spawn_handler
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_farming_threads
Recommended number of thread pool size for farming, equal to number of CPU cores in the first NUMA node
run_future_in_dedicated_thread
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_pool_core_indices
Thread indices for each thread pool
tokio_rayon_spawn_handler
This function is supposed to be used with [rayon::ThreadPoolBuilder::spawn_handler()] to inherit current tokio runtime.