[cig-commits] r7649 - in short/3D/PyLith/trunk/playpen: . memcheck
brad at geodynamics.org
brad at geodynamics.org
Thu Jul 12 11:33:56 PDT 2007
Author: brad
Date: 2007-07-12 11:33:54 -0700 (Thu, 12 Jul 2007)
New Revision: 7649
Added:
short/3D/PyLith/trunk/playpen/memcheck/
short/3D/PyLith/trunk/playpen/memcheck/configure.ac
short/3D/PyLith/trunk/playpen/memcheck/runtet4.cc
Log:
Creating memcheck to try to get better memory profiling.
Property changes on: short/3D/PyLith/trunk/playpen/memcheck
___________________________________________________________________
Name: svn:externals
+ m4 http://geodynamics.org/svn/cig/cs/autoconf/trunk
Added: short/3D/PyLith/trunk/playpen/memcheck/configure.ac
===================================================================
--- short/3D/PyLith/trunk/playpen/memcheck/configure.ac 2007-07-12 18:11:51 UTC (rev 7648)
+++ short/3D/PyLith/trunk/playpen/memcheck/configure.ac 2007-07-12 18:33:54 UTC (rev 7649)
@@ -0,0 +1,111 @@
+# -*- autoconf -*-
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.59)
+AC_INIT([PyLith], [1.0.1], [cig-short at geodynamics.org])
+AC_CONFIG_AUX_DIR([./aux-config])
+AC_CONFIG_HEADER([portinfo])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([foreign])
+
+# ----------------------------------------------------------------------
+# CUBIT I/O w/netcdf
+AC_ARG_ENABLE([cubit],
+ [AC_HELP_STRING([--enable-cubit],
+ [enable reading/writing Cubit EXODUS files (requires netcdf) @<:@default=no@:>@])],
+ [enable_cubit=yes
+ CXXFLAGS="-DENABLE_CUBIT $CXXFLAGS"; export CXXFLAGS],
+ [enable_cubit=no])
+AM_CONDITIONAL([ENABLE_CUBIT], [test "$enable_cubit" = yes])
+
+# ----------------------------------------------------------------------
+# C/C++/libtool/install
+AC_PROG_CXX
+AC_PROG_CC
+AC_DISABLE_STATIC
+
+AC_PROG_LIBTOOL
+if test "$allow_undefined_flag" = unsupported; then
+ # See issue119.
+ AM_LDFLAGS="-no-undefined $AM_LDFLAGS"
+fi
+AM_CONDITIONAL([NO_UNDEFINED], [test "$allow_undefined_flag" = unsupported])
+AC_SUBST(AM_LDFLAGS)
+
+AC_PROG_INSTALL
+
+# MPI
+AC_LANG(C++)
+#CIT_PROG_MPICXX
+#CIT_HEADER_MPI
+#CIT_CHECK_LIB_MPI
+
+# PETSC
+CIT_PATH_PETSC([2.3.3])
+CIT_HEADER_PETSC
+CIT_CHECK_LIB_PETSC
+CIT_CHECK_LIB_PETSC_SIEVE
+
+# Check for Python modules and packages.
+CIT_PYTHON_EGG_SETUP
+
+# CUBIT (netcdf)
+if test "$enable_cubit" = "yes" ; then
+ AC_LANG(C++)
+ AC_CHECK_HEADER([netcdfcpp.h], [], [
+ AC_MSG_ERROR([netcdf C++ header not found; try CPPFLAGS="-I<netcdf include dir>"])
+ ])
+ AC_MSG_CHECKING([for NcFile in -lnetcdfc++])
+ AC_REQUIRE_CPP
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <netcdfcpp.h>]],
+ [[NcFile ncfile("filename");]])],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+ AC_MSG_ERROR([netcdfc++ library not found; try LDFLAGS="-L<netcdf lib dir>"])
+ ])
+fi
+
+# PROJ4
+AC_CHECK_LIB(proj, pj_init_plus, [
+ AC_CHECK_HEADER([proj_api.h], [], [
+ AC_MSG_ERROR([Proj4 header not found; try CPPFLAGS="-I<Proj4 include dir>"])
+ ])
+],[
+ AC_MSG_ERROR([Proj4 library not found; try LDFLAGS="-L<Proj4 lib dir>"])
+])
+
+# SPATIALDATA
+AC_LANG(C++)
+AC_CHECK_HEADER([spatialdata/spatialdb/SpatialDB.hh], [], [
+ AC_MSG_ERROR([SpatialDB header not found; try CPPFLAGS="-I<Spatialdata include dir>"])
+])
+AC_MSG_CHECKING([for spatialdb::SimpleDB in -lspatialdata])
+AC_REQUIRE_CPP
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <spatialdata/spatialdb/SpatialDB.hh>]
+ [#include <spatialdata/spatialdb/SimpleDB.hh>]],
+ [[spatialdata::spatialdb::SimpleDB db;]])],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+ AC_MSG_ERROR([Spatialdata library not found; try LDFLAGS="-L<Spatialdata lib dir>"])
+])
+
+# ENDIANNESS
+AC_C_BIGENDIAN
+
+# ----------------------------------------------------------------------
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
+
+dnl end of configure.ac
Added: short/3D/PyLith/trunk/playpen/memcheck/runtet4.cc
===================================================================
--- short/3D/PyLith/trunk/playpen/memcheck/runtet4.cc 2007-07-12 18:11:51 UTC (rev 7648)
+++ short/3D/PyLith/trunk/playpen/memcheck/runtet4.cc 2007-07-12 18:33:54 UTC (rev 7649)
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include <petsc.h>
+#include <Python.h>
+
+#include "pylith/meshio/MeshIOLagrit.hh"
+#include "pylith/utils/sievetypes.hh" // USES PETSc Mesh
+#include "pylith/utils/array.hh" // USES int_array
+
+int
+main(int argc,
+ char** argv)
+{ // main
+ try {
+ // Initialize PETSc
+ PetscErrorCode err = PetscInitialize(&argc, &argv, PETSC_NULL, PETSC_NULL);
+ CHKERRQ(err);
+
+ // Initialize Python
+ Py_Initialize();
+
+ const char* filenameGmv = "strikeslip_tet4_1000m.gmv";
+ const char* filenamePset = "strikeslip_tet4_1000m.pset";
+
+ pylith::meshio::MeshIOLagrit iohandler;
+ iohandler.filenameGmv(filenameGmv);
+ iohandler.filenamePset(filenamePset);
+ ALE::Obj<Mesh> mesh;
+ iohandler.read(&mesh);
+
+ // Finalize Python
+ Py_Finalize();
+
+ // Finalize PETSc
+ err = PetscFinalize();
+ CHKERRQ(err);
+ } catch (...) {
+ abort();
+ } // catch
+
+ return 0;
+} // main
+
+
+// End of file
More information about the cig-commits
mailing list