Sure, you are looking for what is called thread affinity control.
Volume 2 of the art of HPC, chapter 25 (online for free) has a great explanation on how to do it, here is a global view answer:
Thread placement can be controlled with two environment variables:
The environment variable OMP_PROC_BIND describes how threads are bound to OpenMP places
While the variable OMP_PLACES describes these places in terms of the available hardware.
When you're experimenting with these variables it is a good idea to set OMP_DISPLAY_ENV to true, so that OpenMP will print out at runtime how it has interpreted your specification.