[cig-commits] r17888 - in short/3D/PyLith/trunk: . modulesrc/mpi pylith/apps

brad at geodynamics.org brad at geodynamics.org
Wed Feb 16 18:23:25 PST 2011


Author: brad
Date: 2011-02-16 18:23:25 -0800 (Wed, 16 Feb 2011)
New Revision: 17888

Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/modulesrc/mpi/Makefile.am
   short/3D/PyLith/trunk/modulesrc/mpi/mpi.i
   short/3D/PyLith/trunk/pylith/apps/PetscApplication.py
Log:
Added try/except in PetscApplication to trap errors and call MPI_Abort().

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2011-02-17 02:11:59 UTC (rev 17887)
+++ short/3D/PyLith/trunk/TODO	2011-02-17 02:23:25 UTC (rev 17888)
@@ -26,26 +26,40 @@
 
     Add time dataset to vertex_fields and cell_fields.
 
-    Add creation of .xmf metadata file for VTK. 
+    Add creation of .xmf metadata file for ParaView/Visit. 
     Will this work for [#timesteps, #points, fiberDim]?
 
 
-* nondimensional viscosity in explicit (0.1 is what is in SPECFEM)
-
 * preprocess mesh
 
+    Adjust topology, reorder cells, partition
+    Write partitioned mesh.
+
 * Reimplement Fields to use a single section.
 
     Fields
     FieldsNew -> CombinedFields
-    Use CombinedFields for acc, vel, disp(t+dt), disp(t), etc?
-    Use Field for dispIncr(t->t+dt)?
+    SolutionFields
+      Use CombinedFields for acc, vel, disp(t+dt), disp(t), etc?
+      Use Field for dispIncr(t->t+dt), residual(t)
 
 * Cleanup
   + memory model
   + full-scale testing
   + Code cleanup
 
+----------------------------------------------------------------------
+SECONDARY PRIORITIES
+----------------------------------------------------------------------
+
+* Paper
+
+  General paper - focus on fault implementation
+
+  Custom preconditioner
+
+* Cleanup
+
     Add elasticPrestep() to Formulation
     Remove solnIncr, keep setField()
 
@@ -58,17 +72,6 @@
       + Refactor friction sensitivity solve, fault preconditioner, and
         adjustSolnLumped()
 
-
-----------------------------------------------------------------------
-SECONDARY PRIORITIES
-----------------------------------------------------------------------
-
-* Paper
-
-  General paper - focus on fault implementation
-
-  Custom preconditioner
-
 * Optimization
   + inline methods (what isn't getting inlined) -Winline
   + Specialized elasticity integrator objects for Quad4, Hex8

Modified: short/3D/PyLith/trunk/modulesrc/mpi/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/modulesrc/mpi/Makefile.am	2011-02-17 02:11:59 UTC (rev 17887)
+++ short/3D/PyLith/trunk/modulesrc/mpi/Makefile.am	2011-02-17 02:23:25 UTC (rev 17888)
@@ -25,7 +25,8 @@
 
 swig_sources = \
 	mpi.i \
-	mpi_comm.i
+	mpi_comm.i \
+	mpi_error.i
 
 swig_generated = \
 	mpi_wrap.cxx \

Modified: short/3D/PyLith/trunk/modulesrc/mpi/mpi.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/mpi/mpi.i	2011-02-17 02:11:59 UTC (rev 17887)
+++ short/3D/PyLith/trunk/modulesrc/mpi/mpi.i	2011-02-17 02:23:25 UTC (rev 17888)
@@ -28,6 +28,8 @@
 
 // Interfaces
 %include "mpi_comm.i"
+%include "mpi_error.i"
 
+
 // End of file
 

Modified: short/3D/PyLith/trunk/pylith/apps/PetscApplication.py
===================================================================
--- short/3D/PyLith/trunk/pylith/apps/PetscApplication.py	2011-02-17 02:11:59 UTC (rev 17887)
+++ short/3D/PyLith/trunk/pylith/apps/PetscApplication.py	2011-02-17 02:23:25 UTC (rev 17888)
@@ -59,13 +59,30 @@
     Run the application in parallel on the compute nodes.
     """
     self.petsc.initialize()
+
+    # Test for CUDA
     try:
       import pycuda
       import pycuda.autoinit
       self._info.log('Initialized CUDA')
     except ImportError:
       self._info.log('Could not initialize CUDA')
-    self.main(*args, **kwds)
+      # :TODO: Set some flag here to disable CUDA. Optionally also
+      # allow user to turn off use of CUDA.
+
+    try:
+
+      self.main(*args, **kwds)
+
+    except Exception, err:
+      self.cleanup() # Attempt to clean up memory.
+      print "Fatal error while running PyLith:"
+      print err
+      print "Calling MPI_Abort() to abort PyLith application."
+      from pylith.mpi import mpi
+      errorCode = -1
+      mpi.mpi_abort(mpi.petsc_comm_world(), errorCode)
+
     self.cleanup()
     self.petsc.finalize()
     return



More information about the CIG-COMMITS mailing list