Re: [petsc-users] Can not configure PETSc-master with clang-3.9

2017-10-16 Thread Satish Balay
Ok - this is not clang from apple. So I guess it needs that extra 'xcode-select 
--install'

I don't think gcc from brew needed this. [And I don't remember if I checked 
clang from brew]

Satish


On Mon, 16 Oct 2017, Kong, Fande wrote:

> On Mon, Oct 16, 2017 at 12:07 PM, Satish Balay  wrote:
> 
> > BTW: Which clang are you using?
> >
> > mpicc -show
> >
> 
> 
> 
> mpicc -show
> 
> clang -Wl,-commons,use_dylibs
> -I/opt/moose/mpich/mpich-3.2/clang-opt/include
> -L/opt/moose/mpich/mpich-3.2/clang-opt/lib -lmpi -lpmpi
> 
> 
> 
> > mpicc --version
> >
> 
> mpicc -v
> 
> mpicc for MPICH version 3.2
> clang version 3.9.0 (tags/RELEASE_390/final)
> Target: x86_64-apple-darwin16.7.0
> Thread model: posix
> InstalledDir: /opt/moose/llvm-3.9.0/bin
> clang-3.9: warning: argument unused during compilation: '-I
> /opt/moose/mpich/mpich-3.2/clang-opt/include'
> 
> 
> I guess because we are using a customize installation of clang.
> 
> 
> Fande,
> 
> 
> >
> > Satish
> >
> > On Mon, 16 Oct 2017, Satish Balay wrote:
> >
> > > Thats weird.
> > >
> > > From what I can recall - some tools (like pgi compilers) need this -
> > > but the xcode compilers do not.
> > >
> > > Basically xcode clang can pick up includes from the xcode specific
> > > location - but other tools look for includes in /usr/incldue
> > >
> > > And 'xcode-select --install' adds the /usr/include etc links.
> > >
> > > Satish
> > >
> > >
> > > On Mon, 16 Oct 2017, Kong, Fande wrote:
> > >
> > > > Now it is working. It turns out I need to do something like
> > "xcode-select
> > > > --install" after upgrading OS, and of course we need to agree the
> > license.
> > > >
> > > >
> > > > Fande,
> > > >
> > > > On Mon, Oct 16, 2017 at 10:58 AM, Richard Tran Mills 
> > > > wrote:
> > > >
> > > > > Fande,
> > > > >
> > > > > Did you remember to agree to the XCode license after your upgrade,
> > if you
> > > > > did an XCode upgrade? You have to do the license agreement again,
> > otherwise
> > > > > the compilers don't work at all. Apologies if this seems like a
> > silly thing
> > > > > to ask, but this has caused me a few minutes of confusion before.
> > > > >
> > > > > --Richard
> > > > >
> > > > > On Mon, Oct 16, 2017 at 9:52 AM, Jed Brown  wrote:
> > > > >
> > > > >> "Kong, Fande"  writes:
> > > > >>
> > > > >> > Hi All,
> > > > >> >
> > > > >> > I just upgraded  MAC OS, and also updated all other related
> > packages.
> > > > >> Now
> > > > >> > I can not configure PETSc-master any more.
> > > > >>
> > > > >> Your compiler paths are broken.
> > > > >>
> > > > >> /var/folders/6q/y12qpzw12dg5qx5x96dd5_bhtzr4_y/T/petsc-
> > > > >> mFgio7/config.setCompilers/conftest.c:3:10: fatal error:
> > 'stdlib.h' file
> > > > >> not found
> > > > >> #include 
> > > > >>  ^
> > > > >> 1 error generated.
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> > >
> >
> >
> 



Re: [petsc-users] Can not configure PETSc-master with clang-3.9

2017-10-16 Thread Kong, Fande
On Mon, Oct 16, 2017 at 12:07 PM, Satish Balay  wrote:

> BTW: Which clang are you using?
>
> mpicc -show
>



mpicc -show

clang -Wl,-commons,use_dylibs
-I/opt/moose/mpich/mpich-3.2/clang-opt/include
-L/opt/moose/mpich/mpich-3.2/clang-opt/lib -lmpi -lpmpi



> mpicc --version
>

mpicc -v

mpicc for MPICH version 3.2
clang version 3.9.0 (tags/RELEASE_390/final)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /opt/moose/llvm-3.9.0/bin
clang-3.9: warning: argument unused during compilation: '-I
/opt/moose/mpich/mpich-3.2/clang-opt/include'


