petsc for 64 bits

Matthew Knepley knepley at
Wed Jul 30 08:08:31 CDT 2008

1) On a 64-bit architecture, ONLY pointers are 64 bits, not integers.

2) The option --with-64-bit-indices is for people with extremely long
    arrays, not for 64 bit machines.

3) On a 64 bit machine, PETSc will automatically switch to long pointers
    if the 64 bit compilers are used.

4) I suspect the problem is that when you compile FEAP, It explicitly
    manipulates the size of an integer, and does not tell us. The correct
    way to interact with PETSc is to use PetscInt, which is always the
    right size.


On Wed, Jul 30, 2008 at 3:08 AM, Carlos A. Catania (AKA Harpo)
<harpomaxx at> wrote:
> Hello,
> Perhaps this is not the right place to ask this question because I am using
> PETSC as a library inside a third-part software. I am using feap[1] which
> uses PETSC and also Metis for parallel execution support.
> I have a question related to petsc under 64bits. Feap is written in
> Fortran and uses 8 bytes integer data type. As far I know this is the normal
> behavior for AMD 64bit arch (perhaps this is not true). However when
> feap invokes PETSC libraries,
> a segfault error messages is shown. I read a little bit about it and
> the problems seems to be that Petsc uses 4 bytes integers (normal
> behaviour for IA32 arch) and there
> are some problems with pointer references which cause the segfault error
> message.
> Reading petsc documentation I found an option to compile petsc with 64
> bit integer support --with-64-bit-indices=1. I tried it but when compiling
> several  incompatibles error messages are shown. Moreover when I
> run the test I got a lot of errors like:
> -------------------------------------------------------------
> Possible error running C/C++ src/snes/examples/tutorials/ex19 with 2 MPI
> processes
> See
> [1]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> [1]PETSC ERROR: Null argument, when expecting valid pointer!
> [1]PETSC ERROR: Null Object: Parameter # 1!
> ------------------------------------------------------------------------
> [1]PETSC ERROR: Petsc Release Version 2.3.3, Patch 3, Fri Jun 15
> 16:51:25 CDT 2007 HG revision: f051789beadcd36f77fb6111d20225e26ed7cc0d
> [1]PETSC ERROR: See docs/changes/index.html for recent updates.
> [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> [1]PETSC ERROR: See docs/index.html for manual pages.
> ------------------------------------------------------------------------
> So my question is if it is posible to compile petsc with  64bits
> integer support?
> Besides --with-64-bit-indices option, is there another option I should
> add to get petsc tests work?
> My configuration is:
> AMD 64
> petsc version 2.3.3-p3
> Intel C an Fortran compilers v 9.1
> MPICH2 1.0.7
> I configured petsc with this options:
> /config/ PETSC_ARCH=GNU/Linux-gnu-amd64 CC=icc FC=ifort
> --with-mpi-dir=/opt/mpich2/  --download-f-blas-lapack=1 --with-fc=ifort
> --with-64-bit-indices=1
> Thanks in advance
> [1] Feap:
> --
> Carlos A. Catania (AKA Harpo+)
> [FP] F152 8D50 6939 E21A 7A90  CDD4 AEE4 FA48 DF70 4D68

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

More information about the petsc-users mailing list