AlanRace / SpectralAnalysis

Software for the analysis and interactive exploration of spectral imaging data
https://alanrace.github.io/SpectralAnalysis/
Apache License 2.0
29 stars 9 forks source link

[FEATURE] Specify number of cores used for datacube generation #39

Open adamjtaylor opened 3 years ago

adamjtaylor commented 3 years ago

Is your feature request related to a problem? Please describe. Datacube generation is parallelised for speed. By default, it uses all available threads which may compromise the performance of other processes being run by the user.

Describe the solution you'd like Enable the user to specify the number of cores used for datacube generation (initially in command line usage but might be nice to have in the GUI as well). Suggest changing the default to number of cores/threads minus 1 to leave one free for other user processes.

Describe alternatives you've considered This is likely already implemented in MATLAB preferences and we just need to call a helper function. We could even just suggest in the docs where the user can adjust themselves.

Additional context Chugging away nicely on 20 threads. image

adamjtaylor commented 3 years ago

I think we can control this with maxNumCompThreads

max_threads= maxNumCompThreads; maxNumCompThreads(max_threads-1);