[cig-commits] r8067 - short/3D/PyLith/trunk/libsrc/feassemble

willic3 at geodynamics.org willic3 at geodynamics.org
Mon Oct 1 10:58:24 PDT 2007


Author: willic3
Date: 2007-10-01 10:58:23 -0700 (Mon, 01 Oct 2007)
New Revision: 8067

Modified:
   short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc
   short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.cc
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.cc
Log:
More PETSc flop logging.



Modified: short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/CellGeometry.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -14,6 +14,8 @@
 
 #include "CellGeometry.hh" // implementation of class methods
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include <iostream> // USES std::cerr
 
 // ----------------------------------------------------------------------
@@ -182,6 +184,7 @@
   (*orientation)[1] =  j2;
   (*orientation)[2] =  j2;
   (*orientation)[3] = -j1;
+  PetscLogFlopsNoCheck(1);
 } // _orient1D
 		
 // ----------------------------------------------------------------------
@@ -248,6 +251,7 @@
   (*orientation)[6] =  r0*wt;
   (*orientation)[7] =  r1*wt;
   (*orientation)[8] =  r2*wt;
+  PetscLogFlopsNoCheck(63);
 } // _orient2D
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryHex3D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -16,6 +16,8 @@
 
 #include "GeometryQuad3D.hh" // USES GeometryQuad3D
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include "pylith/utils/array.hh" // USES double_array
 
 #include <assert.h> // USES assert()
@@ -149,6 +151,7 @@
 		    (*jacobian)[5]*(*jacobian)[6]) +
     (*jacobian)[2]*((*jacobian)[3]*(*jacobian)[7] -
 		    (*jacobian)[4]*(*jacobian)[6]);
+  PetscLogFlopsNoCheck(150);
 } // jacobian
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine2D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -16,6 +16,8 @@
 
 #include "GeometryPoint2D.hh" // USES GeometryPoint
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include "pylith/utils/array.hh" // USES double_array
 
 #include <assert.h> // USES assert()
@@ -78,6 +80,7 @@
   (*jacobian)[1] = y1 - y0;
   *det = sqrt(pow((*jacobian)[0], 2) +
 	      pow((*jacobian)[1], 2));
+  PetscLogFlopsNoCheck(6);
 } // jacobian
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryLine3D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -16,6 +16,8 @@
 
 #include "GeometryPoint3D.hh" // USES GeometryPoint3D
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include "pylith/utils/array.hh" // USES double_array
 
 #include <assert.h> // USES assert()
@@ -82,6 +84,7 @@
   *det = sqrt(pow((*jacobian)[0], 2) +
 	      pow((*jacobian)[1], 2) +
 	      pow((*jacobian)[2], 2));
+  PetscLogFlopsNoCheck(9);
 } // jacobian
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad2D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -16,6 +16,8 @@
 
 #include "GeometryLine2D.hh" // USES GeometryLine2D
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include "pylith/utils/array.hh" // USES double_array
 
 #include <assert.h> // USES assert()
@@ -99,6 +101,7 @@
   *det = 
     (*jacobian)[0]*(*jacobian)[3] - 
     (*jacobian)[1]*(*jacobian)[2];
+  PetscLogFlopsNoCheck(25);
 } // jacobian
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryQuad3D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -16,6 +16,8 @@
 
 #include "GeometryLine3D.hh" // USES GeometryLine3D
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include "pylith/utils/array.hh" // USES double_array
 
 #include <assert.h> // USES assert()
@@ -119,6 +121,7 @@
     (*jacobian)[3]*(*jacobian)[3] +
     (*jacobian)[5]*(*jacobian)[5];
   *det = sqrt(jj00*jj11 - jj01*jj10);
+  PetscLogFlopsNoCheck(50);
 } // jacobian
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryTet3D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -16,6 +16,8 @@
 
 #include "GeometryTri3D.hh" // USES GeometryTri3D
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include "pylith/utils/array.hh" // USES double_array
 
 #include <assert.h> // USES assert()
@@ -103,6 +105,7 @@
 		    (*jacobian)[5]*(*jacobian)[6]) +
     (*jacobian)[2]*((*jacobian)[3]*(*jacobian)[7] -
 		    (*jacobian)[4]*(*jacobian)[6]);
