[petsc-users] MatPermuteSparsify hanging

Barry Smith bsmith at mcs.anl.gov
Mon Nov 29 13:21:03 CST 2010


  Use ./programname -start_in_debugger noxterm

then type cont in the debugger, after it seems to be "hanging" then use control c and type where, this should show where the program is "hanging". Likely it is not hanging, it is just taking forever.

   Barry


On Nov 29, 2010, at 1:15 PM, Kelly Fermoyle wrote:

> Hi,
> 
> I'm having a problem with MatPermuteSparsify. The function is hanging
> indefinitely, but does not give an error of any kind. Below is my relevant
> code. It definitely gets through MatGetOrdering fine, but never prints the
> line following MatPermuteSparsify. I tried it in the debugger, and it said
> that aprun was calling poll(), I don't know what that means.
> 
> Thanks!
> 
> Kelly
> 
> 
> 
> PetscInitialize(&argc, &argv, (char*)0,
>      "Loads a linear system and solves it with given solver options.\n");
> 
>  PetscViewer mat_view;
>  PetscViewerBinaryOpen(PETSC_COMM_WORLD, mat_file, FILE_MODE_READ,
> &mat_view);
>  MatLoad(mat_view, MATSEQAIJ, &A);
>  PetscViewerDestroy(mat_view);
> 
>  PetscViewer vec_view;
>  PetscViewerBinaryOpen(PETSC_COMM_WORLD, vec_file, FILE_MODE_READ,
> &vec_view);
>  VecLoad(vec_view, VECSEQ, &b);
>  PetscViewerDestroy(vec_view);
>  ierr = VecDuplicate(b, &x); CHKERRQ(ierr);
> 
>  if(strcmp(reordering, "1wd") == 0){
>    type = MATORDERING_1WD;
>  } else if(strcmp(reordering, "natural") == 0) {
>    type = MATORDERING_NATURAL;
>  } else if(strcmp(reordering, "nd") == 0) {
>    type = MATORDERING_ND;
>  } else if(strcmp(reordering, "qmd") == 0) {
>    type = MATORDERING_QMD;
>  } else if(strcmp(reordering, "rcm") == 0) {
>    type = MATORDERING_RCM;
>  } else {
>    printf("%s is not a valid reordering!\n", reordering);
>    exit(-1);
>  }
>  MatGetOrdering(A, type, &rowp, &colp);
>  MatPermuteSparsify(A, -1, 0, threshold, rowp, colp, &P);
>  printf("Got sparse version.\n");
> 



More information about the petsc-users mailing list