I guess because we are using a customize installation of clang.


Fande,


>
> Satish
>
> On Mon, 16 Oct 2017, Satish Balay wrote:
>
> > Thats weird.
> >
> > From what I can recall - some tools (like pgi compilers) need this -
> > but the xcode compilers do not.
> >
> > Basically xcode clang can pick up includes from the xcode specific
> > location - but other tools look for includes in /usr/incldue
> >
> > And 'xcode-select --install' adds the /usr/include etc links.
> >
> > Satish
> >
> >
> > On Mon, 16 Oct 2017, Kong, Fande wrote:
> >
> > > Now it is working. It turns out I need to do something like
> "xcode-select
> > > --install" after upgrading OS, and of course we need to agree the
> license.
> > >
> > >
> > > Fande,
> > >
> > > On Mon, Oct 16, 2017 at 10:58 AM, Richard Tran Mills 
> > > wrote:
> > >
> > > > Fande,
> > > >
> > > > Did you remember to agree to the XCode license after your upgrade,
> if you
> > > > did an XCode upgrade? You have to do the license agreement again,
> otherwise
> > > > the compilers don't work at all. Apologies if this seems like a
> silly thing
> > > > to ask, but this has caused me a few minutes of confusion before.
> > > >
> > > > --Richard
> > > >
> > > > On Mon, Oct 16, 2017 at 9:52 AM, Jed Brown  wrote:
> > > >
> > > >> "Kong, Fande"  writes:
> > > >>
> > > >> > Hi All,
> > > >> >
> > > >> > I just upgraded  MAC OS, and also updated all other related
> packages.
> > > >> Now
> > > >> > I can not configure PETSc-master any more.
> > > >>
> > > >> Your compiler paths are broken.
> > > >>
> > > >> /var/folders/6q/y12qpzw12dg5qx5x96dd5_bhtzr4_y/T/petsc-
> > > >> mFgio7/config.setCompilers/conftest.c:3:10: fatal error:
> 'stdlib.h' file
> > > >> not found
> > > >> #include 
> > > >>  ^
> > > >> 1 error generated.
> > > >>
> > > >
> > > >
> > >
> >
> >
>
>


Re: [petsc-users] Can not configure PETSc-master with clang-3.9

2017-10-16 Thread Satish Balay
BTW: Which clang are you using?

mpicc -show
mpicc --version

Satish

On Mon, 16 Oct 2017, Satish Balay wrote:

> Thats weird.
> 
> From what I can recall - some tools (like pgi compilers) need this -
> but the xcode compilers do not.
> 
> Basically xcode clang can pick up includes from the xcode specific
> location - but other tools look for includes in /usr/incldue
> 
> And 'xcode-select --install' adds the /usr/include etc links.
> 
> Satish
> 
> 
> On Mon, 16 Oct 2017, Kong, Fande wrote:
> 
> > Now it is working. It turns out I need to do something like "xcode-select
> > --install" after upgrading OS, and of course we need to agree the license.
> > 
> > 
> > Fande,
> > 
> > On Mon, Oct 16, 2017 at 10:58 AM, Richard Tran Mills 
> > wrote:
> > 
> > > Fande,
> > >
> > > Did you remember to agree to the XCode license after your upgrade, if you
> > > did an XCode upgrade? You have to do the license agreement again, 
> > > otherwise
> > > the compilers don't work at all. Apologies if this seems like a silly 
> > > thing
> > > to ask, but this has caused me a few minutes of confusion before.
> > >
> > > --Richard
> > >
> > > On Mon, Oct 16, 2017 at 9:52 AM, Jed Brown  wrote:
> > >
> > >> "Kong, Fande"  writes:
> > >>
> > >> > Hi All,
> > >> >
> > >> > I just upgraded  MAC OS, and also updated all other related packages.
> > >> Now
> > >> > I can not configure PETSc-master any more.
> > >>
> > >> Your compiler paths are broken.
> > >>
> > >> /var/folders/6q/y12qpzw12dg5qx5x96dd5_bhtzr4_y/T/petsc-
> > >> mFgio7/config.setCompilers/conftest.c:3:10: fatal error: 'stdlib.h' file
> > >> not found
> > >> #include 
> > >>  ^
> > >> 1 error generated.
> > >>
> > >
> > >
> > 
> 
> 



Re: [petsc-users] Can not configure PETSc-master with clang-3.9

