Register to reply 
How to solve the larger order eigenproblem 
Share this thread: 
#1
Apr2013, 05:28 AM

P: 14

I want to solve a generalized symmetric eigenproblem A(N,N)x(N,N) = v(N)B(N,N)x(N,N), N > 500
I try a call in Lapack (see http://www.netlib.org/lapack/double/dsygvd.f) DSYGVD(1,'V','U',N,A,N,B,N,V,WORK,1+6*N+2*N**2,IWORK,3+5*N,INFO) define: WORK(1+6*N+2*N**2), IWORK(3+5*N) when N<100, I can solve the equation successfully. When N>200, 300, or more, the program will fail with stack overflow. I try the linux system with large memory (>8GB), and still fail I guess that 1+6*N+2*N**2 is too large. How can I solve this problem? Best regards. sandf 


#2
Apr2013, 07:10 AM

P: 100

No idea about other platform issues, but for Linux I'd guess it's a combination of fast (or O3) optimizations implicitly trying to put everything stackside, and a low default user stack limit. What's the output of
Regards, Solkar 


#3
Apr2013, 07:50 AM

P: 14

Thanks for you reply My OS/Kernel and compiler versions are as follows: gcc version 4.1.1 20070105 (Red Hat 4.1.152) x86_64redhatlinux lapack3.3.1 [root@xxxx ~]# ulimit s unlimited [root@xxxx ~]# gfortran o runHeee He_m.F90 He.F90 liblapack.a libblas.a libtmglib.a output the runHeee program 


#4
Apr2013, 08:34 AM

Engineering
Sci Advisor
HW Helper
Thanks
P: 7,177

How to solve the larger order eigenproblem
Check if the problem is really caused by a badly conditioned eigenproblem. (That shouldn't cause a problem with a library like Lapack, but all software has bugs!)
Try setting either A or B to the identity matrix and what problem size you can handle. If the problem goes away, finding the eigenvalues and vectors of the A and B matrices individually might give you a clue where the problem is. I would expect you should be OK up to N = 500, maybe N = 1000. Bigger than that, you probably need a different algorithm  and you probably only want to solve for some eigenvalues and vectors, not all of them. 


#5
Apr2013, 08:37 AM

P: 100

That could well be an important issue for LAPACK and Fortran in general. That's also important for a project of mine, I will look deeper into that. For the first, an attempted hotfix: Instead of e.g.
Addendum: Trying to track down the bug systematically 


#6
Apr2013, 07:02 PM

P: 14

Dear Solkar and AlephZero,
Great thanks for your help. using 'allocatable', I solve the issue of allocation of a large array because the mstate has a return value of zero. But still fail to solve the Ax=vBx, and the DSYGVD return a nozero value of INFO. The possible reason is that my B matrix is nonpositive definite. So, as mentioned by AlephZero, maybe I should use a different algorithm. 


#7
Apr2013, 07:25 PM

P: 100

Do I get you right, that now, using allocatable/allocate, you get a "proper" DSYGVD error delivered instead of the previous stop with stack error? Or are that two different topics? Best regards, Solkar 


#8
Apr2013, 09:43 PM

P: 14

If I do not use the allocatable/allocate, it will stop with stack overflow when meeting the declared line [e.g. real*8 :: WORK(1+6*N+2*N**2)] when N is too large. If I use the allocatable, it will pass the declared line with a 'mstat' value of zero for a large N But DSYGVD will fail with a INFO value of nonzero. The program is very simple, I upload it. If you are interested in it. You can download it and compile it with your own lapack. (lapack is too large, I can not upload) Notes: I use Windows version gfortran obtained from http://gcc.gnu.org/wiki/GFortranBinaries, (http://users.humboldt.edu/finneyb/gf...s20121210.exe, now is 20130301.exe) and in Linux system, I have the same issue. Bests, sandf 


#9
Apr2113, 11:15 AM

P: 100

spooky...
Even if I revert your He_m.F90 back to
I simply untgz'ed, changed to to the lapack source dir, md'ed a "build" dir, changed there and issued
What I've not yet done is adopting your compiler versions, mine are
Regards, Solkar 


#10
Apr2213, 12:00 AM

P: 14

Dear Solkar,
Thanks for your try. I have not customized the LAPACK CMakebuild by any means. Windows version LAPACK, I downloaded it from http://icl.cs.utk.edu/lapackforwindows/lapack/ based on CMake build. Stack overflow indeed puzzles me. Please let it alone. Main issue is that INFO !=0 when N is large. and DSYGVD does not return any other information which will help me to solve the problem. Best regards. sandf 


#11
Apr2213, 05:19 AM

P: 100




#12
Apr2213, 09:03 AM

P: 14

Dear Solkar,
But even if I do not use "parameter", and N<100, the program will also work fine. I reproduce under the Intel.Visual.Fortran.Compiler.v11 (Evaluation from intel) and MS visual studio 2008 (student https://www.dreamspark.com/) I remember I also have the same issure for windows gfortran. but unfortunately I cannot reproduce it now. I am very sorry if this issue only arises from my erroneous use of parameter or difference of compiler. 1, do not use 'parameter' In He.F90
In He.F90
Best regards. sandf 


Register to reply 
Related Discussions  
RCBlimp propulsion system on larger a larger scale  Aerospace Engineering  4  
How to solve 2nd order diff. eqn.  Advanced Physics Homework  3  
Help to solve 4th order ode  Differential Equations  3  
Proving that larger side corresponds to larger angle  Precalculus Mathematics Homework  9  
Solve the FirstOrder ODE  Differential Equations  1 