Skip to content

Commit

Permalink
update storage path check to look for sync path in config.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Jo Basevi committed Oct 15, 2023
1 parent a05168e commit b6a323e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions payu/schedulers/pbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,11 @@ def submit(self, pbs_script, pbs_config, pbs_vars=None, python_exe=None):
short_path = pbs_config.get('shortpath', None)
if short_path is not None:
extra_search_paths.append(short_path)

module_use_paths = pbs_config.get('modules', {}).get('use', [])
extra_search_paths.extend(module_use_paths)

remote_sync_directory = pbs_vars.get('PAYU_SYNC_PATH', None)
if remote_sync_directory is None:
remote_sync_directory = pbs_config.get('sync', {}).get('directory', None)
remote_sync_directory = pbs_config.get('sync', {}).get('path', None)
if remote_sync_directory is not None:
extra_search_paths.append(remote_sync_directory)
storages.update(find_mounts(extra_search_paths, mounts))
Expand Down
6 changes: 3 additions & 3 deletions test/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ def test_sync():
# Function to test
expt.sync()

expected_dirs_synced = ['output000', 'output001', 'output002',
'output003', 'output004', 'pbs_logs']
expected_dirs_synced = {'output000', 'output001', 'output002',
'output003', 'output004', 'pbs_logs'}

# Test output is moved to remote dir
assert os.listdir(remote_archive) == expected_dirs_synced
assert set(os.listdir(remote_archive)) == expected_dirs_synced

# Test inner log files are copied
remote_log_path = os.path.join(remote_archive, 'pbs_logs', log_filename)
Expand Down

0 comments on commit b6a323e

Please sign in to comment.