2017-10-16 Thread Kong, Fande
Now it is working. It turns out I need to do something like "xcode-select
--install" after upgrading OS, and of course we need to agree the license.


Fande,

On Mon, Oct 16, 2017 at 10:58 AM, Richard Tran Mills 
wrote:

> Fande,
>
> Did you remember to agree to the XCode license after your upgrade, if you
> did an XCode upgrade? You have to do the license agreement again, otherwise
> the compilers don't work at all. Apologies if this seems like a silly thing
> to ask, but this has caused me a few minutes of confusion before.
>
> --Richard
>
> On Mon, Oct 16, 2017 at 9:52 AM, Jed Brown  wrote:
>
>> "Kong, Fande"  writes:
>>
>> > Hi All,
>> >
>> > I just upgraded  MAC OS, and also updated all other related packages.
>> Now
>> > I can not configure PETSc-master any more.
>>
>> Your compiler paths are broken.
>>
>> /var/folders/6q/y12qpzw12dg5qx5x96dd5_bhtzr4_y/T/petsc-
>> mFgio7/config.setCompilers/conftest.c:3:10: fatal error: 'stdlib.h' file
>> not found
>> #include 
>>  ^
>> 1 error generated.
>>
>
>


Re: [petsc-users] Can not configure PETSc-master with clang-3.9

2017-10-16 Thread Richard Tran Mills
Fande,

Did you remember to agree to the XCode license after your upgrade, if you
did an XCode upgrade? You have to do the license agreement again, otherwise
the compilers don't work at all. Apologies if this seems like a silly thing
to ask, but this has caused me a few minutes of confusion before.

--Richard

On Mon, Oct 16, 2017 at 9:52 AM, Jed Brown  wrote:

> "Kong, Fande"  writes:
>
> > Hi All,
> >
> > I just upgraded  MAC OS, and also updated all other related packages.
> Now
> > I can not configure PETSc-master any more.
>
> Your compiler paths are broken.
>
> /var/folders/6q/y12qpzw12dg5qx5x96dd5_bhtzr4_y/T/petsc-mFgio7/config.setCompilers/conftest.c:3:10:
> fatal error: 'stdlib.h' file not found
> #include 
>  ^
> 1 error generated.
>


Re: [petsc-users] Can not configure PETSc-master with clang-3.9

2017-10-16 Thread Jed Brown
"Kong, Fande"  writes:

> Hi All,
>
> I just upgraded  MAC OS, and also updated all other related packages.  Now
> I can not configure PETSc-master any more.

Your compiler paths are broken.

/var/folders/6q/y12qpzw12dg5qx5x96dd5_bhtzr4_y/T/petsc-mFgio7/config.setCompilers/conftest.c:3:10:
 fatal error: 'stdlib.h' file not found
#include 
 ^
1 error generated.


Re: [petsc-users] Can not configure PETSc-master with clang-3.9

2017-10-16 Thread Matthew Knepley
On Mon, Oct 16, 2017 at 12:07 PM, Kong, Fande  wrote:

> Hi All,
>
> I just upgraded  MAC OS, and also updated all other related packages.  Now
> I can not configure PETSc-master any more.
>
> See the attachment for more details.
>

Something is really wrong with your compilers

Source:
#include "confdefs.h"
#include "conffix.h"
#include 
Preprocess stderr before
filtering:/var/folders/6q/y12qpzw12dg5qx5x96dd5_bhtzr4_y/T/petsc-mFgio7/config.setCompilers/conftest.c:3:10:
fatal error: 'stdlib.h' file not found
#include 
 ^
1 error generated.
:

   Matt


>
>
> Fande,
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ 


Re: [petsc-users] Parallelizing a matrix-free code

2017-10-16 Thread Praveen C
I am interested to learn more about how this works. How are the vectors
created if the ids are not contiguous in a partition ?

Thanks
praveen

On Mon, Oct 16, 2017 at 2:02 PM, Stefano Zampini 
wrote:

