It sounds like you are inserting values which were not preallocating. To determine for sure, we would need to know more about the code. However, if you have a periodic problem, why not use a periodic DA?
Matt On 8/10/06, Christophe Picard <picard2 at llnl.gov> wrote: > Hi, > > I have a performance issue while trying to insert values in the a matrix. I am > using DMMG solver for cell-centered scheme in 3D from the petsc-snapshot to > solve a Poisson equations. Inserting coefficients in the matrix for dirichlet > or neumann boundary conditions, the insertion is instantaneous. But is I want > to insert coefficients for periodic boundary conditions, I can notice a huge > slow down in the insertion process (not in the resolution though). > The smallest size I can notice the performance drop is 32*32*32. > > Is there any way to improve this? > > > col.i = row.i+(mx-1); > col.j = row.j; > col.k = row.k; > > v[0] = 1; > > MatSetValuesStencil(*A,1,&row,1,&col,v,ADD_VALUES); > > > > Thans, > > Christophe > > -- "Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness
