Skip to content

Commit

Permalink
Merge pull request #131 from hagertnl/nick-issue24
Browse files Browse the repository at this point in the history
Create a better strategy for RGT_ACCT_ID and RGT_SUBMIT_QUEUE
  • Loading branch information
hagertnl authored Oct 16, 2023
2 parents ae43fec + 9d11d4e commit b8e0950
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
3 changes: 2 additions & 1 deletion configs/example_machine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ joblauncher_type = srun
cpus_per_node = 16
gpus_per_node = 1
batch_queue = batch
project_id = abc123
submit_args =
nccs_test_harness_module = olcf_harness

Expand All @@ -21,4 +22,4 @@ git_https_server_url = https://github.com
[TestshotDefaults]
path_to_sspace = /home/a_user/other_dir
system_log_tag = a_label
project_id = abc123

10 changes: 6 additions & 4 deletions harness/machine_types/lsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ def submit_job(self, batchfilename):
qargs = ""
if 'RGT_SUBMIT_QUEUE' in os.environ:
qargs += " -q " + os.environ.get('RGT_SUBMIT_QUEUE')
elif 'RGT_BATCH_QUEUE' in os.environ:
qargs += " -q " + os.environ.get('RGT_BATCH_QUEUE')

if 'RGT_SUBMIT_ARGS' in os.environ:
qargs += " " + os.getenv('RGT_SUBMIT_ARGS')
qargs += " " + os.environ.get('RGT_SUBMIT_ARGS')

if 'RGT_PROJECT_ID' in os.environ:
if 'RGT_SUBMIT_ACCT' in os.environ:
qargs += " -P " + os.environ.get('RGT_SUBMIT_ACCT')
elif 'RGT_PROJECT_ID' in os.environ:
qargs += " -P " + os.environ.get('RGT_PROJECT_ID')
elif 'RGT_ACCT_ID' in os.environ:
qargs += " -P " + os.environ.get('RGT_ACCT_ID')

qcommand = self.__submitCmd + " " + qargs + " " + batchfilename
print(qcommand)
Expand Down
10 changes: 6 additions & 4 deletions harness/machine_types/pbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ def submit_job(self, batchfilename):
qargs = ""
if 'RGT_SUBMIT_QUEUE' in os.environ:
qargs += " -q " + os.environ.get('RGT_SUBMIT_QUEUE')
elif 'RGT_BATCH_QUEUE' in os.environ:
qargs += " -q " + os.environ.get('RGT_BATCH_QUEUE')

if 'RGT_SUBMIT_ARGS' in os.environ:
qargs += " " + os.getenv('RGT_SUBMIT_ARGS')
qargs += " " + os.environ.get('RGT_SUBMIT_ARGS')

if 'RGT_PROJECT_ID' in os.environ:
if 'RGT_SUBMIT_ACCT' in os.environ:
qargs += " -A " + os.environ.get('RGT_SUBMIT_ACCT')
elif 'RGT_PROJECT_ID' in os.environ:
qargs += " -A " + os.environ.get('RGT_PROJECT_ID')
elif 'RGT_ACCT_ID' in os.environ:
qargs += " -A " + os.environ.get('RGT_ACCT_ID')

qcommand = self.__submitCmd + " " + qargs + " " + batchfilename
print(qcommand)
Expand Down
4 changes: 2 additions & 2 deletions harness/machine_types/rgt_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,10 @@ def _read_rgt_input_ini(self):
env_dict = {}
bq = self.get_batch_queue()
if bq:
env_dict = {'submit_queue' : bq}
env_dict['batch_queue'] = bq
proj = self.get_project()
if proj:
env_dict = {'project_id' : proj}
env_dict['project_id'] = proj
rgt_utilities.set_harness_environment(env_dict, override=True)

if 'EnvVars' in rgt_test_config:
Expand Down
8 changes: 5 additions & 3 deletions harness/machine_types/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ def submit_job(self, batchfilename):
qargs = ""
if 'RGT_SUBMIT_QUEUE' in os.environ:
qargs += " -p " + os.environ.get('RGT_SUBMIT_QUEUE')
elif 'RGT_BATCH_QUEUE' in os.environ:
qargs += " -p " + os.environ.get('RGT_BATCH_QUEUE')

if 'RGT_SUBMIT_ARGS' in os.environ:
qargs += " " + os.environ.get('RGT_SUBMIT_ARGS')

if 'RGT_PROJECT_ID' in os.environ:
if 'RGT_SUBMIT_ACCT' in os.environ:
qargs += " -A " + os.environ.get('RGT_SUBMIT_ACCT')
elif 'RGT_PROJECT_ID' in os.environ:
qargs += " -A " + os.environ.get('RGT_PROJECT_ID')
elif 'RGT_ACCT_ID' in os.environ:
qargs += " -A " + os.environ.get('RGT_ACCT_ID')

qcommand = self.__submitCmd + " " + qargs + " " + batchfilename
print(qcommand)
Expand Down

0 comments on commit b8e0950

Please sign in to comment.