Commits

Jed Brown committed 0fc3563 Merge

Merge branch 'placasse/matsor-log-flops' into maint

* placasse/matsor-log-flops:
Bad LogFlops in MatSOR_SeqSBAIJ.

  • Participants
  • Parent commits 31266bc, dcca023

Comments (0)

Files changed (1)

File src/mat/impls/sbaij/seq/relax.h

         vj   = aj + ai[i] + 1; vj1=vj;
         nz   = ai[i+1] - ai[i] - 1; nz1=nz;
         sum  = t[i];
-        ierr = PetscLogFlops(4.0*nz-2);CHKERRQ(ierr);
         while (nz1--) sum -= (*v1++)*x[*vj1++];
         x[i] = (1-omega)*x[i] + omega*sum*aidiag[i];
         while (nz--) t[*vj++] -= x[i]*(*v++);
       }
+      ierr = PetscLogFlops(4.0*a->nz);CHKERRQ(ierr);
     }
 
     if (flag & SOR_BACKWARD_SWEEP || flag & SOR_LOCAL_BACKWARD_SWEEP) {
         v    = aa + ai[i] + 1;
         vj   = aj + ai[i] + 1;
         nz   = ai[i+1] - ai[i] - 1;
-        ierr = PetscLogFlops(2.0*nz-1);CHKERRQ(ierr);
         while (nz--) t[*vj++] -= x[i]*(*v++);
       }
+      ierr = PetscLogFlops(2.0*(a->nz - m));CHKERRQ(ierr);
       for (i=m-1; i>=0; i--) {
         v    = aa + ai[i] + 1;
         vj   = aj + ai[i] + 1;
         nz   = ai[i+1] - ai[i] - 1;
-        ierr = PetscLogFlops(2.0*nz-1);CHKERRQ(ierr);
         sum  = t[i];
         while (nz--) sum -= x[*vj++]*(*v++);
         x[i] =   (1-omega)*x[i] + omega*sum*aidiag[i];
       }
+      ierr = PetscLogFlops(2.0*(a->nz + m));CHKERRQ(ierr);
     }
   }