I'll leave it to Jose to provide a complete, comprehensive answer, but given your problem sizes, I think using a direct solver instead of an iterative solver may be the best bet. So configure PETSc without debugging and with MUMPS
./configure --with-debugging=0 --download-mumps --download-scalapack --download-ptscotch and use -ksp_type preconly -pc_type lu -pc_factor_mat_solver_type mumps Good luck > On Dec 9, 2024, at 4:50 PM, LUCA SCALIA <lsca...@pa.uc3m.es> wrote: > > Dear group, > > I am using libraries PETSC and SLEPC for a Finite Element code written in c++ > that I am developing, oriented to the solution of generalised eigenvalue > problems for large structural systems featuring up to 10^5 -10^6 degrees of > freedom. > > I manage to successfully run the code for a generalised eigenvalue problem of > structures with around 10^4 degrees of freedom in a reasonable amount of time > but the problem arises in the case of systems with a number of degrees of > freedom from 10^5 or above. > > The current test case I'm trying has 120.000 degrees of freedom. The EPS > solver gets slower and slower as the iterations pass. After a rough estimate, > I would say it may take no less than 5-6 hours with 20 MPI processes ( > allowing an unlimited number of iterations) > > I need to compute the first 10 to 30 (nev) modes of the structure > (EPS_SMALLEST_MAGNITUDE). I'm using the default KRYLOVSCHUR iterative solver. > The problem is generalised Hermitian > > > I tried to play a little bit with different settings and options of the > library, e.g.: > > 1) ncv parameter. different values of ncv, between 10*nev and 40*nev > > 2) different solvers for the ksp object ( GMRES and CG ), and tolerance as > well preconditioner (PCJACOBI and PCBJACOBI) > > 3) Normalisation of matrices A and B with the respective Frobenius or > Infinite norms. > > ... but I wasn't able to solve the problem. > > I kindly ask for advice on which strategies I should resort to in order to > improve the speed of SLEPC for such large numbers of degrees of freedom, > since I'm quite new to the solution of the generalised eigenvalue problem. > > I also attach two files with the stiffness and mass matrix of one element to > show the magnitude of the entries of the two matrices > > Best regards, > > Luca > <stiffness_matrix_A.txt><mass_matrix_B.txt>