added support for OMP_NUM_THREADS environment variable