Commits

Jed Brown committed 701b21c Merge

Merge branch 'barry/matload-mpiaj-bugfix-maint' into maint

  • Participants
  • Parent commits 1adb2e2, 5aa9a6b

Comments (0)

Files changed (2)

File src/mat/impls/aij/mpi/mpiaij.c

     for(i=2; i<=size; i++) {
       mmax = PetscMax(mmax, rowners[i]);
     }
-  } else mmax = m;
+  };
 
   rowners[0] = 0;
   for (i=2; i<=size; i++) {
   rend   = rowners[rank+1]; 
 
   /* distribute row lengths to all processors */
-  ierr    = PetscMalloc2(mmax,PetscInt,&ourlens,mmax,PetscInt,&offlens);CHKERRQ(ierr);
+  ierr = PetscMalloc2(m,PetscInt,&ourlens,m,PetscInt,&offlens);CHKERRQ(ierr);
   if (!rank) {
     ierr = PetscBinaryRead(fd,ourlens,m,PETSC_INT);CHKERRQ(ierr);
     ierr = PetscMalloc(mmax*sizeof(PetscInt),&rowlengths);CHKERRQ(ierr);

File src/mat/impls/baij/mpi/mpibaij.c

       mmax = PetscMax(mmax,rowners[i]);
     }
     mmax*=bs;
-  } else mmax = m;
+  };
 
   rowners[0] = 0;
   for (i=2; i<=size; i++)  rowners[i] += rowners[i-1];
   rend   = rowners[rank+1]; 
 
   /* distribute row lengths to all processors */
-  ierr = PetscMalloc((mmax+1)*sizeof(PetscInt),&locrowlens);CHKERRQ(ierr);
+  ierr = PetscMalloc(m*sizeof(PetscInt),&locrowlens);CHKERRQ(ierr);
   if (!rank) {
     mend = m;
     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++) {