[cig-commits] r5822 - short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1

willic3 at geodynamics.org willic3 at geodynamics.org
Thu Jan 18 08:25:38 PST 2007


Author: willic3
Date: 2007-01-18 08:25:38 -0800 (Thu, 18 Jan 2007)
New Revision: 5822

Added:
   short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/runex.py
Removed:
   short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/Make.mm
   short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/test.sh
Modified:
   short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/bm1.time
Log:
Starting the process of revising benchmarks.
Old Make.mm and test.sh files have been removed and replaced by
runex.py script to run the benchmark.  Time information has been
corrected to yield correct viscoelastic solution.



Deleted: short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/Make.mm
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/Make.mm	2007-01-18 15:21:56 UTC (rev 5821)
+++ short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/Make.mm	2007-01-18 16:25:38 UTC (rev 5822)
@@ -1,44 +0,0 @@
-# -*- Makefile -*-
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#  PyLith by Charles A. Williams, Brad Aagaard, and Matt Knepley
-#
-#  Copyright (c) 2004-2006 Rensselaer Polytechnic Institute
-#
-#  Permission is hereby granted, free of charge, to any person obtaining
-#  a copy of this software and associated documentation files (the
-#  "Software"), to deal in the Software without restriction, including
-#  without limitation the rights to use, copy, modify, merge, publish,
-#  distribute, sublicense, and/or sell copies of the Software, and to
-#  permit persons to whom the Software is furnished to do so, subject to
-#  the following conditions:
-#
-#  The above copyright notice and this permission notice shall be
-#  included in all copies or substantial portions of the Software.
-#
-#  THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
-#  EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
-#  MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
-#  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-#  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-#  OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
-#  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-
-test: clean
-	pylith3dapp.py -typos=relaxed -pl3dscan.fileRoot=bm1 -pl3dscan.asciiOutput=full -pl3dscan.autoRotateSlipperyNodes=False -log_summary -petsc_solver 1 -pc_type ilu -ksp_monitor -ksp_view -ksp_rtol 1e-9
-	# pylith3dapp.py -typos=relaxed -pl3dscan.fileRoot=bm1 -pl3dscan.asciiOutput=full -pl3dscan.autoRotateSlipperyNodes=False -log_summary -petsc_solver 1 -pc_type ilu -ksp_monitor -ksp_view -start_in_debugger noxterm
-
-clean::
-	$(RM_F) bm1.ascii bm1.plot bm1*.inp
-
-
-# version
-# $Id: Make.mm,v 1.3 2005/04/08 19:10:49 willic3 Exp $
-
-# Generated automatically by MakeMill on Tue Mar  2 17:05:23 2004
-
-# End of file 

Modified: short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/bm1.time
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/bm1.time	2007-01-18 15:21:56 UTC (rev 5821)
+++ short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/bm1.time	2007-01-18 16:25:38 UTC (rev 5822)
@@ -60,5 +60,5 @@
 #
 # n maxstp delt alfa maxit ntdinit lgdef utol     ftol    etol  itmax
 #
-  0   1   0.e+0  5.e-1 1001   4      0  1.0e+00  1.0e+0  1.0e+00 1
-  1 100   0.1    5.e-1 1001  -1      0  1.0e+00  1.0e+0  1.0e+00 1
+  0   1   0.0d0  5.d-1 1001   4      0  1.0d+00  1.0d+0  1.0d+00 1
+  1 100   0.1d0  5.d-1   10  -1      0  1.0d+00  1.0d-1  1.0d+00 2

Added: short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/runex.py
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/runex.py	2007-01-18 15:21:56 UTC (rev 5821)
+++ short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/runex.py	2007-01-18 16:25:38 UTC (rev 5822)
@@ -0,0 +1,85 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+root="bm1"
+
+# ----------------------------------------------------------------------
+def setupInput(nprocs):
+  dupext = [".fuldat", ".hist", ".keyval", ".prop", ".statevar", ".time"]
+  sinext = [".coord", ".connect", ".bc"]
+
+  print "Setting up symbolic links with prefix '%s_%d':" % (root, nprocs)
+  import os
+
+  dirFiles = os.listdir(os.getcwd())
+  for ext in sinext:
+    src = "%s%s" % (root, ext)
+    dest = "%s_%s%s" % (root, nprocs, ext)
+    if not dest in dirFiles:
+      print "  %s -> %s... created" % (dest, src)
+      os.symlink(src, dest)
+    else:
+      print "  %s -> %s... already exists" % (dest, src)
+
+  for ext in dupext:
+    src = "%s%s" % (root, ext)
+    for iproc in range(nprocs):
+      dest = "%s_%s.%d%s" % (root, nprocs, iproc, ext)
+      if not dest in dirFiles:
+        print "  %s -> %s... created" % (dest, src)
+        os.symlink(src, dest)
+      else:
+        print "  %s -> %s... already exists" % (dest, src)
+  return
+
+
+# ----------------------------------------------------------------------
+def run(nprocs):
+  print "Running PyLith..."
+
+  # TODO: Replace the use of launching via 'system' with use
+  # of Leif's architecture independent utility.
+
+  cmd = "mpirun -np %d `which pylith3dapp.py` " \
+        "--typos=relaxed " \
+        "--scanner.fileRoot=%s_%d " \
+        "--scanner.asciiOutput=full " \
+        "--scanner.ucdOutput=ascii " \
+        "-log_summary -pc_type bjacobi -sub_pc_type ilu " \
+        "-ksp_monitor -ksp_view -ksp_rtol 1e-09" % (nprocs, root, nprocs)
+  import os
+  print cmd
+  os.system(cmd)
+  return
+
+
+# ----------------------------------------------------------------------
+if __name__ == "__main__":
+  from optparse import OptionParser
+
+  parser = OptionParser()
+  parser.add_option("-n", "--numprocs", dest="nprocs",
+                    type="int", metavar="NPROCS",
+                    help="Set number of processors.")
+  (options, args) = parser.parse_args()
+  if len(args) != 0:
+    parser.error("Incorrent number of arguments.")
+
+  nprocs = 1
+  if not options.nprocs is None:
+    nprocs = options.nprocs
+
+  setupInput(nprocs)
+  run(nprocs)
+
+
+# End of file


Property changes on: short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/runex.py
___________________________________________________________________
Name: svn:executable
   + *

Deleted: short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/test.sh
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/test.sh	2007-01-18 15:21:56 UTC (rev 5821)
+++ short/3D/PyLith/branches/pylith-0.8/pylith3d/examples/linhex/bm1/test.sh	2007-01-18 16:25:38 UTC (rev 5822)
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-pylith3dapp.py -typos=relaxed -pl3dscan.fileRoot=linhex/bm1/bm1 -pl3dscan.asciiOutput=full -pl3dscan.autoRotateSlipperyNodes=False -log_summary -petsc_solver 1 -pc_type ilu -ksp_monitor -ksp_view -ksp_rtol 1e-9
-
-# end of file



More information about the cig-commits mailing list