<div dir="ltr"><span style="font-size:12.8px">*The error is in EPSComputeError(), not in EPSSolve(). Did you modify the state of the EPS object between EPSSolve() and EPSComputeError()?*</span><br><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I am not modifying the eps object. I have copied a part of the code where I am computing the eigenvectors.</span></div><div><span style="font-size:12.8px"><br></span></div><div><div><span style="font-size:12.8px"> EPSCreate(PETSC_COMM_WORLD,&eps);</span></div><div><span style="font-size:12.8px"> EPSSetOperators(eps,m.Lpl,NULL);</span></div><div><span style="font-size:12.8px"> EPSSetProblemType(eps,EPS_HEP);</span></div><div><span style="font-size:12.8px"> </span><span style="font-size:12.8px">EPSSetFromOptions(eps);</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"> </span><span style="font-size:12.8px">EPSSolve(eps); //Solving for the eigenvalues</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"> EPSGetIterationNumber(eps,&its);</span><br></div><div><span style="font-size:12.8px"> PetscPrintf(PETSC_COMM_WORLD,"Number of iterations of the method: %D\n",its);</span></div><div><span style="font-size:12.8px"> EPSGetType(eps,&type);</span></div><div><span style="font-size:12.8px"> PetscPrintf(PETSC_COMM_WORLD,"Solution Method: %s\n\n",type);</span></div><div><span style="font-size:12.8px"> EPSGetTolerances(eps,&get_tol,&maxit);</span></div><div><span style="font-size:12.8px"> PetscPrintf(PETSC_COMM_WORLD,"Stopping condition: tol=%.4g, maxit=%D\n",(double)get_tol,maxit);</span></div><div><span style="font-size:12.8px"> EPSGetConverged(eps,&nconv);</span></div><div><span style="font-size:12.8px"> PetscPrintf(PETSC_COMM_WORLD, "Number of converged eigenpairs: %D\n\n",nconv);</span></div><div><div><span style="font-size:12.8px"> if(nconv>0)</span></div><div><span style="font-size:12.8px"> {</span></div><div><span style="font-size:12.8px"> PetscPrintf(PETSC_COMM_WORLD,</span></div><div><span style="font-size:12.8px"> " k ||Ax-kx||/||kx||\n"</span></div><div><span style="font-size:12.8px"> "-------------- ----------------\n");</span></div><div><span style="font-size:12.8px"> for(i=0;i<nconv;i++)</span></div><div><span style="font-size:12.8px"> {</span></div><div><span style="font-size:12.8px"> EPSGetEigenpair(eps,i,&kr,&ki,xr,xi);</span></div><div><span style="font-size:12.8px"> EPSComputeError(eps,i,EPS_ERROR_RELATIVE,&error);</span></div><div><span style="font-size:12.8px"> re = PetscRealPart(kr);</span></div><div><span style="font-size:12.8px"> im = PetscImaginaryPart(kr);</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"> re = kr;</span></div><div><span style="font-size:12.8px"> im = ki;</span></div><div><span style="font-size:12.8px"> if(im!=0.0) {</span></div><div><span style="font-size:12.8px"> PetscPrintf(PETSC_COMM_WORLD," %9f%+9fi %12g\n",(double)re,(double)im,(double)error);</span></div><div><span style="font-size:12.8px"> }</span></div><div><span style="font-size:12.8px"> else {</span></div><div><span style="font-size:12.8px"> PetscPrintf(PETSC_COMM_WORLD," %12f %12g\n",(double)re,(double)error);</span></div><div><span style="font-size:12.8px"> }</span></div><div><span style="font-size:12.8px"> }</span></div><div><span style="font-size:12.8px"> PetscPrintf(PETSC_COMM_WORLD,"\n");</span></div><div><span style="font-size:12.8px"> }</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"> EPSDestroy(&eps);</span></div><div><span style="font-size:12.8px"> VecDestroy(&xr);</span></div><div><span style="font-size:12.8px"> VecDestroy(&xi);</span></div><div><span style="font-size:12.8px">}</span></div><div style="font-size:12.8px"><br></div></div></div><div><span style="font-size:12.8px">This is what I pass through my command line: </span><br><span style="font-size:12.8px">./RunPart -eps_type jd -eps_nev 3 -st_ksp_type cg -st_ksp_rtol 0.001 -eps_tol 0.001 -st_pc_type bjacobi -eps_smallest_real</span><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><span style="font-size:12.8px">*In graph partitioning, I would strongly recommend deflating the eigenvector corresponding to the zero eigenvalue, as is done in ex11.c:*</span><br></div><div style="font-size:12.8px"><span style="font-size:12.8px"> I have tried doing this but for some reason the eigenvalues fail to converge. </span></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 26, 2017 at 2:41 AM, Jose E. Roman <span dir="ltr"><<a href="mailto:jroman@dsic.upv.es" target="_blank">jroman@dsic.upv.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> El 26 mar 2017, a las 6:08, Bodhisatta Pramanik <<a href="mailto:bodhi91@iastate.edu">bodhi91@iastate.edu</a>> escribió:<br>
><br>
> Send all the output in the error message:<br>
><br>
> [0]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>
> [0]PETSC ERROR: Object is in wrong state<br>
> [0]PETSC ERROR: Must call EPSSolve() first: Parameter #1<br>
> [0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>documentation/faq.html</a> for trouble shooting.<br>
> [0]PETSC ERROR: Petsc Release Version 3.7.5, Jan, 01, 2017<br>
> [0]PETSC ERROR: ./RunPart on a arch-linux2-c-debug named <a href="http://research-5.ece.iastate.edu" rel="noreferrer" target="_blank">research-5.ece.iastate.edu</a> by bodhi91 Sat Mar 25 22:33:56 2017<br>
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-css=g++ -with-fc=gfortran --download-fblaslapack --download-mpich<br>
> [0]PETSC ERROR: #10468 EPSComputeError() line 643 in /tmp/Bodhi/slepc-3.7.3/src/<wbr>eps/interface/epssolve.c<br>
> 0.000000 2.0795e-317<br>
><br>
<br>
</span>The error is in EPSComputeError(), not in EPSSolve(). Did you modify the state of the EPS object between EPSSolve() and EPSComputeError()?<br>
<br>
In graph partitioning, I would strongly recommend deflating the eigenvector corresponding to the zero eigenvalue, as is done in ex11.c:<br>
<a href="http://slepc.upv.es/documentation/current/src/eps/examples/tutorials/ex11.c.html" rel="noreferrer" target="_blank">http://slepc.upv.es/<wbr>documentation/current/src/eps/<wbr>examples/tutorials/ex11.c.html</a><br>
<span class="HOEnZb"><font color="#888888"><br>
Jose<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><b><font size="2" face="times new roman, serif">Bodhisatta Pramanik,</font></b><div><i><font size="2" face="times new roman, serif">Graduate Student,</font></i></div><div><i><font size="2" face="times new roman, serif">Department of Electrical and Computer Engineering,</font></i></div><div><i><font size="2" face="times new roman, serif">301 Durham,</font></i></div><div><i><font size="2" face="times new roman, serif">Iowa State University,</font></i></div><div><i><font size="2" face="times new roman, serif">Ames,Iowa 50011,</font></i></div><div><font size="2" face="times new roman, serif"><a href="mailto:bodhi91@iastate.edu" target="_blank">bodhi91@iastate.edu</a></font></div><div><u><font size="2" face="times new roman, serif">515-735-6300</font></u></div></div></div></div></div></div></div></div></div>
</div>