owner-petsc-users at mcs.anl.gov wrote on 02/29/2008 10:14:20 AM:
> On Fri, Feb 29, 2008 at 8:23 AM, <Amit.Itagi at seagate.com> wrote: > > Matt/Hong/Satish, > > > > My toy-problem would run with the command line options. However, the > > in-code options were still giving a problem. I also found that I had a > > Petsc version compiled with the debugging flag off. On recompiling Petsc by > > turning the debugging flag on, the in-code options worked. I am wondering > > about the cause for this behavior. > > I am sure this is a misinterpretation. The code just does not work that way. > Something you have not notices changed between those versions of your code. > When you say "giving a problem", I assume you mean the option does not take > effect. The most common cause is a misunderstanding of the mechanism. If you > call a function to set something, but subsequently call > SetFromOptions(), it will > be overridden by command line arguments > > Matt > Hi, My woes continue. Based on the earlier discussions, I implemented the matrix as //========================================================================= // Option 1 ierr=MatCreate(PETSC_COMM_WORLD,&A); CHKERRQ(ierr); ierr=MatSetSizes(A,1,1,2,2); CHKERRQ(ierr); /* Option 2 PetscInt d_nnz=1, o_nnz=1; ierr=MatCreateMPIAIJ(PETSC_COMM_WORLD,1,1,2,2,0,&d_nnz,0,&o_nnz,&A); CHKERRQ(ierr); */ /* Option 3 ierr=MatCreateMPIAIJ(PETSC_COMM_WORLD,1,1,2,2,0,PETSC_NULL,0,PETSC_NULL,&A); CHKERRQ(ierr); */ ierr=MatSetType(A,MATSUPERLU_DIST); CHKERRQ(ierr); ierr=MatSetFromOptions(A); CHKERRQ(ierr); // (After this, I set the values and do the assembly). I then use the direct LU solver. //============================================================================ Note: I have a simple 2 by 2 matrix (with non-zero values in all 4 places). If I use "option 1" (based on Satish's email), the program executes successfully. If instead of "option 1", I use "option 2" or "option 3", I get a crash. If I am not mistaken, options 1 and 3 are the same. Option 2, additionally, does a pre-allocation. Am I correct ? Thanks Rgds, Amit
