[cig-commits] r21404 - short/3D/PyLith/benchmarks/trunk/dynamic/scecdynrup/tpv22

brad at geodynamics.org brad at geodynamics.org
Tue Feb 26 15:43:19 PST 2013


Author: brad
Date: 2013-02-26 15:43:19 -0800 (Tue, 26 Feb 2013)
New Revision: 21404

Added:
   short/3D/PyLith/benchmarks/trunk/dynamic/scecdynrup/tpv22/run_sim.py
Log:
Added Python script to run sim.

Added: short/3D/PyLith/benchmarks/trunk/dynamic/scecdynrup/tpv22/run_sim.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/dynamic/scecdynrup/tpv22/run_sim.py	                        (rev 0)
+++ short/3D/PyLith/benchmarks/trunk/dynamic/scecdynrup/tpv22/run_sim.py	2013-02-26 23:43:19 UTC (rev 21404)
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+#
+# Python script to facilitate running benchmarks.
+#
+# Use QUEUE == None if not using batch system.
+
+import os
+import sys
+import subprocess
+
+if len(sys.argv) != 7:
+    raise ValueError("usage: run_sim.py TPV CELL RES PPN NNODES QUEUE")
+tpv = sys.argv[1]
+cell = sys.argv[2]
+res = sys.argv[3]
+ppn = int(sys.argv[4])
+nnodes = int(sys.argv[5])
+queue = sys.argv[6]
+
+if not tpv in ["tpv22", "tpv23"]:
+    raise ValueError("TPV (%s) must be 'tpv22' or 'tpv23'." % pc)
+if not cell in ["hex8", "tet4"]:
+    raise ValueError("Cell type (%s) must be 'hex8' or 'tet4'." % cell)
+if not res in ["200m", "100m"]:
+    raise ValueError("Resolution (%s) must be '200c' or '100m'." % res)
+
+nprocs = ppn*nnodes
+for d in ["output"]:
+  if not os.path.isdir(d):
+      os.mkdir(d)
+
+job = "%s_%s_%s" % (tpv, cell, res)
+
+if queue.lower() != "none":
+    batchfile = os.environ['HOME'] + "/.pyre/pylithapp/pylithapp_%s.cfg" % queue
+else:
+    batchfile = ""
+
+cfgfiles = " %s.cfg %s %s.cfg" % (tpv, cell, job)
+
+args = batchfile + " --job.name=%s --job.stdout=logs/%s.log --job.stderr=logs/%s.err " % (job, job, job)
+
+if queue.lower() == "none":
+    cmd = "pylith " + cfgfiles + \
+        " --nodes=%d " % (ppn*nnodes) + \
+        args
+
+elif queue == "pbs":
+    cmd = "pylith " + cfgfiles + \
+        " --nodes=%d --scheduler.ppn=%d " % (nprocs, ppn) + \
+        args
+
+elif queue == "lonestar":
+    cmd = "pylith " + cfgfiles + \
+        " --nodes=%d --scheduler.pe-name=%dway --scheduler.pe-number=%s " % (nprocs, ppn, max(12, ppn)*nnodes) + \
+        args
+
+
+print cmd
+#subprocess.call(cmd, shell=True)


Property changes on: short/3D/PyLith/benchmarks/trunk/dynamic/scecdynrup/tpv22/run_sim.py
___________________________________________________________________
Name: svn:executable
   + *



More information about the CIG-COMMITS mailing list