Skip to content

Commit

Permalink
add support for special queue on yellowstone
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Aug 16, 2016
1 parent 1ff6c2b commit 518552b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cime_config/cesm/machines/config_batch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@

<batch_system MACH="yellowstone" type="lsf" version="9.1">
<queues>
<queue walltimemax="24:00" jobmin="1" jobmax="8">caldera</queue>
<queue walltimemax="24:00" jobmin="1" jobmax="1" jobname="case.lt_archive">hpss</queue>
<queue walltimemax="24:00" jobmin="1" jobmax="8" >caldera</queue>
<queue walltimemax="12:00" jobmin="9" jobmax="16384" default="true">regular</queue>
<queue walltimemax="12:00" jobmin="16385" jobmax="65536">capability</queue>
</queues>
Expand Down
12 changes: 8 additions & 4 deletions utils/python/CIME/XML/env_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def set_job_defaults(self, bjobs, pesize=None, walltime=None, force_queue=None):
else:
task_count = int(task_count)

queue = force_queue if force_queue is not None else self.select_best_queue(task_count)
queue = force_queue if force_queue is not None else self.select_best_queue(task_count, job)
self.set_value("JOB_QUEUE", queue, subgroup=job)

walltime = self.get_max_walltime(queue) if walltime is None else walltime
Expand Down Expand Up @@ -464,7 +464,7 @@ def get_job_id(self, output):
jobid = re.search(jobid_pattern, output).group(1)
return jobid

def select_best_queue(self, num_pes):
def select_best_queue(self, num_pes, job=None):
# Make sure to check default queue first.
all_queues = []
all_queues.append( self.get_default_queue())
Expand All @@ -473,9 +473,13 @@ def select_best_queue(self, num_pes):
if queue is not None:
jobmin = queue.get("jobmin")
jobmax = queue.get("jobmax")
jobname = queue.get("jobname")
if jobname is not None:
if job == jobname:
return queue.text
# if the fullsum is between the min and max # jobs, then use this queue.
if jobmin is not None and jobmax is not None and num_pes >= int(jobmin) and num_pes <= int(jobmax):
return queue.text
elif jobmin is not None and jobmax is not None and num_pes >= int(jobmin) and num_pes <= int(jobmax):
return queue.text
return None

def get_max_walltime(self, queue):
Expand Down

0 comments on commit 518552b

Please sign in to comment.