<div dir="ltr"><div><div><div><div>Hello,<br><br></div> First of all..thanks to the PETSC developers and everyone else contributing supporting material on the web. <br><br></div> I need to solve a system of equations Ax =b, where A is symmetric, sparse, unstructured and in parallel as a part of a finite volume solver for CFD. Decomposition is already done. I initialize the matrix as MPIAIJ even though it's symmetric as that's the only thing I could get to work.<br><br>MatCreate(PETSC_COMM_WORLD,&A);                                                                                                  <br>MatSetType(A,MATMPIAIJ);<br>MatSetSizes(A,nCellsCurProc,nCellsCurProc,nTotalCells,nTotalCells);                                                           <br>MatMPIAIJSetPreallocation(A,10,PETSC_NULL,5,PETSC_NULL);                         <br>MatSetUp(A) ;<br></div><div>// Assemble matrix using MatSetValue.. assemble full matrix even though it's symmetric.<br></div>MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY) ;<br>MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY) ;<br></div>//Create solver<br><div><div>KSPCreate(PETSC_COMM_WORLD,&ksp);<br>KSPSetType(ksp,KSPFGMRES;)                                                                                                          <br>KSPGetPC(ksp, &pc);<br>PCFactorSetShiftType(pc, MAT_SHIFT_POSITIVE_DEFINITE);<br><br>//PCSetType(pc, PCML); //Trilinos - Multilevel<br><br>//PCSetType(pc, PCBJACOBI) ; //Incomplete LU<br>//PetscOptionsSetValue("-sub_pc_type", "ilu") ;<br>KSPSetFromOptions(ksp);                                                                                                            <br><br>// PCSetType(pc, PCASM); //Additive Schwarz Methods<br>// PCASMSetOverlap(pc,overlap);<br><br>PCSetType(pc, PCHYPRE); //HYPRE<br>PCHYPRESetType(pc, "boomeramg");<br><br>//PCHYPRESetType(pc, "parasails");                    <br><br>KSPSetPC(ksp, pc);<br>KSPSetTolerances(ksp, 1e-13,  1e-13,  PETSC_DEFAULT,  PETSC_DEFAULT) ;<br>KSPSetInitialGuessNonzero(ksp, PETSC_TRUE);<br>KSPSetOperators(ksp, A, A);<br>KSPMonitorDefault(ksp, 1, 1, pVoid) ;<br><br>KSPSolve(ksp,b,x);<br>VecGetArray(x, &getResultArray) ;<br>KSPGetResidualNorm(ksp, &endNorm) ;<br>KSPGetIterationNumber(ksp, &nIterations);<br><br>KSPDestroy(&ksp);<br><br><br></div><div> I know that this works and gives me the correct result. However, boomerAMG is proving to be too slow.. atleast the way I use it at 256 processors with around 12 million unknowns. I need your advice on the preconditioner. Am I using it right? Is there anything else I could I be doing better?<br><br></div><div>ganesh<br></div></div></div>