Skip to content

Commit

Permalink
fix logic update
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Hammond <[email protected]>
  • Loading branch information
jeffhammond committed Oct 23, 2024
1 parent a1cae09 commit 343216f
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions src/tce/tce_energy.F
Original file line number Diff line number Diff line change
Expand Up @@ -3342,44 +3342,37 @@ logical function tce_energy(rtdb,excitedfragment)
if (nodezero) write(LuOut,*) 'CCSD(T)'
if (do_pt) perturbative='(t)'
!
cpu = - util_cpusec()
wall = - util_wallsec()
#ifdef USE_PSTAT
c
c profiling
c
! profiling
call ccsd_t_pstat_init(rtdb)
call ccsd_t_fdist_init()
#endif
cpu = - util_cpusec()
wall = - util_wallsec()
if (restart_ccsd_t.eq.0) then
if (.not.rtdb_get(rtdb,'tce:cuda',mt_int,1,icuda)) icuda = 0
if (icuda .ne. 0) then
#if defined(TCE_CUDA) || defined(TCE_HIP)
if (nodezero) write(LuOut,*) 'Using CUDA CCSD(T) code'
if (nodezero) call util_flush(LuOut)
call ccsd_t_gpu(d_t1,k_t1_offset,d_t2,k_t2_offset,
& d_v2,k_v2_offset,pt3_1,pt3_2,size_t1,icuda)
& d_v2,k_v2_offset,pt3_1,pt3_2,size_t1,
& icuda)
#else
call errquit('tce_energy: ccsd_t_gpu requested but not compiled',
& iter,CALC_ERR)
call errquit('tce_energy: ccsd_t_gpu requested'//
& 'but not compiled',iter,CALC_ERR)
#endif
else if (slide) then
else if (slice) then
if (nodezero) write(LuOut,*) 'Using sliced CCSD(T) code'
call ccsd_t_6dts(d_t1,k_t1_offset,d_t2,k_t2_offset,
& d_v2,k_v2_offset,pt3_1,pt3_2,size_t1,xmem)
& d_v2,k_v2_offset,pt3_1,pt3_2,size_t1,
& xmem)
else
if (nodezero) write(LuOut,*) 'Using plain CCSD(T) code'
if (nodezero) call util_flush(LuOut)
call ccsd_t(d_t1,k_t1_offset,d_t2,k_t2_offset,
& d_v2,k_v2_offset,pt3_1,pt3_2,size_t1)
if (nodezero) write(LuOut,*) 'Using plain CCSD(T) code'
if (nodezero) call util_flush(LuOut)
call ccsd_t(d_t1,k_t1_offset,d_t2,k_t2_offset,
& d_v2,k_v2_offset,pt3_1,pt3_2,size_t1)
end if
#ifdef USE_PSTAT
c
c cleanup profiling
c
call ccsd_t_pstat_print
#endif

elseif (restart_ccsd_t.gt.0) then
pt3_1 = 0.0d0
call ccsd_t_restart(rtdb,d_t1,k_t1_offset,
Expand All @@ -3388,6 +3381,10 @@ logical function tce_energy(rtdb,excitedfragment)
endif
cpu = cpu + util_cpusec()
wall = wall + util_wallsec()
#ifdef USE_PSTAT
! cleanup profiling
call ccsd_t_pstat_print
#endif
if (nodezero) then
write(LuOut,*)
if (restart_ccsd_t.eq.0) then
Expand Down

0 comments on commit 343216f

Please sign in to comment.