[cig-commits] r21671 - in short/3D/PyLith/trunk/unittests/libtests: bc feassemble friction materials meshio topology

brad at geodynamics.org brad at geodynamics.org
Thu Mar 28 10:42:54 PDT 2013


Author: brad
Date: 2013-03-28 10:42:54 -0700 (Thu, 28 Mar 2013)
New Revision: 21671

Modified:
   short/3D/PyLith/trunk/unittests/libtests/bc/test_bc.cc
   short/3D/PyLith/trunk/unittests/libtests/feassemble/test_feassemble.cc
   short/3D/PyLith/trunk/unittests/libtests/friction/test_friction.cc
   short/3D/PyLith/trunk/unittests/libtests/materials/test_materials.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/test_meshio.cc
   short/3D/PyLith/trunk/unittests/libtests/topology/test_topology.cc
Log:
Added if/def to turn on/off malloc_dump or warning.

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/test_bc.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/test_bc.cc	2013-03-28 16:33:34 UTC (rev 21670)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/test_bc.cc	2013-03-28 17:42:54 UTC (rev 21671)
@@ -30,6 +30,8 @@
 
 #include <stdlib.h> // USES abort()
 
+#define MALLOC_DUMP
+
 int
 main(int argc,
      char* argv[])
@@ -39,7 +41,9 @@
   try {
     // Initialize PETSc
     PetscErrorCode err = PetscInitialize(&argc, &argv, NULL, NULL);CHKERRQ(err);
+#if defined(MALLOC_DUMP)
     err = PetscOptionsSetValue("-malloc_dump", "");CHKERRQ(err);
+#endif
 
     // Initialize Python (to eliminate need to initialize when
     // parsing units in spatial databases).
@@ -76,6 +80,10 @@
     abort();
   } // catch
 
+#if !defined(MALLOC_DUMP)
+  std::cout << "WARNING -malloc dump is OFF\n" << std::endl;
+#endif
+
   return (result.wasSuccessful() ? 0 : 1);
 } // main
 

Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/test_feassemble.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/test_feassemble.cc	2013-03-28 16:33:34 UTC (rev 21670)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/test_feassemble.cc	2013-03-28 17:42:54 UTC (rev 21671)
@@ -30,6 +30,8 @@
 
 #include <stdlib.h> // USES abort()
 
+#define MALLOC_DUMP
+
 int
 main(int argc,
      char* argv[])
@@ -39,7 +41,9 @@
   try {
     // Initialize PETSc
     PetscErrorCode err = PetscInitialize(&argc, &argv, NULL, NULL);CHKERRQ(err);
+#if defined(MALLOC_DUMP)
     err = PetscOptionsSetValue("-malloc_dump", "");CHKERRQ(err);
+#endif
 
     // Initialize Python (to eliminate need to initialize when
     // parsing units in spatial databases).
@@ -73,6 +77,10 @@
     abort();
   } // catch
 
+#if !defined(MALLOC_DUMP)
+  std::cout << "WARNING -malloc dump is OFF\n" << std::endl;
+#endif
+
   return (result.wasSuccessful() ? 0 : 1);
 } // main
 

Modified: short/3D/PyLith/trunk/unittests/libtests/friction/test_friction.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/friction/test_friction.cc	2013-03-28 16:33:34 UTC (rev 21670)
+++ short/3D/PyLith/trunk/unittests/libtests/friction/test_friction.cc	2013-03-28 17:42:54 UTC (rev 21671)
@@ -30,6 +30,8 @@
 
 #include <stdlib.h> // USES abort()
 
+#define MALLOC_DUMP
+
 int
 main(int argc,
      char* argv[])
