Skip to content

Commit

Permalink
Merge pull request #35 from doyle-lab-ucla/dev2
Browse files Browse the repository at this point in the history
  • Loading branch information
beef-broccoli authored Jun 26, 2024
2 parents 7135aef + dd03696 commit f081bd0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions autoqchem/slurm_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class slurm_manager(object):
"""Slurm manager class."""

def __init__(self, user, host):
def __init__(self, user, host, remote_dir=None):
"""Initialize slurm manager and load the cache file.
:param user: username at remote host
Expand All @@ -39,7 +39,10 @@ def __init__(self, user, host):

self.host = host
self.user = user
self.remote_dir = f"/scratch/{'gpfs' if 'della' in host else 'network'}/{self.user}/gaussian"
if remote_dir:
self.remote_dir = remote_dir
else:
self.remote_dir = f"/scratch/{'gpfs' if 'della' in host else 'network'}/{self.user}/gaussian"
self.connection = None

def connect(self) -> None:
Expand All @@ -58,7 +61,7 @@ def connect(self) -> None:
logger.info(f"Creating connection to {self.host} as {self.user}")
create_new_connection = True
if create_new_connection:
self.connection = ssh_connect(self.host, self.user)
self.connection = ssh_connect_password(self.host, self.user)
self.connection.run(f"mkdir -p {self.remote_dir}")
logger.info(f"Connected to {self.host} as {self.user}.")

Expand Down

0 comments on commit f081bd0

Please sign in to comment.