qsearch.parallelizers

This module defines Parallelizer, which is a class that defines how to perform multiple circuits in parallel.

Several implementations are provided.

qsearch.parallelizers.LokyParallelizer

A Parallelizer based on Loky, a “deadlock-free” ProcessPoolExecutor

qsearch.parallelizers.MultiprocessingParallelizer

A Parallelizer based on multiprocessing

qsearch.parallelizers.ProcessPoolParallelizer

A Parallelizer based on concurrent.futures.ProcessPoolExecutor

qsearch.parallelizers.MPIParallelizer

A distributed MPI based Parallelizer

qsearch.parallelizers.SequentialParallelizer

Mostly for debugging purposes, a Parallelizer that runs tasks one at a time.

Module Contents

Classes

Parallelizer

Base class for all Parallelizers. Parallelizers calculate the value of multiple search nodes in parallel.

LokyParallelizer

A parallelizer based on Loky, a "deadlock-free" ProcessPoolExecutor.

MultiprocessingParallelizer

A Parallelizer based on muliprocessing. Note this cannot be used with the MultiStart_Solvers!

ProcessPoolParallelizer

A Parallelizer based on concurrent.futures.ProcessPoolExecutor.

MPIParallelizer

A distributed MPI based Parallelizer.

SequentialParallelizer

A Paralleizer that isn't, it runs tasks one at a time (mostly for debugging).

Functions

default_num_tasks(options)

evaluate_step(tup, options)

single_task(opts)

process_initializer()

Attributes

MPI

get_reusable_executor

qsearch.parallelizers.MPI
qsearch.parallelizers.get_reusable_executor
qsearch.parallelizers.default_num_tasks(options)
qsearch.parallelizers.evaluate_step(tup, options)
qsearch.parallelizers.single_task(opts)
qsearch.parallelizers.process_initializer()
class qsearch.parallelizers.Parallelizer

Base class for all Parallelizers. Parallelizers calculate the value of multiple search nodes in parallel.

solve_circuits_parallel(self, tuples)

Calculate the value of search tree nodes in parallel.

done(self)

Finalize/Clean up any state needed to run the Parallelizer.

class qsearch.parallelizers.LokyParallelizer(options)

Bases: Parallelizer

A parallelizer based on Loky, a “deadlock-free” ProcessPoolExecutor.

For more information on Loky see https://loky.readthedocs.io/en/stable/.

solve_circuits_parallel(self, tuples)

Calculate the value of search tree nodes in parallel.

class qsearch.parallelizers.MultiprocessingParallelizer(options)

Bases: Parallelizer

A Parallelizer based on muliprocessing. Note this cannot be used with the MultiStart_Solvers!

solve_circuits_parallel(self, tuples)

Calculate the value of search tree nodes in parallel.

done(self)

Finalize/Clean up any state needed to run the Parallelizer.

class qsearch.parallelizers.ProcessPoolParallelizer(options)

Bases: Parallelizer

A Parallelizer based on concurrent.futures.ProcessPoolExecutor.

solve_circuits_parallel(self, tuples)

Calculate the value of search tree nodes in parallel.

done(self)

Finalize/Clean up any state needed to run the Parallelizer.

class qsearch.parallelizers.MPIParallelizer(options)

Bases: Parallelizer

A distributed MPI based Parallelizer.

This implementation unfortunately requires some work on the part of the Project API or the user.

solve_circuits_parallel(self, tuples)

Calculate the value of search tree nodes in parallel.

map_steps(self, new_steps)
done(self)

Finalize/Clean up any state needed to run the Parallelizer.

class qsearch.parallelizers.SequentialParallelizer(options)

Bases: Parallelizer

A Paralleizer that isn’t, it runs tasks one at a time (mostly for debugging).

solve_circuits_parallel(self, tuples)

Calculate the value of search tree nodes in parallel.