Page 1 of 1

RPA FORCE calculations crash with vasp_gam

Posted: Wed Apr 27, 2022 7:55 am
by pinchenx
Hi,

I run ALGO=RPAR calculations with gamma-sampling and the LRPAFORCE option enabled. It runs fine with vasp_std but crashes definitely when using vasp_gam.
If I turn off LRPAFORCE, then everything works fine with vasp_gam.
The files for reproducing and also outputs is attached. The major error is:
Intel MKL ERROR: Parameter 8 was incorrect on entry to DSYEV.

VASP is compiled and running with
intel-mkl/2020.1/1/64
intel-mpi/intel/2019.7/64

Re: RPA FORCE calculations crash with vasp_gam

Posted: Fri Apr 29, 2022 4:40 pm
by merzuk.kaltak
Dear pinchenx,

Thank you for your bug report, I can reproduce the problem and will look into it.
Do maybe have a smaller system where the same error appears?

Re: RPA FORCE calculations crash with vasp_gam

Posted: Wed May 04, 2022 4:14 pm
by merzuk.kaltak
Dear pinchex,

thank you for the bug report.
I have identified the problem.
The LAPACK driver DSYEV is called with an insufficient size of the workspace array CWRK.
This fix will be in the next vasp-release as of version 6.3.1.
In case you want to fix the code by yourself, following changes are necessary in subrot_cluster.F.
Add a new variable declaration in line 279 of the subroutine SETUP_DEG_CLUSTERS like so:

Code: Select all

    ...
    INTEGER :: IFAIL
    INTEGER :: LWORK     !  size of work array
    
    NBANDS = SIZE(CHAM_DIAGONAL)
    ...
Then in line 300, when work arrays are allocated change the part as follows:

Code: Select all

    ...
    ! allocate work arrays
    ALLOCATE(U(NMAX_DEG,NMAX_DEG))
    !> allocate proper size of work array for gamma-only and complex version
#ifdef  gammareal
    LWORK=MAX( NMAX_DEG*NMAX_DEG, 3*NMAX_DEG-1 )
#else
    LWORK=MAX( NMAX_DEG*NMAX_DEG, 2*NMAX_DEG+1 )
#endif
    ALLOCATE(CWRK(LWORK) )
    ALLOCATE(RWORK(3*NMAX_DEG))
    ALLOCATE(R(NMAX_DEG))
    ... 
Finally, when the LAPACK driver are called in line 342, replace the NMAX_DEG*NMAX_DEG by LWORK as follows:

Code: Select all

...
#ifdef  gammareal
       CALL __DSYEV__ &
            ('V','U',NB_TOT,U(1,1),NMAX_DEG, &
            R,CWRK,LWORK,IFAIL)
#else
       CALL __ZHEEV__ &
            ('V','U',NB_TOT,U(1,1),NMAX_DEG, &
            R,CWRK,LWORK,RWORK,IFAIL)
#endif
...
After these changes, compile vasp. This should fix your problem

Re: RPA FORCE calculations crash with vasp_gam

Posted: Thu May 05, 2022 1:42 am
by pinchenx
Hi Merzuk,

Thank you so much for the fix!!!

best,
Pinchen