Regression: PetscBinarySynchronizedRead not working for large matrix with --with-64-bit-indices=1
We are trying to read a matrix using MatLoad
, and fail in PetscBinarySynchronizedRead
.
The matrix was written by a Petsc Viewer Binary:
PetscViewerCreate(lMPIComm,&pViewer); PetscViewerSetType(pViewer, PETSCVIEWERBINARY);
.
PETSc was configured with --with-64-bit-indices=1.
- the documentation does not seem to be correct:
- "Integers are stored on the file as 32 long, regardless of whether they are stored in the machine as 32 or 64, this means the same binary file may be read on any machine."
- We see that in fact the integers are stored as bigendian 64 bits integers.
- PetscBinarySynchronizedRead() fails for large matrices (tested with nnz=2197M > 2147M) for petsc 3.14.0 and 3.14.4
- no problem for these versions with a matrix with nnz=609M < 2197M
- no problem with petsc 3.9.1
- we tested 3.14.0 with both intelmpi and openmpi with the same result
[0]PETSC ERROR: #1 PetscBinarySynchronizedRead() line 635 in /ompi-opt/petsc-3.14.4-debug/src/sys/fileio/sysio.c
[0]PETSC ERROR: #2 PetscViewerBinaryRead() line 1002 in /ompi-opt/petsc-3.14.4-debug/src/sys/classes/viewer/impls/binary/binv.c
[0]PETSC ERROR: #3 MatLoad_SeqAIJ_Binary() line 4784 in /ompi-opt/petsc-3.14.4-debug/src/mat/impls/aij/seq/aij.c
[0]PETSC ERROR: #4 MatLoad_SeqAIJ() line 4723 in /ompi-opt/petsc-3.14.4-debug/src/mat/impls/aij/seq/aij.c
[0]PETSC ERROR: #5 MatLoad() line 1233 in /ompi-opt/petsc-3.14.4-debug/src/mat/interface/matrix.c
[0]PETSC ERROR: #6 main() line 23 in test_read.c