tAdded valgrind and cuda-memcheck tests for memory leaks - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
(HTM) git clone git://src.adamsgaard.dk/sphere
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit a2dc863676d9ddd731528d2c330be10b1aec48f2
(DIR) parent bcfb542fb89e6971ab9b34fd4cacf8d2843d505b
(HTM) Author: Anders Damsgaard <adc@geo.au.dk>
Date: Fri, 22 Feb 2013 21:46:41 +0100
Added valgrind and cuda-memcheck tests for memory leaks
Diffstat:
M tests/CMakeLists.txt | 3 +++
A tests/memcheck_tests.py | 27 +++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
t@@ -6,3 +6,6 @@ add_test(io_tests ${PYTHON_EXECUTABLE}
add_test(porosity_tests ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_BINARY_DIR}/porosity_tests.py)
+
+add_test(memory_tests ${PYTHON_EXECUTABLE}
+ ${CMAKE_CURRENT_BINARY_DIR}/memcheck_tests.py)
(DIR) diff --git a/tests/memcheck_tests.py b/tests/memcheck_tests.py
t@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+from pytestutils import *
+
+#### Input/output tests ####
+print("### Memory tests ###")
+
+# Generate data in python
+orig = Spherebin(np = 100, nw = 1, sid = "test-initgrid")
+orig.generateRadii(histogram = False)
+orig.defaultParams()
+orig.initRandomGridPos(g = numpy.zeros(orig.nd))
+orig.initTemporal(current = 0.0, total = 0.0)
+orig.time_total = 2.0*orig.time_dt;
+orig.time_file_dt = orig.time_dt;
+orig.writebin(verbose=False)
+
+# Test C++ routines
+print("Valgrind: C++ routines")
+orig.run(verbose=False, hideinputfile=True, valgrind=True)
+
+
+# Test CUDA routines
+print("cuda-memcheck: CUDA routines")
+orig.run(verbose=False, hideinputfile=True, cudamemcheck=True)
+
+# Remove temporary files
+cleanup(orig)