[petsc-dev] sizeof(PetscInt) from buildsystem

Garth N. Wells gnw20 at cam.ac.uk
Tue May 6 08:56:14 CDT 2014


On 2014-05-06 09:46, Aron Ahmadia wrote:
> One way to do this is to consult the reconfigure-* script.  If
> the -with-64-bit-indices flag is set, then you've got 64-bit ints.
>  Otherwise, you've got 32-bit ints.
> 

We use Makefile queries to get the PETSc build details, so it would 
helpful if we could stick with that.

> Any particular reason petsc4py doesn't work for you here?  Lisandro
> wrote some rather sophisticated parsing of the PETSc install as part
> of the petsc4py configuration (which is mostly Cython-driven).
> 

This isn't for petsc4py. We have some plain arrays and std::vectors of  
PetscInt type (for compatibility with PETSc without copying data) which 
we sometimes wrap as NumPy arrays.

Garth

> A
> 
> On Tue, May 6, 2014 at 8:39 AM, Garth N. Wells <gnw20 at cam.ac.uk>
> wrote:
> 
>> It would be handy if I could get sizeof(PetscInt) from
>> conf/petscvariables or something similar. Would this be feasible or
>> is it already easily accessible without building code? (The
>> motivation is to create static SWIG typemaps for NumPy arrays - at
>> the moment I'm picking the right typemap at runtime).
>> 
>> Garth



More information about the petsc-dev mailing list