[petsc-dev] PETSc, VS2013 and OpenMP

Paul Mullowney paulmullowney at gmail.com
Sat Sep 6 14:01:12 CDT 2014


Hi,
Now I'm trying to build petsc-dev next in cygwin with the threadcomm/OpenMP
package (CUDA also but I solved my build issues for this already).

I successfully configured and built, however I ran into 3 problems.

1) I don't think that the OpenMP package should depend on pthreadsclasses.py
In openmp.py, I commented out lines 17-18:
    #self.pthreadclasses =
framework.require('PETSc.packages.pthreadclasses',self)
    #self.deps = [self.pthreadclasses]

2) Then, in include/petscerror.h.
line 409:
#if defined(PETSC_HAVE_PTHREADCLASSES) || defined (PETSC_HAVE_OPENMP)
...
#include <pthread.h>
#endif

should be

#if defined(PETSC_HAVE_PTHREADCLASSES)
...
#include <pthread.h>
#endif

3) Also, in include/petscerror.h
PETSC_EXTERN PetscStack *petscstack;
#pragma omp threadprivate(petscstack)

doesn't work in recent visual studio compilers (
http://stackoverflow.com/questions/12560243/using-threadprivate-directive-in-visual-studio
):

I commented out the 2 lines above and replaced with:
PETSC_EXTERN __declspec(thread) PetscStack *petscstack;

I doubt this is the correct solution for all architectures. Perhaps someone
more familiar with this OpenMP code can suggest other changes which might
be necessary.

-Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140906/85c71037/attachment.html>


More information about the petsc-dev mailing list