From 1c5d0cef82c014d7fcc27b6a2af0d3a53deeb791 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 19 Apr 2017 14:38:10 -0600 Subject: [PATCH] return only aprun args and use executable from xml --- scripts/lib/CIME/aprun.py | 22 +++++++++++----------- scripts/lib/CIME/case.py | 8 ++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/lib/CIME/aprun.py b/scripts/lib/CIME/aprun.py index 7991f408c00..de6c1539dc5 100644 --- a/scripts/lib/CIME/aprun.py +++ b/scripts/lib/CIME/aprun.py @@ -30,10 +30,10 @@ def _get_aprun_cmd_for_case_impl(ntasks, nthreads, rootpes, pstrids, >>> machine = "titan" >>> run_exe = "acme.exe" >>> _get_aprun_cmd_for_case_impl(ntasks, nthreads, rootpes, pstrids, max_tasks_per_node, pes_per_node, pio_numtasks, pio_async_interface, compiler, machine, run_exe) - ('aprun -S 4 -n 680 -N 8 -d 2 acme.exe : -S 2 -n 128 -N 4 -d 4 acme.exe ', 117) + (' -S 4 -n 680 -N 8 -d 2 acme.exe : -S 2 -n 128 -N 4 -d 4 acme.exe ', 117) >>> compiler = "intel" >>> _get_aprun_cmd_for_case_impl(ntasks, nthreads, rootpes, pstrids, max_tasks_per_node, pes_per_node, pio_numtasks, pio_async_interface, compiler, machine, run_exe) - ('aprun -S 4 -cc numa_node -n 680 -N 8 -d 2 acme.exe : -S 2 -cc numa_node -n 128 -N 4 -d 4 acme.exe ', 117) + (' -S 4 -cc numa_node -n 680 -N 8 -d 2 acme.exe : -S 2 -cc numa_node -n 128 -N 4 -d 4 acme.exe ', 117) """ max_tasks_per_node = 1 if max_tasks_per_node < 1 else max_tasks_per_node @@ -64,8 +64,8 @@ def _get_aprun_cmd_for_case_impl(ntasks, nthreads, rootpes, pstrids, maxt[c1] = 1 # Compute task and thread settings for batch commands - tasks_per_node, task_count, thread_count, max_thread_count, total_node_count, aprun = \ - 0, 1, maxt[0], maxt[0], 0, "aprun" + tasks_per_node, task_count, thread_count, max_thread_count, total_node_count, aprun_args = \ + 0, 1, maxt[0], maxt[0], 0, "" for c1 in xrange(1, total_tasks): if maxt[c1] != thread_count: tasks_per_node = min(pes_per_node, max_tasks_per_node / thread_count) @@ -76,11 +76,11 @@ def _get_aprun_cmd_for_case_impl(ntasks, nthreads, rootpes, pstrids, task_per_numa = int(math.ceil(tasks_per_node / 2.0)) # Option for Titan if machine == "titan" and tasks_per_node > 1: - aprun += " -S %d" % task_per_numa + aprun_args += " -S %d" % task_per_numa if compiler == "intel": - aprun += " -cc numa_node" + aprun_args += " -cc numa_node" - aprun += " -n %d -N %d -d %d %s :" % (task_count, tasks_per_node, thread_count, run_exe) + aprun_args += " -n %d -N %d -d %d %s :" % (task_count, tasks_per_node, thread_count, run_exe) node_count = int(math.ceil(float(task_count) / tasks_per_node)) total_node_count += node_count @@ -105,13 +105,13 @@ def _get_aprun_cmd_for_case_impl(ntasks, nthreads, rootpes, pstrids, # Special option for Titan with intel compiler if machine == "titan" and tasks_per_node > 1: - aprun += " -S %d" % task_per_numa + aprun_args += " -S %d" % task_per_numa if compiler == "intel": - aprun += " -cc numa_node" + aprun_args += " -cc numa_node" - aprun += " -n %d -N %d -d %d %s " % (task_count, tasks_per_node, thread_count, run_exe) + aprun_args += " -n %d -N %d -d %d %s " % (task_count, tasks_per_node, thread_count, run_exe) - return aprun, total_node_count + return aprun_args, total_node_count ############################################################################### def get_aprun_cmd_for_case(case, run_exe): diff --git a/scripts/lib/CIME/case.py b/scripts/lib/CIME/case.py index 34520f90ea3..a427ef4fb9b 100644 --- a/scripts/lib/CIME/case.py +++ b/scripts/lib/CIME/case.py @@ -149,7 +149,7 @@ def _initialize_derived_attributes(self): } executable = env_mach_spec.get_mpirun(self, mpi_attribs, job="case.run", exe_only=True)[0] - if executable == "aprun": + if "aprun" in executable: self.num_nodes = get_aprun_cmd_for_case(self, "acme.exe")[1] self.spare_nodes = env_mach_pes.get_spare_nodes(self.num_nodes) self.num_nodes += self.spare_nodes @@ -1119,10 +1119,10 @@ 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 executable == "aprun": - aprun_cmd, num_nodes = get_aprun_cmd_for_case(self, run_exe) + if "aprun" in executable: + aprun_args, num_nodes = get_aprun_cmd_for_case(self, run_exe) expect(num_nodes == self.num_nodes, "Not using optimized num nodes") - return aprun_cmd + " " + run_misc_suffix + return executable + aprun_args + " " + run_misc_suffix else: mpi_arg_string = " ".join(args.values())