Parallel Module

The freud.parallel module tries to use all available threads for parallelization unless directed otherwise, with one exception. On the flux and nyx clusters, freud will only use one thread unless directed otherwise.


Set the number of threads for parallel computation.

Module author: Joshua Anderson <>

Parameters:nthreads (int or None) – number of threads to use. If None (default), use all threads available
class freud.parallel.NumThreads(N=None)[source]

Context manager for managing the number of threads to use.

Module author: Joshua Anderson <>

Parameters:N (int or None) – Number of threads to use in this context. Defaults to None, which will use all available threads.