+  PetscLogFlopsNoCheck(23);
 } // jacobian
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri2D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -16,6 +16,8 @@
 
 #include "GeometryLine2D.hh" // USES GeometryLine2D
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include "pylith/utils/array.hh" // USES double_array
 
 #include <assert.h> // USES assert()
@@ -85,6 +87,7 @@
   *det = 
     (*jacobian)[0]*(*jacobian)[3] - 
     (*jacobian)[1]*(*jacobian)[2];
+  PetscLogFlopsNoCheck(7);
 } // jacobian
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/GeometryTri3D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -16,6 +16,8 @@
 
 #include "GeometryLine3D.hh" // USES GeometryLine3D
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include "pylith/utils/array.hh" // USES double_array
 
 #include <assert.h> // USES assert()
@@ -103,6 +105,7 @@
     (*jacobian)[3]*(*jacobian)[3] +
     (*jacobian)[5]*(*jacobian)[5];
   *det = sqrt(jj00*jj11 - jj01*jj10);
+  PetscLogFlopsNoCheck(25);
 } // jacobian
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -16,6 +16,8 @@
 
 #include "pylith/utils/array.hh" // USES double_array
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include <assert.h> // USES assert()
 
 // ----------------------------------------------------------------------
@@ -92,6 +94,7 @@
 	  _basisDerivRef[iQuadPt*_numBasis+iBasis] *
 	  _jacobianInv[iQuadPt];
   } // for
+  PetscLogFlopsNoCheck(_numQuadPts * (1 + _numBasis * 4));
 } // computeGeometry
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -14,6 +14,8 @@
 
 #include "Quadrature1Din2D.hh" // implementation of class methods
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include <assert.h> // USES assert()
 
 // ----------------------------------------------------------------------
@@ -104,6 +106,9 @@
 	    _basisDerivRef[iQuadPt*_numBasis*_cellDim+iBasis*_cellDim+jDim] *
 	    _jacobianInv[iQuadPt*_cellDim*_spaceDim+jDim*_spaceDim+iDim];
   } // for
+  PetscLogFlopsNoCheck(_numQuadPts * (1+_numBasis*_spaceDim*4+
+				      _spaceDim*3 +
+				      _numBasis*_spaceDim*_cellDim*2));
 } // computeGeometry
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -14,6 +14,8 @@
 
 #include "Quadrature1Din3D.hh" // implementation of class methods
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include <assert.h> // USES assert()
 
 // ----------------------------------------------------------------------
@@ -107,6 +109,10 @@
 	    _basisDerivRef[iQuadPt*_numBasis*_cellDim+iBasis*_cellDim+jDim] *
 	    _jacobianInv[iQuadPt*_cellDim*_spaceDim+jDim*_spaceDim+iDim];
   } // for
+  PetscLogFlopsNoCheck(_numQuadPts * (1+_numBasis*_spaceDim*4 +
+				      _spaceDim*3 +
+				      _numBasis*_spaceDim*_cellDim*2));
+
 } // computeGeometry
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -14,6 +14,8 @@
 
 #include "Quadrature2D.hh" // implementation of class methods
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include <assert.h> // USES assert()
 
 // ----------------------------------------------------------------------
@@ -102,7 +104,6 @@
     _jacobianInv[i01] = -_jacobian[i01] / det;
     _jacobianInv[i10] = -_jacobian[i10] / det;
     _jacobianInv[i11] =  _jacobian[i00] / det;
-    PetscLogFlopsNoCheck(_numBasis*2 + _numBasis*_cellDim*_spaceDim*2 + 21);
 
     // Compute derivatives of basis functions with respect to global
     // coordinates
@@ -114,6 +115,9 @@
 	    _basisDerivRef[iQuadPt*_numBasis*_cellDim+iBasis*_cellDim+jDim] *
 	    _jacobianInv[iQuadPt*_cellDim*_spaceDim+jDim*_spaceDim+iDim];
   } // for
+  PetscLogFlopsNoCheck(_numQuadPts*(9 +
+				    _numBasis*_spaceDim*(2 +
+							 _cellDim*4)));
 } // computeGeometry
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -16,6 +16,8 @@
 
 #include <math.h> // USES fabs()
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include <assert.h> // USES assert()
 #include <stdexcept> // USES internal_error
 
@@ -126,6 +128,7 @@
     const double d02 = 
       _jacobian[i00]*_jacobian[i21] - 
       _jacobian[i20]*_jacobian[i01];
