[petsc-users] Creating and indexing large matrix with indexes exceeding the limit of the PetscInt

Jed Brown jedbrown at mcs.anl.gov
Mon May 20 14:56:46 CDT 2013


Joon hee Choi <choi240 at purdue.edu> writes:

> Hello all,
>
> I am setting up very large matrix(10^7 x 10^15) using MatCreateSeqAIJ
> and MatSetValues. However, in my computer, the maximum of PetscInt is
> about 4*10^9. So I cannot express the size and index of the matrix. 

http://www.mcs.anl.gov/petsc/documentation/faq.html#with-64-bit-indices

> By the way, I think I found a way from PETSC doc, and the doc is as
> follows:
>
> * CHANGES in PETSc 2.2.1
> - Introduced 4 new PETSc data types: PetscInt, PetscErrorCode, PetscMPIInt and PetscBLASInt. For 99% of users these are just int or integer*4 and you do not need to change your code.
> - For users with more than roughly 2 billion unknowns you can run configure with --with-64-bit-ints and then PetscInt will represent 64 bit integers, long long int in C and integer*8 in Fortran. But the the other 3 types remain 32 bit (i.e. int in C and integer*4 in Fortran). Now you can index into vectors and matrices with virtually unlimited sizes.
>
> However, I don't understand what this means exactly. How can I index into matrix with virtually unlimited sizes? Also, how can I use MatCreateSeqAIJ(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt nz,const PetscInt nnz[],Mat *A) with n=10^15? If you know the solution of this, then let me know.
>
> Thank you,
>
> Joon


More information about the petsc-users mailing list