Intel® C++ Compiler 16.0 User and Reference Guide
By default, the number of worker threads is set to the number of cores on the host system. In most cases, the default value works well. (Additionally, on systems that support simultaneous multithreading on each core, Intel® Cilk™ Plus uses all available hardware threads.)
You can increase or decrease the number of workers under program control or via the environment. You may want to use fewer workers than the number of processor cores available in order to run tests or to reserve resources for other programs. In some cases, you may want to oversubscribe by creating more workers than the number of available processor cores. This may be useful if you have workers waiting on locks, or if you want to test a parallel program on a single-core computer.
Environment
You can specify the number of worker threads using the environment variable CILK_NWORKERS.
Windows*: set CILK_NWORKERS=4
Linux* and OS X*: export CILK_NWORKERS=4
Program Control
Prior to the first call to a function that performs a spawn (cilk_spawn or cilk_for) within a program, you may set the desired number of workers by calling __cilkrts_set_param("nworkers","N"), where N is a number expressed in decimal or, with a leading 0x or 0, in hexadecimal or octal. This call to set the worker count overrides the value set in the CILK_NWORKERS environment variable. To use __cilkrts_set_param, make sure to specify #include <cilk/cilk_api.h> in your program.
Example:
if (0!= __cilkrts_set_param("nworkers","4")) { printf("Failed to set worker count\n"); return 1; }