+    PetscLogFlopsNoCheck(28 + _numBasis*_spaceDim*(2 + _cellDim*2));
     if (fabs(d01) > _minJacobian) {
       // Jinv00 = 1/d01 * J11
       // Jinv01 = 1/d01 * -J01
@@ -135,17 +138,20 @@
       _jacobianInv[iJ+1] = -_jacobian[i01] / d01; // Jinv01
       _jacobianInv[iJ+3] = -_jacobian[i10] / d01; // Jinv10
       _jacobianInv[iJ+4] =  _jacobian[i00] / d01; // Jinv11
+      PetscLogFlopsNoCheck(6);
       if (fabs(d12) > _minJacobian) {
 	// Jinv02 = 1/d12 -J11
 	// Jinv12 = 1/d12 J10
 	_jacobianInv[iJ+2] = -_jacobian[i11] / d12; // Jinv02
 	_jacobianInv[iJ+5] =  _jacobian[i10] / d12; // Jinv12
+	PetscLogFlopsNoCheck(3);
 	
       } else if (fabs(d02) > _minJacobian) {
 	// Jinv02 = 1/d02 -J01
 	// Jinv12 = 1/d02 J00
 	_jacobianInv[iJ+2] = -_jacobian[i01] / d02; // Jinv02
 	_jacobianInv[iJ+5] =  _jacobian[i00] / d02; // Jinv12
+	PetscLogFlopsNoCheck(3);
       } else {
 	_jacobianInv[iJ+2] = 0.0; // Jinv02
 	_jacobianInv[iJ+5] = 0.0; // Jinv12
@@ -159,11 +165,13 @@
       _jacobianInv[iJ+2] = -_jacobian[i01] / d02; // Jinv02
       _jacobianInv[iJ+3] = -_jacobian[i20] / d02; // Jinv10
       _jacobianInv[iJ+5] =  _jacobian[i00] / d02; // Jinv12
+      PetscLogFlopsNoCheck(6);
       if (fabs(d12) > _minJacobian) {
 	// Jinv01 = 1/d12 J21
 	// Jinv11 = 1/d12 -J20
 	_jacobianInv[iJ+1] = -_jacobian[i21] / d12; // Jinv01
 	_jacobianInv[iJ+4] =  _jacobian[i20] / d12; // Jinv11
+	PetscLogFlopsNoCheck(3);
       } else {
 	_jacobianInv[iJ+1] = 0.0; // Jinv01
 	_jacobianInv[iJ+4] = 0.0; // Jinv11
@@ -179,6 +187,7 @@
       _jacobianInv[iJ+2] = -_jacobian[i11] / d12; // Jinv02
       _jacobianInv[iJ+4] = -_jacobian[i20] / d12; // Jinv11
       _jacobianInv[iJ+5] =  _jacobian[i10] / d12; // Jinv12
+      PetscLogFlopsNoCheck(6);
     } else
       throw std::runtime_error("Could not invert Jacobian.");
 
@@ -192,6 +201,7 @@
 	    _basisDerivRef[iQuadPt*_numBasis*_cellDim + iBasis*_cellDim+jDim] *
 	    _jacobianInv[iQuadPt*_cellDim*_spaceDim+jDim*_spaceDim+iDim];
   } // for
+  PetscLogFlopsNoCheck(_numQuadPts*_numBasis*_spaceDim*_cellDim*2);
 } // computeGeometry
 
 

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.cc	2007-10-01 15:19:05 UTC (rev 8066)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.cc	2007-10-01 17:58:23 UTC (rev 8067)
@@ -14,6 +14,8 @@
 
 #include "Quadrature3D.hh" // implementation of class methods
 
+#include "petsc.h" // USES PetscLogFlopsNoCheck
+
 #include <assert.h> // USES assert()
 
 // ----------------------------------------------------------------------
@@ -143,6 +145,8 @@
 	    _basisDerivRef[iQuadPt*_numBasis*_cellDim+iBasis*_cellDim+jDim] *
 	    _jacobianInv[iQuadPt*_cellDim*_spaceDim+jDim*_spaceDim+iDim];
   } // for
+  PetscLogFlopsNoCheck(_numQuadPts*(47 + _numBasis*_spaceDim*(2 + _cellDim*4)));
+				    
 } // computeGeometry
 
 



More information about the cig-commits mailing list