GNU Astronomy Utilities


Next: , Previous: , Up: Common program behavior   [Contents][Index]


4.3 Threads in Gnuastro

Some of the programs benefit significantly when you use all the threads your computer’s CPU has to offer to your operating system. GNU Astronomy Utilities uses the POSIX threads library (pthreads) for spinning off threads when the user asks for it. The number of threads available to your operating system is usually double the number of physical (hardware) cores in your CPU. On a GNU/Linux system, the number of threads available can be found with the command $ nproc command (part of GNU Coreutils).

Gnuastro can find the number of threads available to your system at run-time (when you execute the program). However, if a value is given provided for the --numthreads option, the given value will be used, not the value automatically read from your system, see Operating modes and Configuration files for ways to set a different value. Thus --numthreads is the only option with a value that doesn’t have to be specified anywhere on the command-line or in the options.