Skip to content

Commit

Permalink
fix issue in remote calculations when run two consecutive calculation…
Browse files Browse the repository at this point in the history
…s in same script
  • Loading branch information
abelcarreras committed Jul 4, 2023
1 parent 7aa6a06 commit 9a8cc5e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyqchem/qchem_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import hashlib
import pickle
import warnings
import copy


if sys.version_info[0] < 3 or sys.platform in ["win32", "cygwin"] or os.getenv('PYQCHEM_CACHE') == '1':
Expand Down Expand Up @@ -255,6 +256,7 @@ def remote_run(input_file_name, work_dir, fchk_file, remote_params, use_mpi=Fals
:return: output, err: Q-Chem standard output and standard error
"""
import paramiko
remote_params = copy.deepcopy(remote_params)

# get precommands
commands = remote_params.pop('precommand', [])
Expand Down Expand Up @@ -584,8 +586,10 @@ def get_output_from_qchem(input_qchem,
# Q-Chem calculation
if output is None or force_recalculation is True:
if remote is None:
print('local:')
output, err = local_run(temp_filename, work_dir, fchk_filename, use_mpi=use_mpi, processors=processors)
else:
print('Remote:')
output, err = remote_run(temp_filename, work_dir, fchk_filename, remote, use_mpi=use_mpi, processors=processors)

if not finish_ok(output):
Expand Down

0 comments on commit 9a8cc5e

Please sign in to comment.