Repository: ESMCI/cime

Issue:
Remove taskmaker.pl
We already have a task_maker.py, need to remove the perl version and make sure case.setup is calling it so that users do not get LibXML errors.



Discussion:

Resolving patch:
diff --git a/utils/python/CIME/case.py b/utils/python/CIME/case.py
--- a/utils/python/CIME/case.py
+++ b/utils/python/CIME/case.py
@@ -673,6 +673,7 @@ def _create_caseroot_tools(self):
                     os.path.join(toolsdir, "preview_namelists"),
                     os.path.join(toolsdir, "check_input_data"),
                     os.path.join(toolsdir, "check_case"),
+                    os.path.join(toolsdir, "taskmaker"),
                     os.path.join(toolsdir, "archive_metadata.sh"),
                     os.path.join(toolsdir, "xmlchange"),
                     os.path.join(toolsdir, "xmlquery"))
@@ -687,7 +688,6 @@ def _create_caseroot_tools(self):
         toolfiles = (os.path.join(toolsdir, "check_lockedfiles"),
                      os.path.join(toolsdir, "lt_archive.sh"),
                      os.path.join(toolsdir, "getTiming"),
-                     os.path.join(machines_dir,"taskmaker.pl"),
                      os.path.join(machines_dir,"Makefile"),
                      os.path.join(machines_dir,"mkSrcfiles"),
                      os.path.join(machines_dir,"mkDepends"))
diff --git a/utils/python/CIME/case_setup.py b/utils/python/CIME/case_setup.py
--- a/utils/python/CIME/case_setup.py
+++ b/utils/python/CIME/case_setup.py
@@ -6,6 +6,7 @@
 
 from CIME.check_lockedfiles import check_lockedfiles
 from CIME.preview_namelists import preview_namelists
+from CIME.task_maker        import TaskMaker
 from CIME.XML.env_mach_pes  import EnvMachPes
 from CIME.XML.component     import Component
 from CIME.XML.compilers     import Compilers
@@ -187,7 +188,8 @@ def _case_setup_impl(case, caseroot, casebaseid, clean=False, test_mode=False, r
             case.flush()
             check_lockedfiles()
 
-            pestot = int(run_cmd_no_fail("Tools/taskmaker.pl -sumonly"))
+            tm = TaskMaker(case)
+            pestot = tm.fullsum
             case.set_value("TOTALPES", pestot)
 
             # Compute cost based on PE count
diff --git a/utils/python/CIME/task_maker.py b/utils/python/CIME/task_maker.py
--- a/utils/python/CIME/task_maker.py
+++ b/utils/python/CIME/task_maker.py
@@ -130,7 +130,7 @@ def _compute_values(self):
                 node_count = int(math.ceil(float(task_count) / tasks_per_node))
 
                 total_node_count += node_count
-                pbsrs += "%d:ncpus=%d:mpiprocs=%d:ompthreads=%d:model=" % (node_count, self.MAX_TASKS_PER_NODE, tasks_per_node, thread_count)
+                pbsrs += "%d:ncpus=%d:mpiprocs=%d:ompthreads=%d:model=$MODEL" % (node_count, self.MAX_TASKS_PER_NODE, tasks_per_node, thread_count)
 
                 thread_count = maxt[c1]
                 max_thread_count = max(max_thread_count, maxt[c1])
@@ -174,7 +174,7 @@ def _compute_values(self):
         self.aprun = aprun
         self.opt_node_count = total_node_count
         self.num_nodes = max_total_node_count
-        self.pbsrs = pbsrs + "%d:ncpus=%d:mpiprocs=%d:ompthreads=%d:model=" % (max_total_node_count, self.MAX_TASKS_PER_NODE, tasks_per_node, thread_count)
+        self.pbsrs = pbsrs + "%d:ncpus=%d:mpiprocs=%d:ompthreads=%d:model=$MODEL" % (max_total_node_count, self.MAX_TASKS_PER_NODE, tasks_per_node, thread_count)
 
         # calculate ptile..
         ptile = self.MAX_TASKS_PER_NODE / 2


Test patch: