Add option to set number of threads in settings.xml and command line.