AdvancedPhotonSource / tike

Repository for ptychography software
http://tike.readthedocs.io
Other
29 stars 15 forks source link

REF: Add NoPoolExecutor to avoid spawning threads for single GPU #286

Closed carterbox closed 1 year ago

carterbox commented 1 year ago

Purpose

Avoids creating a thread pool and pushing work to async Python threads when there is only one GPU. This is unnecessary when there is only one GPU because the thread pool only has one worker, and GPU work is async anyways.

Approach

Replaces the ThreadPool with a placeholder class when there is only one worker.

Pre-Merge Checklists

Submitter

Reviewer