[petsc-dev] OpenMP in PETSc when calling from Fortran?

Åsmund Ervik asmund.ervik at ntnu.no
Fri Mar 1 02:26:45 CST 2013


Hi Barry,

On 28. feb. 2013 17:38, Barry Smith wrote:
>
>      2) You should not need petscthreadcomm.h in Fortran. Simply using OpenMP progmas in your portion of the code.
 >

Thanks for clarifying this. I am already using OpenMP pragmas in 
non-PETSc routines in my code, and using petsc-dev. Are you saying that 
I should also somehow use OpenMP pragmas around the calls to KSPSolve etc.?

Suppose that my program is usually run like this:
"./run -pc_type gamg -ksp_type bcgs"
with other values left to their defaults, and I want to make it run in 
parallel:
"./run -pc type gamg -ksp_type bcgs -threadcomm_type openmp 
-threadcomm_nthreads 8"

When I do this, the PC and KSP still run in serial as far as I can tell, 
and the program does not execute faster. What am I missing here?

In case it is of interest, the matrix from my Poisson equation has in 
the range of 0.4 - 1 million nonzero elements, on average 5 per row.

Regards,
Åsmund



More information about the petsc-dev mailing list