Parallel Module

Overview

freud.parallel.NumThreads

Context manager for managing the number of threads to use.

freud.parallel.get_num_threads

Get the number of threads for parallel computation.

freud.parallel.set_num_threads

Set the number of threads for parallel computation.

Details

The freud.parallel module controls the parallelization behavior of freud, determining how many threads the TBB-enabled parts of freud will use. freud uses all available threads for parallelization unless directed otherwise.

class freud.parallel.NumThreads

Bases: object

Context manager for managing the number of threads to use.

Parameters

N (int, optional) – Number of threads to use in this context. If None, which will use all available threads. (Default value = None).

freud.parallel.get_num_threads

Get the number of threads for parallel computation.

Returns

Number of threads.

Return type

(int)

freud.parallel.set_num_threads

Set the number of threads for parallel computation.

Parameters

nthreads (int, optional) – Number of threads to use. If None, use all threads available. (Default value = None).