Commits

Jed Brown  committed 6346027

MatFD: remove trailing whitespace introduced in branch

  • Participants
  • Parent commits 1919a2e

Comments (0)

Files changed (7)

File include/petsc-private/matimpl.h

 */
 typedef struct {
   PetscInt     row;
-  PetscInt     col;     
+  PetscInt     col;
   PetscScalar  *valaddr;   /* address of value */
 } MatEntry;
 

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

   const PetscInt ncolors=coloring->ncolors,*ncolumns=coloring->ncolumns,*nrows=coloring->nrows;
   PetscInt       bs=J->rmap->bs;
 
-  PetscFunctionBegin; 
+  PetscFunctionBegin;
   /* (1) Set w1 = F(x1) */
   if (!coloring->fset) {
     ierr = PetscLogEventBegin(MAT_FDColoringFunction,0,0,0,0);CHKERRQ(ierr);
   } else {
     coloring->fset = PETSC_FALSE;
   }
-  
+
   /* (2) Compute vscale = 1./dx - the local scale factors, including ghost points */
   ierr = VecGetLocalSize(x1,&nxloc);CHKERRQ(ierr);
-  if (coloring->htype[0] == 'w') { 
+  if (coloring->htype[0] == 'w') {
     /* vscale = dx is a constant scalar */
     ierr = VecNorm(x1,NORM_2,&unorm);CHKERRQ(ierr);
-    dx = 1.0/(PetscSqrtReal(1.0 + unorm)*epsilon); 
-  } else { 
+    dx = 1.0/(PetscSqrtReal(1.0 + unorm)*epsilon);
+  } else {
     ierr = VecGetArray(x1,&xx);CHKERRQ(ierr);
     ierr = VecGetArray(vscale,&vscale_array);CHKERRQ(ierr);
     for (col=0; col<nxloc; col++) {
     ierr = PetscLogObjectParent((PetscObject)coloring,(PetscObject)coloring->w3);CHKERRQ(ierr);
   }
   w3 = coloring->w3;
-  
+
   ierr = VecGetOwnershipRange(x1,&cstart,&cend);CHKERRQ(ierr); /* used by ghosted vscale */
   if (vscale) {
     ierr = VecGetArray(vscale,&vscale_array);CHKERRQ(ierr);
     */
     ierr = VecCopy(x1,w3);CHKERRQ(ierr);
     dy_i = dy;
-    for (i=0; i<bs; i++) {     /* Loop over a block of columns */ 
+    for (i=0; i<bs; i++) {     /* Loop over a block of columns */
       ierr = VecGetArray(w3,&w3_array);CHKERRQ(ierr);
       if (ctype == IS_COLORING_GLOBAL) w3_array -= cstart; /* shift pointer so global index can be used */
       if (coloring->htype[0] == 'w') {
           col            = i + bs*coloring->columns[k][l];  /* local column (in global index!) of the matrix we are probing for */
           w3_array[col] += 1.0/dx;
           if (i) w3_array[col-1] -= 1.0/dx; /* resume original w3[col-1] */
-        } 
+        }
       } else { /* htype == 'ds' */
         vscale_array -= cstart; /* shift pointer so global index can be used */
         for (l=0; l<ncolumns[k]; l++) {
       }
       if (ctype == IS_COLORING_GLOBAL) w3_array += cstart;
       ierr = VecRestoreArray(w3,&w3_array);CHKERRQ(ierr);
-    
+
       /*
        (3-2) Evaluate function at w3 = x1 + dx (here dx is a vector of perturbations)
                            w2 = F(x1 + dx) - F(x1)
       dy_i += nxloc; /* points to dy+i*nxloc */
     }
 
-    /* 
-     (3-3) Loop over rows of vector, putting results into Jacobian matrix 
+    /*
+     (3-3) Loop over rows of vector, putting results into Jacobian matrix
     */
     nrows_k = nrows[k];
     if (coloring->htype[0] == 'w') {
-      for (l=0; l<nrows_k; l++) { 
+      for (l=0; l<nrows_k; l++) {
         row     = bs*Jentry2[nz].row;   /* local row index */
         valaddr = Jentry2[nz++].valaddr;
         spidx   = 0;
         }
       }
     } else { /* htype == 'ds' */
-      for (l=0; l<nrows_k; l++) { 
+      for (l=0; l<nrows_k; l++) {
         row     = bs*Jentry[nz].row;   /* local row index */
         col     = bs*Jentry[nz].col;   /* local column index */
         valaddr = Jentry[nz++].valaddr;
         }
       }
     }
-  } 
+  }
   ierr = MatAssemblyBegin(J,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
   ierr = MatAssemblyEnd(J,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
   if (vscale) {
   MatEntry       *Jentry=coloring->matentry;
   MatEntry2      *Jentry2=coloring->matentry2;
   const PetscInt ncolors=coloring->ncolors,*ncolumns=coloring->ncolumns,*nrows=coloring->nrows;
-  
+
   PetscFunctionBegin;
   /* (1) Set w1 = F(x1) */
   if (!coloring->fset) {
   } else {
     coloring->fset = PETSC_FALSE;
   }
-  
+
   /* (2) Compute vscale = 1./dx - the local scale factors, including ghost points */
-  if (coloring->htype[0] == 'w') { 
+  if (coloring->htype[0] == 'w') {
     /* vscale = 1./dx is a constant scalar */
     ierr = VecNorm(x1,NORM_2,&unorm);CHKERRQ(ierr);
-    dx = 1.0/(PetscSqrtReal(1.0 + unorm)*epsilon); 
-  } else { 
+    dx = 1.0/(PetscSqrtReal(1.0 + unorm)*epsilon);
+  } else {
     ierr = VecGetLocalSize(x1,&nxloc);CHKERRQ(ierr);
     ierr = VecGetArray(x1,&xx);CHKERRQ(ierr);
     ierr = VecGetArray(vscale,&vscale_array);CHKERRQ(ierr);
     ierr = PetscLogObjectParent((PetscObject)coloring,(PetscObject)coloring->w3);CHKERRQ(ierr);
   }
   w3 = coloring->w3;
-  
+
   ierr = VecGetOwnershipRange(x1,&cstart,&cend);CHKERRQ(ierr); /* used by ghosted vscale */
   if (vscale) {
     ierr = VecGetArray(vscale,&vscale_array);CHKERRQ(ierr);
         if (ctype == IS_COLORING_GLOBAL) w3_array -= cstart; /* shift pointer so global index can be used */
         if (coloring->htype[0] == 'w') {
           for (l=0; l<ncolumns[k+i]; l++) {
-            col = coloring->columns[k+i][l]; /* local column (in global index!) of the matrix we are probing for */ 
+            col = coloring->columns[k+i][l]; /* local column (in global index!) of the matrix we are probing for */
             w3_array[col] += 1.0/dx;
-          } 
+          }
         } else { /* htype == 'ds' */
           vscale_array -= cstart; /* shift pointer so global index can be used */
           for (l=0; l<ncolumns[k+i]; l++) {
          */
         ierr = PetscLogEventBegin(MAT_FDColoringFunction,0,0,0,0);CHKERRQ(ierr);
         ierr = VecPlaceArray(w2,dy_k);CHKERRQ(ierr); /* place w2 to the array dy_i */
-        ierr = (*f)(sctx,w3,w2,fctx);CHKERRQ(ierr);   
+        ierr = (*f)(sctx,w3,w2,fctx);CHKERRQ(ierr);
         ierr = PetscLogEventEnd(MAT_FDColoringFunction,0,0,0,0);CHKERRQ(ierr);
         ierr = VecAXPY(w2,-1.0,w1);CHKERRQ(ierr);
         ierr = VecResetArray(w2);CHKERRQ(ierr);
         dy_k += m; /* points to dy+i*nxloc */
       }
 
-      /* 
-       (3-3) Loop over block rows of vector, putting results into Jacobian matrix 
+      /*
+       (3-3) Loop over block rows of vector, putting results into Jacobian matrix
        */
       nrows_k = nrows[nbcols++];
       ierr = VecGetArray(w2,&y);CHKERRQ(ierr);
-      
+
       if (coloring->htype[0] == 'w') {
-        for (l=0; l<nrows_k; l++) { 
+        for (l=0; l<nrows_k; l++) {
           row                      = Jentry2[nz].row;   /* local row index */
-          *(Jentry2[nz++].valaddr) = dy[row]*dx;  
+          *(Jentry2[nz++].valaddr) = dy[row]*dx;
         }
       } else { /* htype == 'ds' */
-        for (l=0; l<nrows_k; l++) { 
+        for (l=0; l<nrows_k; l++) {
           row                   = Jentry[nz].row;   /* local row index */
           *(Jentry[nz].valaddr) = dy[row]*vscale_array[Jentry[nz].col];
           nz++;
         }
       }
       ierr = VecRestoreArray(w2,&y);CHKERRQ(ierr);
-    } 
+    }
   } else { /* bcols == 1 */
     for (k=0; k<ncolors; k++) {
       coloring->currentcolor = k;
         for (l=0; l<ncolumns[k]; l++) {
           col = coloring->columns[k][l]; /* local column (in global index!) of the matrix we are probing for */
           w3_array[col] += 1.0/dx;
-        } 
+        }
       } else { /* htype == 'ds' */
         vscale_array -= cstart; /* shift pointer so global index can be used */
         for (l=0; l<ncolumns[k]; l++) {
       ierr = PetscLogEventEnd(MAT_FDColoringFunction,0,0,0,0);CHKERRQ(ierr);
       ierr = VecAXPY(w2,-1.0,w1);CHKERRQ(ierr);
 
-      /* 
-       (3-3) Loop over rows of vector, putting results into Jacobian matrix 
+      /*
+       (3-3) Loop over rows of vector, putting results into Jacobian matrix
        */
       nrows_k = nrows[k];
       ierr = VecGetArray(w2,&y);CHKERRQ(ierr);
       if (coloring->htype[0] == 'w') {
-        for (l=0; l<nrows_k; l++) { 
+        for (l=0; l<nrows_k; l++) {
           row                      = Jentry2[nz].row;   /* local row index */
           *(Jentry2[nz++].valaddr) = y[row]*dx;
         }
       } else { /* htype == 'ds' */
-        for (l=0; l<nrows_k; l++) { 
+        for (l=0; l<nrows_k; l++) {
           row                   = Jentry[nz].row;   /* local row index */
           *(Jentry[nz].valaddr) = y[row]*vscale_array[Jentry[nz].col];
           nz++;
         }
       }
       ierr = VecRestoreArray(w2,&y);CHKERRQ(ierr);
-    } 
+    }
   }
 
   ierr = MatAssemblyBegin(J,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
   PetscScalar            *A_val,*B_val,**valaddrhit;
   MatEntry               *Jentry;
   MatEntry2              *Jentry2;
-  PetscBool              isBAIJ; 
+  PetscBool              isBAIJ;
   PetscInt               bcols=c->bcols;
 #if defined(PETSC_USE_CTABLE)
   PetscTable             colmap=NULL;
     Mat_SeqBAIJ *spA,*spB;
     A = baij->A;  spA = (Mat_SeqBAIJ*)A->data; A_val = spA->a;
     B = baij->B;  spB = (Mat_SeqBAIJ*)B->data; B_val = spB->a;
-    nz = spA->nz + spB->nz; /* total nonzero entries of mat */  
+    nz = spA->nz + spB->nz; /* total nonzero entries of mat */
     if (!baij->colmap) {
       ierr = MatCreateColmap_MPIBAIJ_Private(mat);CHKERRQ(ierr);
       colmap = baij->colmap;
     Mat_SeqAIJ *spA,*spB;
     A = aij->A;  spA = (Mat_SeqAIJ*)A->data; A_val = spA->a;
     B = aij->B;  spB = (Mat_SeqAIJ*)B->data; B_val = spB->a;
-    nz = spA->nz + spB->nz; /* total nonzero entries of mat */  
+    nz = spA->nz + spB->nz; /* total nonzero entries of mat */
     if (!aij->colmap) {
-      /* Allow access to data structures of local part of matrix 
+      /* Allow access to data structures of local part of matrix
        - creates aij->colmap which maps global column number to local number in part B */
       ierr = MatCreateColmap_MPIAIJ_Private(mat);CHKERRQ(ierr);
       colmap = aij->colmap;
     if (ctype == IS_COLORING_GLOBAL && c->htype[0] == 'd') { /* create vscale for storing dx */
       ierr = VecCreateGhost(PetscObjectComm((PetscObject)mat),mat->cmap->n,PETSC_DETERMINE,B->cmap->n,aij->garray,&c->vscale);CHKERRQ(ierr);
     }
-  } 
+  }
 
   m         = mat->rmap->n/bs;
   cstart    = mat->cmap->rstart/bs;
   ierr       = PetscMalloc(nis*sizeof(PetscInt*),&c->columns);CHKERRQ(ierr);
   ierr       = PetscMalloc(nis*sizeof(PetscInt),&c->nrows);CHKERRQ(ierr);
   ierr       = PetscLogObjectMemory((PetscObject)c,3*nis*sizeof(PetscInt));CHKERRQ(ierr);
-                        
+
   if (c->htype[0] == 'd') {
     ierr       = PetscMalloc(nz*sizeof(MatEntry),&Jentry);CHKERRQ(ierr);
     ierr       = PetscLogObjectMemory((PetscObject)c,nz*sizeof(MatEntry));CHKERRQ(ierr);
         for (k=0; k<nrows; k++) {
           /* set valaddrhit for part A */
           spidx            = bs2*spidxA[A_ci[col-cstart] + k];
-          valaddrhit[*row] = &A_val[spidx]; 
+          valaddrhit[*row] = &A_val[spidx];
           rowhit[*row++]   = col - cstart + 1; /* local column index */
         }
       } else { /* column is in B, off-diagonal block of mat */
         for (k=0; k<nrows; k++) {
           /* set valaddrhit for part B */
           spidx            = bs2*spidxB[B_ci[colb] + k];
-          valaddrhit[*row] = &B_val[spidx]; 
+          valaddrhit[*row] = &B_val[spidx];
           rowhit[*row++]   = colb + 1 + cend - cstart; /* local column index */
         }
       }
     }
     c->nrows[i] = nrows_i;
-    
+
     if (c->htype[0] == 'd') {
       for (j=0; j<m; j++) {
         if (rowhit[j]) {
           Jentry[nz].row     = j;              /* local row index */
           Jentry[nz].col     = rowhit[j] - 1;  /* local column index */
-          Jentry[nz].valaddr = valaddrhit[j];  /* address of mat value for this entry */ 
+          Jentry[nz].valaddr = valaddrhit[j];  /* address of mat value for this entry */
           nz++;
         }
       }
       for (j=0; j<m; j++) {
         if (rowhit[j]) {
           Jentry2[nz].row     = j;              /* local row index */
-          Jentry2[nz].valaddr = valaddrhit[j];  /* address of mat value for this entry */ 
+          Jentry2[nz].valaddr = valaddrhit[j];  /* address of mat value for this entry */
           nz++;
         }
       }
   if (bcols > 1) { /* reorder Jentry for faster MatFDColoringApply() */
     ierr = MatFDColoringSetUpBlocked_AIJ_Private(mat,c,nz);CHKERRQ(ierr);
   }
- 
+
   if (isBAIJ) {
     ierr = MatRestoreColumnIJ_SeqBAIJ_Color(A,0,PETSC_FALSE,PETSC_FALSE,&ncols,&A_ci,&A_cj,&spidxA,NULL);CHKERRQ(ierr);
     ierr = MatRestoreColumnIJ_SeqBAIJ_Color(B,0,PETSC_FALSE,PETSC_FALSE,&ncols,&B_ci,&B_cj,&spidxB,NULL);CHKERRQ(ierr);
-    ierr = PetscMalloc(bs*mat->rmap->n*sizeof(PetscScalar),&c->dy);CHKERRQ(ierr); 
+    ierr = PetscMalloc(bs*mat->rmap->n*sizeof(PetscScalar),&c->dy);CHKERRQ(ierr);
   } else {
     ierr = MatRestoreColumnIJ_SeqAIJ_Color(A,0,PETSC_FALSE,PETSC_FALSE,&ncols,&A_ci,&A_cj,&spidxA,NULL);CHKERRQ(ierr);
     ierr = MatRestoreColumnIJ_SeqAIJ_Color(B,0,PETSC_FALSE,PETSC_FALSE,&ncols,&B_ci,&B_cj,&spidxB,NULL);CHKERRQ(ierr);
 {
   PetscErrorCode ierr;
   PetscInt       bs,nis=iscoloring->n,m=mat->rmap->n;
-  PetscBool      isBAIJ;     
+  PetscBool      isBAIJ;
 
   PetscFunctionBegin;
-  /* set default brows and bcols for speedup inserting the dense matrix into sparse Jacobian; 
+  /* set default brows and bcols for speedup inserting the dense matrix into sparse Jacobian;
    bcols is chosen s.t. dy-array takes 50% of memory space as mat */
   ierr = MatGetBlockSize(mat,&bs);CHKERRQ(ierr);
   ierr = PetscObjectTypeCompare((PetscObject)mat,MATMPIBAIJ,&isBAIJ);CHKERRQ(ierr);
-  if (isBAIJ) { 
+  if (isBAIJ) {
     c->brows = m;
     c->bcols = 1;
   } else { /* mpiaij matrix */
 
     bs    = 1; /* only bs=1 is supported for MPIAIJ matrix */
 
-    A = aij->A;  spA = (Mat_SeqAIJ*)A->data; 
-    B = aij->B;  spB = (Mat_SeqAIJ*)B->data; 
-    nz = spA->nz + spB->nz; /* total local nonzero entries of mat */  
+    A = aij->A;  spA = (Mat_SeqAIJ*)A->data;
+    B = aij->B;  spB = (Mat_SeqAIJ*)B->data;
+    nz = spA->nz + spB->nz; /* total local nonzero entries of mat */
     mem = nz*(sizeof(PetscScalar) + sizeof(PetscInt)) + 3*m*sizeof(PetscInt);
     bcols = (PetscInt)(0.5*mem /(m*sizeof(PetscScalar)));
     brows = 1000/bcols;
 
   c->M       = mat->rmap->N/bs;         /* set the global rows and columns and local rows */
   c->N       = mat->cmap->N/bs;
-  c->m       = mat->rmap->n/bs; 
+  c->m       = mat->rmap->n/bs;
   c->rstart  = mat->rmap->rstart/bs;
   c->ncolors = nis;
   PetscFunctionReturn(0);

File src/mat/impls/aij/seq/aij.c

   PetscFunctionBegin;
   *nn = n;
   if (!ia) PetscFunctionReturn(0);
-  
+
   ierr = PetscMalloc((n+1)*sizeof(PetscInt),&collengths);CHKERRQ(ierr);
   ierr = PetscMemzero(collengths,n*sizeof(PetscInt));CHKERRQ(ierr);
   ierr = PetscMalloc((n+1)*sizeof(PetscInt),&cia);CHKERRQ(ierr);
                                         MatSetColoring_SeqAIJ,
                                         0,
                                 /* 74*/ MatSetValuesAdifor_SeqAIJ,
-                                        MatFDColoringApply_AIJ, 
+                                        MatFDColoringApply_AIJ,
                                         0,
                                         0,
                                         0,

File src/mat/impls/aij/seq/fdaij.c

 
 #include <../src/mat/impls/aij/seq/aij.h>
 #include <../src/mat/impls/baij/seq/baij.h>
-                              
+
 /*
-    This routine is shared by SeqAIJ and SeqBAIJ matrices, 
+    This routine is shared by SeqAIJ and SeqBAIJ matrices,
     since it operators only on the nonzero structure of the elements or blocks.
 */
 #undef __FUNCT__
 {
   PetscErrorCode ierr;
   PetscInt       bs,nis=iscoloring->n,m=mat->rmap->n;
-  PetscBool      isBAIJ;     
+  PetscBool      isBAIJ;
 
   PetscFunctionBegin;
   /* set default brows and bcols for speedup inserting the dense matrix into sparse Jacobian */
   ierr = MatGetBlockSize(mat,&bs);CHKERRQ(ierr);
   ierr = PetscObjectTypeCompare((PetscObject)mat,MATSEQBAIJ,&isBAIJ);CHKERRQ(ierr);
-  if (isBAIJ) { 
+  if (isBAIJ) {
     c->brows = m;
     c->bcols = 1;
   } else { /* seqaij matrix */
     if (brows == 0 || brows > m) brows = m;
     c->brows = brows;
     c->bcols = bcols;
-  } 
+  }
 
   c->M       = mat->rmap->N/bs;   /* set total rows, columns and local rows */
   c->N       = mat->cmap->N/bs;
   PetscFunctionReturn(0);
 }
 
-/* 
+/*
  Reorder Jentry such that blocked brows*bols of entries from dense matrix are inserted into Jacobian for improved cache performance
    Input Parameters:
 +  mat - the matrix containing the nonzero structure of the Jacobian
         color_start[nis - i] = color_start[bcols];
         bcols                = nis - i;
       }
-   
+
       color_start[0] = color_start[bcols];
       for (j=0; j<bcols; j++) {
         color_start[j+1] = c->nrows[i+j] + color_start[j];
 
       row_end = brows;
       if (row_end > mbs) row_end = mbs;
-      
+
       while (row_end <= mbs) {   /* loop over block rows */
         for (j=0; j<bcols; j++) {       /* loop over block columns */
           nrows = c->nrows[i+j];
-          nz    = color_start[j]; 
+          nz    = color_start[j];
           while (row_start[j] < nrows) {
             if (Jentry[nz].row >= row_end) {
               color_start[j] = nz;
               break;
             } else { /* copy Jentry[nz] to Jentry_new[nz_new] */
               Jentry_new[nz_new].row     = Jentry[nz].row + j*mbs; /* index in dy-array */
-              Jentry_new[nz_new].col     = Jentry[nz].col; 
-              Jentry_new[nz_new].valaddr = Jentry[nz].valaddr;  
+              Jentry_new[nz_new].col     = Jentry[nz].col;
+              Jentry_new[nz_new].valaddr = Jentry[nz].valaddr;
               nz_new++; nz++; row_start[j]++;
             }
           }
         color_start[nis - i] = color_start[bcols];
         bcols                = nis - i;
       }
-   
+
       color_start[0] = color_start[bcols];
       for (j=0; j<bcols; j++) {
         color_start[j+1] = c->nrows[i+j] + color_start[j];
 
       row_end = brows;
       if (row_end > mbs) row_end = mbs;
-      
+
       while (row_end <= mbs) {   /* loop over block rows */
         for (j=0; j<bcols; j++) {       /* loop over block columns */
           nrows = c->nrows[i+j];
-          nz    = color_start[j]; 
+          nz    = color_start[j];
           while (row_start[j] < nrows) {
             if (Jentry2[nz].row >= row_end) {
               color_start[j] = nz;
               break;
             } else { /* copy Jentry2[nz] to Jentry2_new[nz_new] */
               Jentry2_new[nz_new].row     = Jentry2[nz].row + j*mbs; /* index in dy-array */
-              Jentry2_new[nz_new].valaddr = Jentry2[nz].valaddr;  
+              Jentry2_new[nz_new].valaddr = Jentry2[nz].valaddr;
               nz_new++; nz++; row_start[j]++;
             }
           }
   PetscInt       i,n,nrows,mbs=c->m,j,k,m,ncols,col,nis=iscoloring->n,*rowhit,bs,bs2,*spidx,nz;
   const PetscInt *is,*row,*ci,*cj;
   IS             *isa;
-  PetscBool      isBAIJ;     
+  PetscBool      isBAIJ;
   PetscScalar    *A_val,**valaddrhit;
   MatEntry       *Jentry;
   MatEntry2      *Jentry2;
 
   ierr = MatGetBlockSize(mat,&bs);CHKERRQ(ierr);
   ierr = PetscObjectTypeCompare((PetscObject)mat,MATSEQBAIJ,&isBAIJ);CHKERRQ(ierr);
-  if (isBAIJ) { 
+  if (isBAIJ) {
     Mat_SeqBAIJ *spA = (Mat_SeqBAIJ*)mat->data;
     A_val = spA->a;
     nz    = spA->nz;
     A_val = spA->a;
     nz    = spA->nz;
     bs    = 1; /* only bs=1 is supported for SeqAIJ matrix */
-  } 
+  }
 
   ierr       = PetscMalloc(nis*sizeof(PetscInt),&c->ncolumns);CHKERRQ(ierr);
   ierr       = PetscMalloc(nis*sizeof(PetscInt*),&c->columns);CHKERRQ(ierr);
   } else {
     ierr = MatGetColumnIJ_SeqAIJ_Color(mat,0,PETSC_FALSE,PETSC_FALSE,&ncols,&ci,&cj,&spidx,NULL);CHKERRQ(ierr);
   }
- 
+
   ierr = PetscMalloc2(c->m,PetscInt,&rowhit,c->m,PetscScalar*,&valaddrhit);CHKERRQ(ierr);
   ierr = PetscMemzero(rowhit,c->m*sizeof(PetscInt));CHKERRQ(ierr);
 
     for (j=0; j<n; j++) {  /* loop over columns */
       col    = is[j];
       row    = cj + ci[col];
-      m      = ci[col+1] - ci[col];  
+      m      = ci[col+1] - ci[col];
       nrows += m;
       for (k=0; k<m; k++) {  /* loop over columns marking them in rowhit */
         rowhit[*row]       = col + 1;
-        valaddrhit[*row++] = &A_val[bs2*spidx[ci[col] + k]]; 
+        valaddrhit[*row++] = &A_val[bs2*spidx[ci[col] + k]];
       }
     }
     c->nrows[i] = nrows; /* total num of rows for this color */
-   
+
     if (c->htype[0] == 'd') {
       for (j=0; j<mbs; j++) { /* loop over rows */
         if (rowhit[j]) {
           Jentry[nz].row     = j;              /* local row index */
           Jentry[nz].col     = rowhit[j] - 1;  /* local column index */
-          Jentry[nz].valaddr = valaddrhit[j];  /* address of mat value for this entry */ 
+          Jentry[nz].valaddr = valaddrhit[j];  /* address of mat value for this entry */
           nz++;
           rowhit[j] = 0.0;                     /* zero rowhit for reuse */
         }
-      } 
+      }
     }  else { /* c->htype == 'wp' */
       for (j=0; j<mbs; j++) { /* loop over rows */
         if (rowhit[j]) {
           Jentry2[nz].row     = j;              /* local row index */
-          Jentry2[nz].valaddr = valaddrhit[j];  /* address of mat value for this entry */ 
+          Jentry2[nz].valaddr = valaddrhit[j];  /* address of mat value for this entry */
           nz++;
           rowhit[j] = 0.0;                     /* zero rowhit for reuse */
         }
-      } 
+      }
     }
     ierr = ISRestoreIndices(isa[i],&is);CHKERRQ(ierr);
   }
   ierr = PetscFree2(rowhit,valaddrhit);CHKERRQ(ierr);
   ierr = ISColoringRestoreIS(iscoloring,&isa);CHKERRQ(ierr);
 
-  ierr = VecCreateGhost(PetscObjectComm((PetscObject)mat),mat->rmap->n,PETSC_DETERMINE,0,NULL,&c->vscale);CHKERRQ(ierr); 
+  ierr = VecCreateGhost(PetscObjectComm((PetscObject)mat),mat->rmap->n,PETSC_DETERMINE,0,NULL,&c->vscale);CHKERRQ(ierr);
   ierr = PetscInfo3(c,"ncolors %D, brows %D and bcols %D are used.\n",c->ncolors,c->brows,c->bcols);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }

File src/mat/impls/baij/seq/baij.c

 {
   Mat_SeqBAIJ    *a = (Mat_SeqBAIJ*)A->data;
   PetscErrorCode ierr;
-  PetscInt       i,*collengths,*cia,*cja,n=a->nbs,m=a->mbs; 
+  PetscInt       i,*collengths,*cia,*cja,n=a->nbs,m=a->mbs;
   PetscInt       nz = a->i[m],row,*jj,mr,col;
   PetscInt       *cspidx;
 
   PetscFunctionBegin;
   *nn = n;
   if (!ia) PetscFunctionReturn(0);
-  
+
   ierr = PetscMalloc((n+1)*sizeof(PetscInt),&collengths);CHKERRQ(ierr);
   ierr = PetscMemzero(collengths,n*sizeof(PetscInt));CHKERRQ(ierr);
   ierr = PetscMalloc((n+1)*sizeof(PetscInt),&cia);CHKERRQ(ierr);

File src/mat/matfd/fdmatrix.c

         }
         ierr = PetscViewerASCIIPrintf(viewer,"    Number of rows %D\n",c->nrows[i]);CHKERRQ(ierr);
         for (j=0; j<c->nrows[i]; j++) {
-          row  = c->matentry[nz].row; 
+          row  = c->matentry[nz].row;
           col  = c->matentry[nz++].col;
           ierr = PetscViewerASCIIPrintf(viewer,"      %D %D \n",row,col);CHKERRQ(ierr);
         }
 
    Input Parameters:
 +  coloring - the coloring context
-.  brows - number of rows in the block 
+.  brows - number of rows in the block
 -  bcols - number of columns in the block
 
    Level: intermediate

File src/snes/examples/tutorials/makefile

 	   if (${DIFF} output/ex19_14.out ex19_14.tmp) then true; \
 	   else  echo  ${PWD} "\nPossible problem with with ex19_14, diffs above \n========================================="; fi; \
 	   ${RM} -f ex19_14.tmp
-runex19_14_ds: 
+runex19_14_ds:
 	-@${MPIEXEC} -n 4 ./ex19 -snes_converged_reason -pc_type mg -dm_mat_type baij -mg_coarse_pc_type bjacobi -da_refine 3 -ksp_type fgmres -mat_fd_type ds > ex19_14.tmp 2>&1; \
 	   if (${DIFF} output/ex19_2.out ex19_14.tmp) then true; \
 	   else  echo  ${PWD} "\nPossible problem with with ex19_14_ds, diffs above \n========================================="; fi; \