[petsc-dev] possible bug in MatLoad_MPIBAIJ()

Lisandro Dalcin dalcinl at gmail.com
Mon Mar 11 13:34:54 CDT 2013


Please review and apply the following patch for release-3.3 (if it is
OK, should be pushed to dev, too).


diff -r ec5e51fd886c src/mat/impls/baij/mpi/mpibaij.c
--- a/src/mat/impls/baij/mpi/mpibaij.c Sat Mar 09 10:50:47 2013 -0600
+++ b/src/mat/impls/baij/mpi/mpibaij.c Mon Mar 11 21:19:18 2013 +0300
@@ -3718,7 +3718,7 @@
     if (size == 1) mend = mend - extra_rows;
     ierr = PetscBinaryRead(fd,locrowlens,mend,PETSC_INT);CHKERRQ(ierr);
     for (j=mend; j<m; j++) locrowlens[j] = 1;
-    ierr = PetscMalloc(m*sizeof(PetscInt),&rowlengths);CHKERRQ(ierr);
+    ierr = PetscMalloc(mmax*sizeof(PetscInt),&rowlengths);CHKERRQ(ierr);
     ierr = PetscMalloc(size*sizeof(PetscInt),&procsnz);CHKERRQ(ierr);
     ierr = PetscMemzero(procsnz,size*sizeof(PetscInt));CHKERRQ(ierr);
     for (j=0; j<m; j++) {


--
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169



More information about the petsc-dev mailing list