Skip to content

Commit

Permalink
Merge 93fa3bd into d277b7a
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanheerdegen committed May 12, 2020
2 parents d277b7a + 93fa3bd commit 785f864
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion payu/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def get_model_type(model_type, config):


def set_env_vars(init_run=None, n_runs=None, lab_path=None, dir_path=None,
reproduce=None):
reproduce=False, force=False):
"""Construct the environment variables used by payu for resubmissions."""
payu_env_vars = {}

Expand Down Expand Up @@ -129,6 +129,9 @@ def set_env_vars(init_run=None, n_runs=None, lab_path=None, dir_path=None,
if reproduce:
payu_env_vars['PAYU_REPRODUCE'] = reproduce

if force:
payu_env_vars['PAYU_FORCE'] = force

# Pass through important module related environment variables
module_env_vars = ['MODULESHOME', 'MODULES_CMD', 'MODULEPATH', 'MODULEV']
for var in module_env_vars:
Expand Down
7 changes: 6 additions & 1 deletion payu/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ class Experiment(object):

def __init__(self, lab, reproduce=False, force=False):
self.lab = lab
self.force = force

if not force:
# check environment for force flag under PBS
self.force = os.environ.get('PAYU_FORCE', False)
else:
self.force = force

self.start_time = datetime.datetime.now()

Expand Down
2 changes: 1 addition & 1 deletion payu/subcommands/run_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def runcmd(model_type, config_path, init_run, n_runs, lab_path,
# Get job submission configuration
pbs_config = fsops.read_config(config_path)
pbs_vars = cli.set_env_vars(init_run, n_runs, lab_path,
reproduce=reproduce)
reproduce=reproduce, force=force)

# Set the queue
# NOTE: Maybe force all jobs on the normal queue
Expand Down

0 comments on commit 785f864

Please sign in to comment.