disabled gradient. Can be enabled with DOGRAD define. This allows to skip the expensive g_ht2 allocation for T calculations

This commit is contained in:
edoapra 2019-06-03 11:40:04 -07:00
parent 134ea5378a
commit fd53d3af58
No known key found for this signature in database
GPG key ID: 48E12DA1EDE9E1B0
2 changed files with 16 additions and 0 deletions

View file

@ -300,9 +300,13 @@ c mem needed for x c sht2 (see pampt3)
& mxvec*lhoov,0,g_t2))
& call errquit('ga_create failed for g_t2',0, GA_ERR)
*ga:1:0
#ifdef DOGRAD
if (.not.ga_create(MT_DBL,mxvec*lhoov,nvir+1,'g_ht2',
& mxvec*lhoov,0,g_ht2))
& call errquit('ga_create failed for g_ht2',0, GA_ERR)
#else
g_ht2=123456789
#endif
!
! Determine if OpenMP should be used in CCSD code
!
@ -451,6 +455,7 @@ CRK Gradient driver to go in here for development purposes
CRK
c
If ( Do_Z) then
#ifdef DOGRAD
lnobj=max(lnoov,nbf*nbf)
stat=stat.and.ma_push_get(MT_DBL,lnobj,'3scra',l_scra,k_scra)
stat=stat.and.ma_push_get(MT_DBL,lnobj,'scrb',l_scrb,k_scrb)
@ -464,6 +469,9 @@ c
& g_nt2,g_t2,g_ht2,
& mxvec,eccsd,max2e,mem2,g_ncoul,g_nexch,
& int_mb(k_tk), Tol2E)
#else
call errquit('ccsd gradients not enabled',0,CAPMIS_ERR)
#endif
EndIf
C^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
C^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -495,8 +503,12 @@ C^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
call ga_sync()
if (.not. ga_destroy(g_nt2))
& call errquit('ga_destroy failed',0, GA_ERR)
c#ifdef DOGRAD
if(g_ht2.ne.123456789) then
if (.not. ga_destroy(g_ht2))
& call errquit('ga_destroy failed',0, GA_ERR)
endif
c#endif
if (.not. ga_destroy(g_t2))
& call errquit('ga_destroy failed',0, GA_ERR)
c

View file

@ -290,6 +290,10 @@ c form ``sigma'' vector
c ----------------------------------------------------------
call dfill(lnov,zip,ht1,1)
call dfill(lhoov,zip,scra,1)
c ga_created moved here from aoccsd
if (.not.ga_create(MT_DBL,mxvec*lhoov,nvir+1,'g_ht2',
& mxvec*lhoov,0,g_ht2))
& call errquit('ga_create failed for g_ht2',0, GA_ERR)
call ga_distribution(g_ht2,iam,jlo,jhi,ilo,ihi)
call ga_sync
do bev=1,nvir+1