I have problems compiling OpenMP code using clang (both 3.6 and 3.8 ToT).
I followed this blog post http://blog.llvm.org/2015/05/openmp-support_22.html , but the pro
OMP_NUM_THREADS environment variable is probably what you want. You can also set it programmatically.
https://gcc.gnu.org/onlinedocs/libgomp/Environment-Variables.html
And same for clang.