Skip to content

Commit

Permalink
add aprun fix for using less than full node of tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Oct 28, 2016
1 parent 059dbdf commit 25e361f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 0 additions & 2 deletions utils/python/CIME/XML/env_mach_pes.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ def get_total_tasks(self, comp_classes):
pstrid = self.get_value("PSTRID_%s"%comp)
tt = rootpe + (ntasks - 1) * pstrid + 1
total_tasks = max(tt, total_tasks)
if total_tasks < self.get_value("PES_PER_NODE"): # all PEs fit in 1 node
self.set_value("PES_PER_NODE", total_tasks)
return total_tasks

def get_tasks_per_node(self, total_tasks, max_thread_count):
Expand Down
6 changes: 4 additions & 2 deletions utils/python/CIME/XML/env_mach_specific.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ def get_mpirun(self, case, attribs, check_members=None, job="case.run"):
default=arg_node.get("default"))
args[arg_node.get("name")] = arg_value

executable = self.get_node("executable", root=the_match)
exec_node = self.get_node("executable", root=the_match)
expect(exec_node is not None,"No executable found")
executable = exec_node.text

return executable.text, args
return executable, args

6 changes: 6 additions & 0 deletions utils/python/CIME/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,12 @@ def get_mpirun_cmd(self, job="case.run"):
}

executable, args = env_mach_specific.get_mpirun(self, mpi_attribs, job=job)
# special case for aprun if using < 1 full node
if executable == "aprun":
totalpes = self.get_value("TOTALPES")
pes_per_node = self.get_value("PES_PER_NODE")
if totalpes < pes_per_node:
args["tasks_per_node"] = "-N "+str(totalpes)

mpi_arg_string = " ".join(args.values())

Expand Down

0 comments on commit 25e361f

Please sign in to comment.