micmacIGN / micmac

Free open-source photogrammetry software tools
http://micmac.ensg.eu
Other
686 stars 150 forks source link

add thread control through an env variable #185

Closed bclmary closed 2 years ago

bclmary commented 2 years ago

----- context

This pull request respond to my needs of using micmac on a calculus cluster. I couldn't let micmac to use all available computing cores on the cluster. I did so need to control the maximum number of threads created by micmac.

----- the commit message

The number of maximum usable threads can be controlled by the environment variable MICMAC_MAX_THREADS. If not setted, all available threads will be used (previous default). If setted with an integer, the given number will be considered as the max number of usable threads.

CAUTION : there is no safeguard for the following edge cases :

luc-girod commented 2 years ago

Merged, that's indeed a useful feature, thanks! I hope it works in every OS.