kristinbranson / APT

Animal Part Tracker
GNU General Public License v3.0
72 stars 14 forks source link

Train-while-Track with limited numWorkers/cores #300

Closed allenleetc closed 5 years ago

allenleetc commented 5 years ago

Train-while-Track currently requires 2 parallel workers, one for the Training Monitor and one for the Tracking Monitor.

If you are on a single-core machine (eg a JRC cluster interactive matlab running on a single slot) the local parcluster will by default limit the number of workers to 1. The Tracking Monitor background process (parfeval) gets queued waiting for a worker; the Tracking Monitor hangs; the UI will not update when the tracking job is done, etc etc.

The profile for the local parcluster can be updated to enable more workers, but there could be performance issues. Alternatively just throw some friendlier errors etc.

allenleetc commented 5 years ago

check/protect against busy local cluster at canTrain() or canTrack()- time. This is not bulletproof as canTrain() occurs before the actual spawning of the bg process; in practice should be fine.

Note this issue may arise if/when the user utilizes the local parpool for their own purposes, irrespective of the actual number of cores avail to MATLAB etc.