OpenMP 4.0 provides the OMP_PLACES and OMP_PROC_BIND environment variables to specify how the OpenMP threads in a program are bound to processors. These two environment variable are often used in conjunction with each other. OMP_PLACES is used to specify the places on the machine (hardware threads, cores, or sockets) to which the threads are bound. OMP_PROC_BIND is used to specify the binding policy (thread affinity policy) which prescribes how the threads are assigned to places.
In addition to the two environment variables, OMP_PLACES and OMP_PROC_BIND, OpenMP 4.0 provides the proc_bind clause, which can appear on a parallel directive. The proc_bind clause is used to specify how the team of threads executing the parallel region are bound to processors.
For details about the OMP_PLACES and OMP_PROC_BIND environment variables and the proc_bind clause, refer to the OpenMP 4.0 specification.