[petsc-users] thread model

Shri abhyshr at mcs.anl.gov
Fri Nov 2 22:24:11 CDT 2012

On Nov 2, 2012, at 9:54 PM, Mohammad Mirzadeh wrote:

> Hi,
> To use the new thread model in PETSc, does it suffice to run the code with the following?
> -threadcomm_type <openmp/pthread> -threadcomm_nthreads <#>
> When I run the code with openmp, only 1 processor/core is active (looking at top). When using pthread, all cores are active. Am I missing something?
OpenMP defaults to binding all threads to a single core if the cpu affinity is not specified explicitly. If you
are using GNU OpenMP then you can bind the threads to specific cores using the environment variable GOMP_CPU_AFFINITY http://gcc.gnu.org/onlinedocs/libgomp/GOMP_005fCPU_005fAFFINITY.html
If you are some other OpenMP implementation then check its manual to see how to set cpu affinity. 


More information about the petsc-users mailing list