Skip to content

Expose process-count limits on a per-transpile basis #9365

@jakelishman

Description

@jakelishman

What should we add?

It's currently possible to limit the number of processes used by all calls to transpile in a given Python process by the configuration file entry num_processes, or by the environment variable QISKIT_NUM_PROCS, but both of these are only read on import qiskit, and affect every call to transpile.

It would be good to expose a num_processes kwarg in transpile, which overrides either of these two options, and can be used to restrict an individual call to certain behaviour. We already have the right kwarg available in parallel.parallel_map, so exposing this to users should mostly be as straightforward as adding an option to transpile and propagating it through.

We might want to re-arrange the internal logic of parallel_map a little so that it's easier to pass num_processes=None without clobbering its internal default of taking the value from the environment if the option is empty.

Metadata

Metadata

Assignees

Labels

help wantedcommunity contributions welcome. For filters like http://github-help-wanted.com/mod: transpilerIssues and PRs related to Transpilertype: feature requestNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions