[cig-commits] r19992 - short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott

brad at geodynamics.org brad at geodynamics.org
Wed Apr 25 16:08:52 PDT 2012


Author: brad
Date: 2012-04-25 16:08:52 -0700 (Wed, 25 Apr 2012)
New Revision: 19992

Modified:
   short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/run_sims.py
Log:
Updated run script for multiple resolutions.

Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/run_sims.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/run_sims.py	2012-04-25 22:56:23 UTC (rev 19991)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/sceccrustdeform/savageprescott/run_sims.py	2012-04-25 23:08:52 UTC (rev 19992)
@@ -6,18 +6,22 @@
 import sys
 import subprocess
 
-if len(sys.argv) >= 3:
+if len(sys.argv) >= 4:
     cell = sys.argv[1]
-    nprocs = int(sys.argv[2])
+    res = sys.argv[2]
+    nprocs = int(sys.argv[3])
     batch = None
-    if len(sys.argv) == 4:
-        batch = sys.argv[3].upper()
+    if len(sys.argv) == 5:
+        batch = sys.argv[4].upper()
 else:
-    raise ValueError("usage: run_sims.py CELL NPROCS [BATCH_SYSTEM]")
+    raise ValueError("usage: run_sims.py CELL RES NPROCS [BATCH_SYSTEM]")
 
 if not cell in ["hex8", "tet4"]:
     raise ValueError("Cell type (%s) must be 'hex8' or 'tet4'." % cell)
 
+if not res in ["20km", "6.7km"]:
+    raise ValueError("Resolution (%s) must be '20km' or '6.7km'." % cell)
+
 if not batch is None and not batch in ["PBS"]:
     raise ValueError("Unknown batch system '%s'." % batch)
 
@@ -25,7 +29,7 @@
   if not os.path.isdir(d):
       os.mkdir(d)
 
-args = "%s.cfg fieldsplit.cfg --nodes=%d" % (cell, nprocs)
+args = "%s.cfg %s_%s.cfg fieldsplit.cfg --nodes=%d" % (cell, cell, res, nprocs)
 if batch == "PBS":
     pbsfile = os.environ['HOME'] + "/.pyre/pylithapp/pylithapp_pbs.cfg"
     args += " " + pbsfile + " --job.name=savageprescott_%s --job.stdout=%s.log" % (cell, cell)



More information about the CIG-COMMITS mailing list