[petsc-dev] technical C question

Satish Balay balay at mcs.anl.gov
Thu Apr 7 17:39:58 CDT 2016


On Thu, 7 Apr 2016, Jed Brown wrote:

> Barry Smith <bsmith at mcs.anl.gov> writes:
> >    Should we caste to an unsigned PetscInt first then?
> 
> It should be unsigned, yes.  Does that fix the warning?

Nope..

Commenting out the following line - or changing the argument thus is
making a difference.

diff --git a/src/mat/impls/baij/seq/baijfact.c b/src/mat/impls/baij/seq/baijfact.c
index fea37cb..e2c210c 100644
--- a/src/mat/impls/baij/seq/baijfact.c
+++ b/src/mat/impls/baij/seq/baijfact.c
@@ -1081,7 +1081,7 @@ PetscErrorCode MatICCFactorSymbolic_SeqBAIJ(Mat fact,Mat A,IS perm,const MatFact
         ncols_upper++;
       }
     }
-    ierr = PetscIncompleteLLAdd(ncols_upper,cols,levels,cols_lvl,am,nlnk,lnk,lnk_lvl,lnkbt);CHKERRQ(ierr);
+    ierr = PetscIncompleteLLAdd(ncols,cols,levels,cols_lvl,am,nlnk,lnk,lnk_lvl,lnkbt);CHKERRQ(ierr);
     nzk += nlnk;
 
     /* update lnk by computing fill-in for each pivot row to be merged in */


Changing PetscIncompleteLLAdd() to PetscIncompleteLLAddSorted()
doesn't make a difference.

Or the following change is also making a difference. [but not
'i=ncols_upper' nor 'i=ncols_upper-2']

    i = ncols_upper-3;
    ierr = PetscIncompleteLLAdd(i,cols,levels,cols_lvl,am,nlnk,lnk,lnk_lvl,lnkbt);CHKERRQ(ierr);

I don't really understand this [why ncols_upper is triggering this].


Satish



More information about the petsc-dev mailing list