From 41a827ea3fee0e9a2e392c9c3a31a96407565281 Mon Sep 17 00:00:00 2001 From: Markus Oppel Date: Fri, 22 Mar 2024 15:20:44 +0100 Subject: [PATCH 01/10] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9d5aa0e..1644075 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ubuntu-latest + runs-on: ubuntu-latest self-hosted # Steps represent a sequence of tasks that will be executed as part of the job steps: From 1360da807b89fd741ee598b93f2308cdaaf2f2e3 Mon Sep 17 00:00:00 2001 From: Markus Oppel Date: Fri, 22 Mar 2024 15:24:00 +0100 Subject: [PATCH 02/10] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1644075..ea6f8f7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ubuntu-latest self-hosted + runs-on: [ubuntu-latest, self-hosted] # Steps represent a sequence of tasks that will be executed as part of the job steps: From 8bfc90fe48d1e4695b6b54614174a9c1aed5ab17 Mon Sep 17 00:00:00 2001 From: Markus Oppel Date: Fri, 22 Mar 2024 15:25:57 +0100 Subject: [PATCH 03/10] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ea6f8f7..e331b7b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: [ubuntu-latest, self-hosted] + runs-on: self-hosted # Steps represent a sequence of tasks that will be executed as part of the job steps: From d98eb52a5012a6f78b6243b16442647282a924d9 Mon Sep 17 00:00:00 2001 From: Markus Oppel Date: Fri, 22 Mar 2024 15:30:19 +0100 Subject: [PATCH 04/10] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e331b7b..9d5aa0e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: self-hosted + runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: From d246c2cbadecc44888be3c2bc2851c34d297b2d1 Mon Sep 17 00:00:00 2001 From: Sebastian Mai Date: Thu, 28 Mar 2024 07:55:21 +0100 Subject: [PATCH 05/10] diagnostics.py: can now be interrupted, fixed intruder check --- bin/diagnostics.py | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/bin/diagnostics.py b/bin/diagnostics.py index 1c1708e..70c5a40 100755 --- a/bin/diagnostics.py +++ b/bin/diagnostics.py @@ -755,6 +755,8 @@ def check_energies(path, trajectories, INFOS, hops): f = readfile(f) try: problem, tana_length = check_consistency(path, trajectories, f, 'energy.out') + except KeyboardInterrupt: + raise except BaseException: print('\n An error occured while trying to check energy.out for consistency.') trajectories[path]['error'] = True @@ -834,6 +836,8 @@ def check_populations(path, trajectories, INFOS): problem = '' try: problem, tana_length = check_consistency(path, trajectories, f, 'coeff_diag.out') + except KeyboardInterrupt: + raise except BaseException: print('\n An error occured while trying to check coeff_diag.out for consistency.') trajectories[path]['error'] = True @@ -901,7 +905,7 @@ def check_intruders(path, trajectories, INFOS, lis, tana, problem_length): tstep = int(line.split()[3]) if tstep == 0: prevstep = 0 - elif tstep - 1 != prevstep: + elif tstep - 1 != prevstep and tstep != prevstep: tana = prevstep * trajectories[path]['dtstep'] problem = 'Missing steps in output.log' break @@ -910,14 +914,15 @@ def check_intruders(path, trajectories, INFOS, lis, tana, problem_length): ok = False problem = problem_length break - if 'RESTART requested.' in line: - prevstep -= 1 - if 'time step in restart files' in line: - prevstep += 1 +# if 'RESTART requested.' in line: +# prevstep -= 1 +# if 'time step in restart files' in line or "STOP" in line: +# prevstep += 1 if 'State: ' in line: intruder = int(line.split()[1]) if not notpossible: - state = lis[tstep][2] + state = int(lis[tstep][2]) + # print(intruder, state) if state == intruder: problem = 'Intruder state found' ok = False @@ -970,6 +975,8 @@ def do_calc(INFOS): try: trajectories, missing = check_files(path, trajectories, INFOS) + except KeyboardInterrupt: + raise except BaseException: print('\n An error occured while trying to look for the files.\n') trajectories[path]['error'] = True @@ -979,6 +986,8 @@ def do_calc(INFOS): try: trajectories, f = check_runtime(path, trajectories, INFOS) + except KeyboardInterrupt: + raise except BaseException: print('\n An error occured while trying to extract the runtime.\n \ Files may be corrupted.\n') @@ -987,6 +996,8 @@ def do_calc(INFOS): try: trajectories = check_termination(path, trajectories, INFOS, f) + except KeyboardInterrupt: + raise except BaseException: print('\n An error occured while trying to extract the status.\n \ Files may be corrupted.\n') @@ -1063,6 +1074,8 @@ def do_calc(INFOS): step += 1 try: problem, tana = check_consistency(path, trajectories, f, 'output.lis') + except KeyboardInterrupt: + raise except BaseException: print('\n An error occured while trying to check output.lis for consistency.') trajectories[path]['error'] = True @@ -1070,18 +1083,24 @@ def do_calc(INFOS): problem = check_length(path, trajectories, len(lis), 'output.lis') try: trajectories = check_energies(path, trajectories, INFOS, hops) + except KeyboardInterrupt: + raise except BaseException: print('\n An error occured while trying to extract the energies.\n \ Files may be corrupted.\n') trajectories[path]['error'] = True try: trajectories = check_populations(path, trajectories, INFOS) + except KeyboardInterrupt: + raise except BaseException: print('\n An error occured while trying to extract the populations.\n \ Files may be corrupted.\n') trajectories[path]['error'] = True try: trajectories = check_intruders(path, trajectories, INFOS, lis, tana, problem) + except KeyboardInterrupt: + raise except BaseException: print('\n An error occured while trying to extract possible intruder states.\n \ Files may be corrupted.\n') From f8bd43e29147d18398b0a4b93d49cbeac98336ab Mon Sep 17 00:00:00 2001 From: Sebastian Mai Date: Thu, 11 Apr 2024 10:51:18 +0200 Subject: [PATCH 06/10] SHARC_ORCA.py: fixed rare AOovl reading errors --- bin/SHARC_ORCA.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/SHARC_ORCA.py b/bin/SHARC_ORCA.py index f52b03f..cfdf667 100755 --- a/bin/SHARC_ORCA.py +++ b/bin/SHARC_ORCA.py @@ -3934,6 +3934,14 @@ def get_smat_from_gbw(file1, file2=''): NAO = int(line.split()[0]) + 1 break + # find start of matrix + iline = -1 + while True: + iline += 1 + line = out[iline] + if 'FRAGMENT-FRAGMENT OVERLAP MATRIX' in line: + break + # read matrix nblock = 6 ao_ovl = [[0. for i in range(NAO)] for j in range(NAO)] @@ -3941,7 +3949,7 @@ def get_smat_from_gbw(file1, file2=''): for y in range(NAO): block = x // nblock xoffset = x % nblock + 1 - yoffset = block * (NAO + 1) + y + 10 + yoffset = block * (NAO + 1) + y + 3 + iline ao_ovl[x][y] = float(out[yoffset].split()[xoffset]) return NAO, ao_ovl From bc0c242773d90061eed987523946f1eba83a383e Mon Sep 17 00:00:00 2001 From: Sebastian Mai Date: Fri, 3 May 2024 07:43:21 +0200 Subject: [PATCH 07/10] sharc.x/pysharc: fixed zero gradient after some hops --- source/data.inc | 1 + source/driver.f90 | 9 +++++++-- source/interface.F90 | 9 +++++++-- source/sharc_fortran.inc | 2 ++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/source/data.inc b/source/data.inc index 20e6b39..bf4759a 100644 --- a/source/data.inc +++ b/source/data.inc @@ -1,2 +1,3 @@ #define STRING_SIZE_S_ 256 #define STRING_SIZE_L_ 1024 +#define STRING_SIZE_XL_ 4096 diff --git a/source/driver.f90 b/source/driver.f90 index 2ca0329..673e70e 100644 --- a/source/driver.f90 +++ b/source/driver.f90 @@ -300,8 +300,13 @@ subroutine fixed_velocity_verlet(traj,ctrl) call Decoherence(traj,ctrl) ! obtain the correct gradient call Calculate_cMCH(traj,ctrl) - if (ctrl%calc_grad>=1) call redo_qm_gradients(traj,ctrl) - if (traj%kind_of_jump/=0) call Mix_gradients(traj,ctrl) + if (ctrl%calc_grad>=1) then + call redo_qm_gradients(traj,ctrl) + call NAC_processing(traj, ctrl) + endif + if (traj%kind_of_jump/=0) then + call Mix_gradients(traj,ctrl) + endif else if (ctrl%method==1) then !SCP ! Propagation coherent coefficients diff --git a/source/interface.F90 b/source/interface.F90 index 1ad4166..0abd0ab 100644 --- a/source/interface.F90 +++ b/source/interface.F90 @@ -464,6 +464,7 @@ subroutine get_nacdr(string, ICALL) use iso_c_binding use memory_module, only: traj, ctrl implicit none + ! __C_OUT_STRING_XL_ :: string __C_OUT_STRING_L_ :: string __INT__, intent(in) :: ICALL integer :: i,j @@ -480,6 +481,7 @@ subroutine get_nacdr(string, ICALL) do i=1,ctrl%nstates do j=1,ctrl%nstates if (traj%selt_ss(j,i)) write(string,'(A,1X,I3,1X,I3)') trim(string) // C_NEW_LINE , i,j + ! if (traj%selt_ss(j,i)) write(string,'(A,1X,I3,1X,I3)') trim(string) , i,j enddo enddo write(string,'(A)') trim(string) // C_NEW_LINE // 'END' @@ -1250,7 +1252,7 @@ subroutine Verlet_finalize(IExit, iskip) use memory_module, only: traj, ctrl use misc use definitions - use qm, only: Update_old, Mix_gradients + use qm, only: Update_old, Mix_gradients, NAC_processing use electronic, only: kill_after_relaxation use output, only: allflush, write_dat, write_list_line, write_geom use restart, only: write_restart_traj @@ -1259,7 +1261,10 @@ subroutine Verlet_finalize(IExit, iskip) __INT__, intent(out) :: IExit ! if IExit = 0 end loop, else continue __INT__, intent(in) :: iskip ! if IExit = 0 end loop, else continue - if (traj%kind_of_jump/=0) call Mix_gradients(traj, ctrl) + if (traj%kind_of_jump/=0) then + call NAC_processing(traj, ctrl) + call Mix_gradients(traj, ctrl) + endif ! Finalization: Variable update, Output, Restart File, Consistency Checks call Update_old(traj,ctrl) call set_time(traj) diff --git a/source/sharc_fortran.inc b/source/sharc_fortran.inc index cc26446..7052ccb 100644 --- a/source/sharc_fortran.inc +++ b/source/sharc_fortran.inc @@ -5,5 +5,7 @@ #define __COMPLEX__ complex*16 #define __C_STRING_S_ character(len=STRING_SIZE_S_) #define __C_STRING_L_ character(len=STRING_SIZE_L_) +#define __C_STRING_XL_ character(len=STRING_SIZE_XL_) #define __C_OUT_STRING_S_ __C_STRING_S_, intent(out) #define __C_OUT_STRING_L_ __C_STRING_L_, intent(out) +#define __C_OUT_STRING_XL_ __C_STRING_XL_, intent(out) From 0aff9c831b53fc9de6838495758554b230bdfb77 Mon Sep 17 00:00:00 2001 From: Sebastian Mai Date: Fri, 3 May 2024 07:46:41 +0200 Subject: [PATCH 08/10] SHARC_RICC2.py: AO overlaps in dscf are computed with zero nuclear charges for Turbomole 7.8 compatibility --- bin/SHARC_RICC2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/SHARC_RICC2.py b/bin/SHARC_RICC2.py index 531c96a..f0930fe 100755 --- a/bin/SHARC_RICC2.py +++ b/bin/SHARC_RICC2.py @@ -3759,12 +3759,15 @@ def define(path, QMin, ricc2=True): ''' string += '''b all %s -* +''' % (QMin['template']['basis']) + if not ricc2: + string += 'c\nall 0.\n' + string += '''* eht y %i y -''' % (QMin['template']['basis'], +''' % ( QMin['template']['charge'] ) From 5faca26cee9699fd839e137532ddd535a1e4e91a Mon Sep 17 00:00:00 2001 From: Sebastian Mai Date: Fri, 3 May 2024 07:47:59 +0200 Subject: [PATCH 09/10] SHARC_MOLCAS.py: during NAC runs, compute only overlaps of the relevant multiplicity --- bin/SHARC_MOLCAS.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/SHARC_MOLCAS.py b/bin/SHARC_MOLCAS.py index 6e181e8..a301f30 100755 --- a/bin/SHARC_MOLCAS.py +++ b/bin/SHARC_MOLCAS.py @@ -1542,6 +1542,11 @@ def getQMout(out, QMin): for jstate, j in enumerate(QMin['statemap']): mult1, state1, ms1 = tuple(QMin['statemap'][i]) mult2, state2, ms2 = tuple(QMin['statemap'][j]) + if 'overlap_nacs' in QMin: + if mult1 not in [i[0] for i in QMin['nacmap']]: + continue + if mult2 not in [i[0] for i in QMin['nacmap']]: + continue if mult1 == mult2 and ms1 == ms2: nac[istate][jstate] = complex(getsmate(out, mult1, state1, state2, states)) else: @@ -2893,6 +2898,8 @@ def gettasks(QMin): # RASSI for overlaps if 'overlap' in QMin: if 'overlap_nacs' in QMin: + if imult+1 not in [ i[0] for i in QMin['nacmap']]: + continue tasks.append(['link', 'MOLCAS.%i.JobIph' % (imult + 1), 'JOB001']) tasks.append(['link', 'MOLCAS.JobIph', 'JOB002']) else: @@ -2900,7 +2907,7 @@ def gettasks(QMin): tasks.append(['link', os.path.join(QMin['savedir'], 'MOLCAS.%i.JobIph.master' % (imult + 1)), 'JOB001']) else: tasks.append(['link', os.path.join(QMin['savedir'], 'MOLCAS.%i.JobIph.old' % (imult + 1)), 'JOB001']) - tasks.append(['link', 'MOLCAS.%i.JobIph' % (imult + 1), 'JOB002']) + tasks.append(['link', 'MOLCAS.%i.JobIph' % (imult + 1), 'JOB002']) tasks.append(['rassi', 'overlap', [nstates, nstates]]) # RASSI for Dipole moments only if overlap-RASSI is not needed @@ -3505,12 +3512,18 @@ def generate_joblist(QMin): QMin3['gradmap'] = [grad] QMin3['nacmap'] = [] QMin3['ncpu'] = cpu_per_run[icount] + #for i in range(len(QMin3['states'])): + # if not i+1 == grad[0]: + # QMin3['states'][i] = 0 icount += 1 joblist[-1]['grad_%i_%i' % grad] = QMin3 for nac in QMin['nacmap']: QMin3 = deepcopy(QMin2) QMin3['nacmap'] = [nac] QMin3['gradmap'] = [] + #for i in range(len(QMin3['states'])): + # if not i+1 == nac[0]: + # QMin3['states'][i] = 0 QMin3['overlap'] = [[j + 1, i + 1] for i in range(QMin['nmstates']) for j in range(i + 1)] QMin3['overlap_nacs'] = [] QMin3['ncpu'] = cpu_per_run[icount] From a86a95c35cbfef413d495836b867f8aa6ee5b995 Mon Sep 17 00:00:00 2001 From: Sebastian Mai Date: Wed, 8 May 2024 10:56:05 +0200 Subject: [PATCH 10/10] setup_traj.py: fixed typo for option ngt --- bin/setup_traj.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/setup_traj.py b/bin/setup_traj.py index 5b92829..c4fb59b 100755 --- a/bin/setup_traj.py +++ b/bin/setup_traj.py @@ -278,7 +278,7 @@ def all(iterable): 'description': 'mixed gradients are calculated as linear combination of MCH gradients only', 'required': [] }, - 2: {'name': 'ngh', + 2: {'name': 'ngt', 'description': 'mixed gradients are calculated by correction of MCH gradients with non-adiabatic coupling vector', 'required': ['nacdr'] },