>
>
> 2017-10-16 10:26 GMT+03:00 Michael Werner :
>
>> Hello,
>>
>> I'm having trouble with parallelizing a matrix-free code with PETSc. In
>> this code, I use an external CFD code to provide the matrix-vector product
>> for an iterative solver in PETSc. To increase convergence rate, I'm using
>> an explicitly stored Jacobian matrix to precondition the solver. This works
>> fine for serial runs. However, when I try to use multiple processes, I face
>> the problem that PETSc decomposes the preconditioner matrix, and probably
>> also the shell matrix, in a different way than the external CFD code
>> decomposes the grid.
>>
>> The Jacobian matrix is built in a way, that its rows and columns
>> correspond to the global IDs of the individual points in my CFD mesh
>>
>> The CFD code decomposes the domain based on the proximity of points to
>> each other, so that the resulting subgrids are coherent. However, since its
>> an unstructured grid, those subgrids are not necessarily made up of points
>> with successive global IDs. This is a problem, since PETSc seems to
>> partition the matrix in  coherent slices.
>>
>> I'm not sure what the best approach to this problem might be. Is it maybe
>> possible to exactly tell PETSc, which rows/columns it should assign to the
>> individual processes?
>>
>>
> If you are explicitly setting the values in your Jacobians via
> MatSetValues(), you can create a ISLocalToGlobalMapping
>
> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/IS/
> ISLocalToGlobalMappingCreate.html
>
> that maps the numbering you use for the Jacobians to their counterpart in
> the CFD ordering, then call MatSetLocalToGlobalMapping and then use
> MatSetValuesLocal with the same arguments you are calling MatSetValues now.
>
> Otherwise, you can play with the application ordering
> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/AO/index.html
>
>
>
>
> --
> Stefano
>


Re: [petsc-users] Good recommendation on meshing package?

2017-10-16 Thread Zou, Ling
Matt, thanks for your input.
This is very helpful.

Ling

On Fri, Oct 13, 2017 at 8:13 AM, Matthew Knepley  wrote:

> On Fri, Sep 29, 2017 at 11:06 AM, Zou, Ling  wrote:
>
>> Hi all,
>>
>> I know this is a bit off topic on PETSc email list.
>> I would like to try some finite volume type of CFD algorithm with PETSc,
>> but I found it quite troublesome to manage mesh by myself.
>> I wonder if there is any good existing meshing package that works well
>> with PTESc.
>>
>
> It possible you could use the DMPlex support in PETSc.
>
>
>> My expectation on such a package would be:
>> 1) I create the mesh with some tool.
>>
>
> We support at least GMsh, ExodusII, PLY, Triangle, and TetGen.
>
>
>> 2) Read this mesh with the meshing package, so I have things like node
>> set, edge set, cell set, etc. to play with
>> 3) discretize my PDE with the mesh
>> 4) solve it
>>
>> I also understand many people here use PETSc solve their CFD problem.
>> I would appreciate it if you could also point me to some good examples.
>>
>
> There are a bunch of tests, like src/dm/impls/plex/examples/tests/ex1
> which reads in a mesh and views it, and also
> some examples of solving PDEs, all elliptic, such as SNES ex12, ex62, and
> ex77 and TS ex45, ex46, and ex47.
>
>   Thanks,
>
>  Matt
>
>
>> Best,
>>
>> Ling
>>
>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> 
>


Re: [petsc-users] Parallelizing a matrix-free code

2017-10-16 Thread Praveen C


> On 16-Oct-2017, at 12:56 PM, Michael Werner  wrote:
> 
> However, since its an unstructured grid, those subgrids are not necessarily 
> made up of points with successive global IDs.

It should be easy to renumber the points so that each partition has 
contiguously numbered point ids. This is what we do in our CFD code during the 
stage where we partition the mesh with Metis.

Best
praveen

[petsc-users] Parallelizing a matrix-free code

2017-10-16 Thread Michael Werner

Hello,

I'm having trouble with parallelizing a matrix-free code with PETSc. In 
this code, I use an external CFD code to provide the matrix-vector 
product for an iterative solver in PETSc. To increase convergence rate, 
I'm using an explicitly stored Jacobian matrix to precondition the 
solver. This works fine for serial runs. However, when I try to use 
multiple processes, I face the problem that PETSc decomposes the 
preconditioner matrix, and probably also the shell matrix, in a 
different way than the external CFD code decomposes the grid.


The Jacobian matrix is built in a way, that its rows and columns 
correspond to the global IDs of the individual points in my CFD mesh


The CFD code decomposes the domain based on the proximity of points to 
each other, so that the resulting subgrids are coherent. However, since 
its an unstructured grid, those subgrids are not necessarily made up of 
points with successive global IDs. This is a problem, since PETSc seems 
to partition the matrix inĀ  coherent slices.


I'm not sure what the best approach to this problem might be. Is it 
maybe possible to exactly tell PETSc, which rows/columns it should 
assign to the individual processes?