By default, pymocd uses rayon, a Rust-based data-parallelism library that automatically leverages all available logical CPU threads. This is ideal for maximizing performance—but not always convenient when you need to run other tasks in parallel or are benchmarking performance under constrained conditions.

To limit CPU usage, you can set the number of threads used by pymocd with:

  pymocd.set_thread_count(n)
  

This function should be used before starting the algorithm! (obviously!)


ParameterTypeDescription
nu16How many logical threads you want to use.

Last updated 31 May 2025, 17:21 -0300 . history