@@ -39,7 +41,9 @@
   try {
     // Initialize PETSc
     PetscErrorCode err = PetscInitialize(&argc, &argv, NULL, NULL);CHKERRQ(err);
+#if defined(MALLOC_DUMP)
     err = PetscOptionsSetValue("-malloc_dump", "");CHKERRQ(err);
+#endif
 
     // Initialize Python (to eliminate need to initialize when
     // parsing units in spatial databases).
@@ -73,6 +77,10 @@
     abort();
   } // catch
 
+#if !defined(MALLOC_DUMP)
+  std::cout << "WARNING -malloc dump is OFF\n" << std::endl;
+#endif
+
   return (result.wasSuccessful() ? 0 : 1);
 } // main
 

Modified: short/3D/PyLith/trunk/unittests/libtests/materials/test_materials.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/test_materials.cc	2013-03-28 16:33:34 UTC (rev 21670)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/test_materials.cc	2013-03-28 17:42:54 UTC (rev 21671)
@@ -30,6 +30,8 @@
 
 #include <stdlib.h> // USES abort()
 
+#define MALLOC_DUMP
+
 int
 main(int argc,
      char* argv[])
@@ -39,7 +41,9 @@
   try {
     // Initialize PETSc
     PetscErrorCode err = PetscInitialize(&argc, &argv, NULL, NULL);CHKERRQ(err);
+#if defined(MALLOC_DUMP)
     err = PetscOptionsSetValue("-malloc_dump", "");CHKERRQ(err);
+#endif
 
     // Initialize Python (to eliminate need to initialize when
     // parsing units in spatial databases).
@@ -73,6 +77,10 @@
     abort();
   } // catch
 
+#if !defined(MALLOC_DUMP)
+  std::cout << "WARNING -malloc dump is OFF\n" << std::endl;
+#endif
+
   return (result.wasSuccessful() ? 0 : 1);
 } // main
 

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/test_meshio.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/test_meshio.cc	2013-03-28 16:33:34 UTC (rev 21670)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/test_meshio.cc	2013-03-28 17:42:54 UTC (rev 21671)
@@ -34,6 +34,8 @@
 
 #include "journal/info.h"
 
+#define MALLOC_DUMP
+
 int
 main(int argc,
      char* argv[])
@@ -43,7 +45,9 @@
   try {
     // Initialize PETSc
     PetscErrorCode err = PetscInitialize(&argc, &argv, NULL, NULL);CHKERRQ(err);
+#if defined(MALLOC_DUMP)
     err = PetscOptionsSetValue("-malloc_dump", "");CHKERRQ(err);
+#endif
 
     // Initialize Python
     Py_Initialize();
@@ -80,6 +84,10 @@
     abort();
   } // catch
 
+#if !defined(MALLOC_DUMP)
+  std::cout << "WARNING -malloc dump is OFF\n" << std::endl;
+#endif
+
   return (result.wasSuccessful() ? 0 : 1);
 } // main
 

Modified: short/3D/PyLith/trunk/unittests/libtests/topology/test_topology.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/test_topology.cc	2013-03-28 16:33:34 UTC (rev 21670)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/test_topology.cc	2013-03-28 17:42:54 UTC (rev 21671)
@@ -32,6 +32,8 @@
 
 #include <stdlib.h> // USES abort()
 
+#define MALLOC_DUMP
+
 int
 main(int argc,
      char* argv[])
@@ -41,7 +43,9 @@
   try {
     // Initialize PETSc
     PetscErrorCode err = PetscInitialize(&argc, &argv, NULL, NULL);CHKERRQ(err);
+#if defined(MALLOC_DUMP)
     err = PetscOptionsSetValue("-malloc_dump", "");CHKERRQ(err);
+#endif
 
     // Create event manager and test controller
     CppUnit::TestResult controller;
@@ -69,6 +73,10 @@
     abort();
   } // catch
 
+#if !defined(MALLOC_DUMP)
+  std::cout << "WARNING -malloc dump is OFF\n" << std::endl;
+#endif
+
   return (result.wasSuccessful() ? 0 : 1);
 } // main
 



More information about the CIG-COMMITS mailing list