[SCM] Yet Another Dynamic Engine. Platform for discrete element modeling. branch, master, updated. debian/0.60.1-1-3-g31e3bf7

Anton Gladky gladky.anton at gmail.com
Sun Feb 20 15:54:22 UTC 2011


The following commit has been merged in the master branch:
commit bb6f1c37bc6b2ddb185f6b4e37f11602066bc73f
Author: Anton Gladky <gladky.anton at gmail.com>
Date:   Sun Feb 20 16:45:38 2011 +0100

    Fixes memory leak, https://bugs.launchpad.net/bugs/721107

diff --git a/debian/patches/fix-memory-leak-in-insertionsortcollider.patch b/debian/patches/fix-memory-leak-in-insertionsortcollider.patch
new file mode 100644
index 0000000..2500cbf
--- /dev/null
+++ b/debian/patches/fix-memory-leak-in-insertionsortcollider.patch
@@ -0,0 +1,59 @@
+Description: fixes memory leak in insertionsortcollider
+Author: Sergei Dorofeenko <dorofeenko at icp.ac.ru>, Václav Šmilauer <eu at doxos.eu>
+Bug: https://bugs.launchpad.net/bugs/721107
+Applied-Upstream: http://bazaar.launchpad.net/~yade-dev/yade/0.60/revision/2565
+
+=== modified file 'pkg/common/InsertionSortCollider.cpp'
+--- pkg/common/InsertionSortCollider.cpp	2010-10-13 16:23:08 +0000
++++ pkg/common/InsertionSortCollider.cpp	2011-02-20 13:49:22 +0000
+@@ -92,7 +92,7 @@
+ 		// or the time of scheduled run already came, or we were never scheduled yet
+ 		if(!strideActive) return true;
+ 		if(!newton || (nBins>=1 && !newton->velocityBins)) return true;
+-		if(nBins>=1 && newton->velocityBins->incrementDists_shouldCollide(scene->dt)) return true;
++		if(nBins>=1 && newton->velocityBins->checkSize_incrementDists_shouldCollide(scene)) return true;
+ 		if(nBins<=0){
+ 			if(fastestBodyMaxDist<0){fastestBodyMaxDist=0; return true;}
+ 			fastestBodyMaxDist+=sqrt(newton->maxVelocitySq)*scene->dt;
+
+=== modified file 'pkg/common/VelocityBins.cpp'
+--- pkg/common/VelocityBins.cpp	2010-10-13 16:23:08 +0000
++++ pkg/common/VelocityBins.cpp	2011-02-20 13:49:22 +0000
+@@ -9,8 +9,12 @@
+ #endif
+ CREATE_LOGGER(VelocityBins);
+ 
+-bool VelocityBins::incrementDists_shouldCollide(Real dt){
++bool VelocityBins::checkSize_incrementDists_shouldCollide(const Scene* scene){
++	// number of particles increased, recollision necessary
++	// smaller number of particles is handled in setBins
++	if(bodyBins.size()<scene->bodies->size()) { bodyBins.resize(scene->bodies->size(),/* put new particles to the slowest bin*/ bins.size()-1); return true; }
+ 	int i=0;
++	const Real& dt=scene->dt;
+ 	FOREACH(Bin& bin, bins){
+ 		// NOTE: this mimics the integration scheme of NewtonIntegrator
+ 		// if you use different integration method, it must be changed (or the infrastructure somehow modified to allow for that)
+
+=== modified file 'pkg/common/VelocityBins.hpp'
+--- pkg/common/VelocityBins.hpp	2010-10-13 16:23:08 +0000
++++ pkg/common/VelocityBins.hpp	2011-02-20 13:49:22 +0000
+@@ -23,7 +23,7 @@
+ 	struct Bin{
+ 		Bin(): binMinVelSq(-1), binMaxVelSq(-1), maxDist(0), currDist(0), currMaxVelSq(0), nBodies(0){
+ 			#ifdef YADE_OPENMP
+-				threadMaxVelSq.resize(omp_get_max_threads());
++				threadMaxVelSq.resize(omp_get_max_threads(),0.);
+ 			#endif
+ 		};
+ 		// limits for bin memebrship
+@@ -60,7 +60,8 @@
+ 	void setBins(Scene*, Real currMaxVelSq, Real refSweepLength);
+ 
+ 	// Increment maximum per-bin distances and tell whether some bodies may be	already getting out of the swept bbox (in that case, we need to recompute bounding volumes and run the collider)
+-	bool incrementDists_shouldCollide(Real dt);
++	// Also returns true if number of particles changed, in which case it adjusts internal storage accordingly
++	bool checkSize_incrementDists_shouldCollide(const Scene*);
+ 	
+ 	/* NOTE: following 3 functions are separated because of multi-threaded operation of NewtonIntegrator
+ 	in that case, every thread must have its own per-bin maximum and binVelSqFinalize will assign the
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8c31b5d
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix-memory-leak-in-insertionsortcollider.patch

-- 
Yet Another Dynamic Engine. Platform for discrete element modeling.



More information about the debian-science-commits mailing list