micmacIGN / micmac

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

Limit processor usage (linux) #170

Open prolibre opened 3 years ago

prolibre commented 3 years ago

Hello,

Is it possible to limit CPU usage when running mm3d (under linux) ? I tried to decrease the value :

... NBRP = 4 make -j $ NBRP ...

during compilation (in script_jenkins_unix.sh) but that does not change.

I have 8 threads and would only like to use 4 max.

kikislater commented 3 years ago

Using make affects just building of micmac not running micmac

You could try to use cpulimit like cpulimit -l 400 -e mm3d

Where 400 is the percentage of cpu : one thread is 100%, so here it's limited to 4 threads

prolibre commented 3 years ago

thanks @kikislater

I tried cpulimit but it seems that it works only for the parent process but not for the other (child) processes.

Exemple

cpulimit -e mm3d -l 400 -v
8 CPUs detected.
Priority changed to -10
Process 9454 detected

user   9454  0.0  0.1  64844 28736 pts/1    S+   11:39   0:00 mm3d Tapioca MulScale .*.JPG 300 2400 ExpTxt=0 NbMinPt=5
user  13933 95.6  1.6 305724 267168 pts/1   R+   14:37   0:27 /usr/local/micmac/bin/mm3d Ann ./Pastis (...) 
user  13935 92.4  1.6 305016 266796 pts/1   R+   14:37   0:15 /usr/local/micmac/bin/mm3d Ann ./Pastis (...)
(...)