Re: [petsc-users] Using PETSC with an openMP program

2018-03-12 Thread Adrián Amor
Satish, I checked with the Intel support team and they told me that "Fortran does not allow what it calls "recursive I/O" (except for internal files) - once you start an I/O operation on a unit no other operation on that unit may begin". So the use of directive !$OMP CRITICAL is necesssary. The re

Re: [petsc-users] Using PETSC with an openMP program

2018-03-02 Thread Satish Balay
I just tried your test code with gfortran [without petsc] - and I don't understand it. Does gfortran not support this openmp usage? [tried gfortran 4.8.4 and 7.3.1] balay@es^/sandbox/balay/omp $ gfortran -fopenmp -c hellocount hellocount.F90 hellocount_main.F90 balay@es^/sandbox/balay/omp

Re: [petsc-users] Using PETSC with an openMP program

2018-03-02 Thread Adrián Amor
Thanks Satish, I tried the procedure you suggested and I get the same performance, so I guess that MKL is not a problem in this case (I agree with you that it has to be improved though... my makefile is a little chaotic with all the libraries that I use). And thanks Barry and Matthew! I'll try to

Re: [petsc-users] Using PETSC with an openMP program

2018-03-02 Thread Satish Balay
When using MKL - PETSc attempts to default to sequential MKL. Perhaps this pulls in a *conflicting* dependency against -liomp5 - and one has to use threaded MKL for this case. i.e not use -lmkl_sequential You appear to have multiple mkl libraires linked in - its not clear what they are for - and

Re: [petsc-users] Using PETSC with an openMP program

2018-03-02 Thread Smith, Barry F.
> On Mar 2, 2018, at 9:39 AM, Adrián Amor wrote: > > Thanks a lot for your early response! So, sorry if this is a very > straightforward question from your answer, and just to be sure, then can't I > use PETSC in a code where in some place OpenMP parallelization is used while > PETSC is call

Re: [petsc-users] Using PETSC with an openMP program

2018-03-02 Thread Matthew Knepley
On Fri, Mar 2, 2018 at 10:32 AM, Smith, Barry F. wrote: > >PETSc is for writing parallel codes using MPI, it is not for writing > parallel codes with OpenMP. http://www.mcs.anl.gov/petsc/ > miscellaneous/petscthreads.html To follow up: 1) We do not have any expertise debugging OpenMP pro

Re: [petsc-users] Using PETSC with an openMP program

2018-03-02 Thread Adrián Amor
Thanks a lot for your early response! So, sorry if this is a very straightforward question from your answer, and just to be sure, then can't I use PETSC in a code where in some place OpenMP parallelization is used while PETSC is called in a part of the program non-parallelized with OpenMP? Thanks!

Re: [petsc-users] Using PETSC with an openMP program

2018-03-02 Thread Smith, Barry F.
PETSc is for writing parallel codes using MPI, it is not for writing parallel codes with OpenMP. http://www.mcs.anl.gov/petsc/miscellaneous/petscthreads.html Barry > On Mar 2, 2018, at 9:00 AM, Adrián Amor wrote: > > Hi all, > > I have been working in the last months with PETSC in a

[petsc-users] Using PETSC with an openMP program

2018-03-02 Thread Adrián Amor
Hi all, I have been working in the last months with PETSC in a FEM program written on FORTRAN, so far sequential. Now, I want to parallelize it with OpenMP and I have found some problems. Finally, I have built a mockup program trying to localize the error. 1. I have compiled PETSC with these opti