← Back to team overview

yade-dev team mailing list archive

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

 

The following commit has been merged in the master branch:
commit 3d93a61f7a533450f009764e87701a8780811719
Author: Anton Gladky <gladky.anton@xxxxxxxxx>
Date:   Tue Mar 22 12:33:51 2011 +0100

    Deleted patches, aplied by upstream in 0.60.2

diff --git a/debian/patches/fix-forcecontainer-crash-lp724396.patch b/debian/patches/fix-forcecontainer-crash-lp724396.patch
deleted file mode 100644
index daaa258..0000000
--- a/debian/patches/fix-forcecontainer-crash-lp724396.patch
+++ /dev/null
@@ -1,165 +0,0 @@
-Description: fixes crash in forceContainer after adding particles into the simulation
-Author: Sergei Dorofeenko <dorofeenko@xxxxxxxxx>, Václav Šmilauer <eu@xxxxxxxx>, Anton Gladky <gladky.anton@xxxxxxxxx>
-Bug: https://bugs.launchpad.net/bugs/724396
-Applied-Upstream: http://bazaar.launchpad.net/~yade-dev/yade/0.60/revision/2567
-
---- a/core/ForceContainer.hpp
-+++ b/core/ForceContainer.hpp
-@@ -4,7 +4,6 @@
- #include<string.h>
- #include<vector>
- #include<yade/lib-base/Math.hpp>
--// for Body::id_t
- #include<yade/core/Body.hpp>
- 
- #include<boost/static_assert.hpp>
-@@ -52,14 +51,17 @@
- 		std::vector<vvector> _moveData;
- 		std::vector<vvector> _rotData;
- 		vvector _force, _torque, _move, _rot;
-+		std::vector<size_t> sizeOfThreads;
- 		size_t size;
-+		bool syncedSizes;
- 		int nThreads;
- 		bool synced,moveRotUsed;
- 		boost::mutex globalMutex;
-+		Vector3r _zero;
- 
--		inline void ensureSize(Body::id_t id){
-+		inline void ensureSize(Body::id_t id, int threadN){
- 			assert(nThreads>omp_get_thread_num());
--			if (size<=(size_t)id) resize(min((size_t)1.5*(id+100),(size_t)(id+2000)));
-+			if (sizeOfThreads[threadN]<=(size_t)id) resize(min((size_t)1.5*(id+100),(size_t)(id+2000)),threadN);
- 		}
- 
- 		inline void ensureSynced(){ if(!synced) throw runtime_error("ForceContainer not thread-synchronized; call sync() first!"); }
-@@ -74,30 +76,43 @@
- 		// dummy function to avoid template resolution failure
- 		friend class boost::serialization::access; template<class ArchiveT> void serialize(ArchiveT & ar, unsigned int version){}
- 	public:
--		ForceContainer(): size(0), synced(true),moveRotUsed(false),syncCount(0), lastReset(0){
-+		ForceContainer(): size(0),syncedSizes(true),synced(true),moveRotUsed(false),_zero(Vector3r::Zero()),syncCount(0),lastReset(0){
- 			nThreads=omp_get_max_threads();
- 			for(int i=0; i<nThreads; i++){
- 				_forceData.push_back(vvector()); _torqueData.push_back(vvector());
--				_moveData.push_back(vvector()); _rotData.push_back(vvector());
-+				_moveData.push_back(vvector());  _rotData.push_back(vvector());
-+				sizeOfThreads.push_back(0);
- 			}
- 		}
- 
--		const Vector3r& getForce(Body::id_t id)         { ensureSize(id); ensureSynced(); return _force[id]; }
--		void  addForce(Body::id_t id, const Vector3r& f){ ensureSize(id); synced=false;   _forceData[omp_get_thread_num()][id]+=f;}
--		const Vector3r& getTorque(Body::id_t id)        { ensureSize(id); ensureSynced(); return _torque[id]; }
--		void addTorque(Body::id_t id, const Vector3r& t){ ensureSize(id); synced=false;   _torqueData[omp_get_thread_num()][id]+=t;}
--		const Vector3r& getMove(Body::id_t id)          { ensureSize(id); ensureSynced(); return _move[id]; }
--		void  addMove(Body::id_t id, const Vector3r& m) { ensureSize(id); synced=false; moveRotUsed=true; _moveData[omp_get_thread_num()][id]+=m;}
--		const Vector3r& getRot(Body::id_t id)           { ensureSize(id); ensureSynced(); return _rot[id]; }
--		void  addRot(Body::id_t id, const Vector3r& r)  { ensureSize(id); synced=false; moveRotUsed=true; _rotData[omp_get_thread_num()][id]+=r;}
-+		const Vector3r& getForce(Body::id_t id)         { ensureSynced(); return ((size_t)id<size)?_force[id]:_zero; }
-+		void  addForce(Body::id_t id, const Vector3r& f){ ensureSize(id,omp_get_thread_num()); synced=false;   _forceData[omp_get_thread_num()][id]+=f;}
-+		const Vector3r& getTorque(Body::id_t id)        { ensureSynced(); return ((size_t)id<size)?_torque[id]:_zero; }
-+		void addTorque(Body::id_t id, const Vector3r& t){ ensureSize(id,omp_get_thread_num()); synced=false;   _torqueData[omp_get_thread_num()][id]+=t;}
-+		const Vector3r& getMove(Body::id_t id)          { ensureSynced(); return ((size_t)id<size)?_move[id]:_zero; }
-+		void  addMove(Body::id_t id, const Vector3r& m) { ensureSize(id,omp_get_thread_num()); synced=false; moveRotUsed=true; _moveData[omp_get_thread_num()][id]+=m;}
-+		const Vector3r& getRot(Body::id_t id)           { ensureSynced(); return ((size_t)id<size)?_rot[id]:_zero; }
-+		void  addRot(Body::id_t id, const Vector3r& r)  { ensureSize(id,omp_get_thread_num()); synced=false; moveRotUsed=true; _rotData[omp_get_thread_num()][id]+=r;}
- 		/* To be benchmarked: sum thread data in getForce/getTorque upon request for each body individually instead of by the sync() function globally */
- 		// this function is used from python so that running simulation is not slowed down by sync'ing on occasions
- 		// since Vector3r writes are not atomic, it might (rarely) return wrong value, if the computation is running meanwhile
--		Vector3r getForceSingle (Body::id_t id){ ensureSize(id); Vector3r ret(Vector3r::Zero()); for(int t=0; t<nThreads; t++){ ret+=_forceData [t][id]; } return ret; }
--		Vector3r getTorqueSingle(Body::id_t id){ ensureSize(id); Vector3r ret(Vector3r::Zero()); for(int t=0; t<nThreads; t++){ ret+=_torqueData[t][id]; } return ret; }
--		Vector3r getMoveSingle  (Body::id_t id){ ensureSize(id); Vector3r ret(Vector3r::Zero()); for(int t=0; t<nThreads; t++){ ret+=_moveData  [t][id]; } return ret; }
--		Vector3r getRotSingle   (Body::id_t id){ ensureSize(id); Vector3r ret(Vector3r::Zero()); for(int t=0; t<nThreads; t++){ ret+=_rotData   [t][id]; } return ret; }
--
-+		Vector3r getForceSingle (Body::id_t id){ Vector3r ret(Vector3r::Zero()); for(int t=0; t<nThreads; t++){ ret+=((size_t)id<sizeOfThreads[t])?_forceData [t][id]:_zero; } return ret; }
-+		Vector3r getTorqueSingle(Body::id_t id){ Vector3r ret(Vector3r::Zero()); for(int t=0; t<nThreads; t++){ ret+=((size_t)id<sizeOfThreads[t])?_torqueData[t][id]:_zero; } return ret; }
-+		Vector3r getMoveSingle  (Body::id_t id){ Vector3r ret(Vector3r::Zero()); for(int t=0; t<nThreads; t++){ ret+=((size_t)id<sizeOfThreads[t])?_moveData  [t][id]:_zero; } return ret; }
-+		Vector3r getRotSingle   (Body::id_t id){ Vector3r ret(Vector3r::Zero()); for(int t=0; t<nThreads; t++){ ret+=((size_t)id<sizeOfThreads[t])?_rotData   [t][id]:_zero; } return ret; }
-+		
-+		inline void syncSizesOfContainers() {
-+			if (syncedSizes) return;
-+			//check whether all containers have equal length, and if not resize it
-+			for(int i=0; i<nThreads; i++){
-+				if (sizeOfThreads[i]<size) resize(size,i);
-+			}
-+			_force.resize(size,Vector3r::Zero());
-+			_torque.resize(size,Vector3r::Zero());
-+			_move.resize(size,Vector3r::Zero());
-+			_rot.resize(size,Vector3r::Zero());
-+			syncedSizes=true;
-+		}
- 		/* Sum contributions from all threads, save to _force&_torque.
- 		 * Locks globalMutex, since one thread modifies common data (_force&_torque).
- 		 * Must be called before get* methods are used. Exception is thrown otherwise, since data are not consistent. */
-@@ -105,7 +120,9 @@
- 			if(synced) return;
- 			boost::mutex::scoped_lock lock(globalMutex);
- 			if(synced) return; // if synced meanwhile
--			// #pragma omp parallel for schedule(static)
-+
-+			syncSizesOfContainers();
-+
- 			for(long id=0; id<(long)size; id++){
- 				Vector3r sumF(Vector3r::Zero()), sumT(Vector3r::Zero());
- 				for(int thread=0; thread<nThreads; thread++){ sumF+=_forceData[thread][id]; sumT+=_torqueData[thread][id];}
-@@ -123,31 +140,24 @@
- 		unsigned long syncCount;
- 		long lastReset;
- 
--		/* Change size of containers (number of bodies).
--		 * Locks globalMutex, since on threads modifies other threads' data.
--		 * Called very rarely (a few times at the beginning of the simulation). */
--		void resize(size_t newSize){
--			boost::mutex::scoped_lock lock(globalMutex);
--			if(size>=newSize) return; // in case on thread was waiting for resize, but it was already satisfied by another one
--			for(int thread=0; thread<nThreads; thread++){
--				_forceData [thread].resize(newSize,Vector3r::Zero());
--				_torqueData[thread].resize(newSize,Vector3r::Zero());
--				_moveData[thread].resize(newSize,Vector3r::Zero());
--				_rotData[thread].resize(newSize,Vector3r::Zero());
--			}
--			_force.resize(newSize,Vector3r::Zero()); _torque.resize(newSize,Vector3r::Zero());
--			_move.resize(newSize,Vector3r::Zero()); _rot.resize(newSize,Vector3r::Zero());
--			size=newSize;
-+		void resize(size_t newSize, int threadN){
-+			_forceData [threadN].resize(newSize,Vector3r::Zero());
-+			_torqueData[threadN].resize(newSize,Vector3r::Zero());
-+			_moveData[threadN].resize(newSize,Vector3r::Zero());
-+			_rotData[threadN].resize(newSize,Vector3r::Zero());
-+			sizeOfThreads[threadN] = newSize;
-+			if (size<newSize) size=newSize;
-+			syncedSizes=false;
- 		}
- 		/*! Reset all data, also reset summary forces/torques and mark the container clean. */
- 		// perhaps should be private and friend Scene or whatever the only caller should be
- 		void reset(long iter){
- 			for(int thread=0; thread<nThreads; thread++){
--				memset(&_forceData [thread][0],0,sizeof(Vector3r)*size);
--				memset(&_torqueData[thread][0],0,sizeof(Vector3r)*size);
-+				memset(&_forceData [thread][0],0,sizeof(Vector3r)*sizeOfThreads[thread]);
-+				memset(&_torqueData[thread][0],0,sizeof(Vector3r)*sizeOfThreads[thread]);
- 				if(moveRotUsed){
--					memset(&_moveData  [thread][0],0,sizeof(Vector3r)*size);
--					memset(&_rotData   [thread][0],0,sizeof(Vector3r)*size);
-+					memset(&_moveData  [thread][0],0,sizeof(Vector3r)*sizeOfThreads[thread]);
-+					memset(&_rotData   [thread][0],0,sizeof(Vector3r)*sizeOfThreads[thread]);
- 				}
- 			}
- 			memset(&_force [0], 0,sizeof(Vector3r)*size);
-@@ -226,5 +236,4 @@
- 		const bool& getMoveRotUsed() const {return moveRotUsed;}
- };
- 
--
- #endif
---- a/core/Scene.cpp
-+++ b/core/Scene.cpp
-@@ -70,7 +70,6 @@
- 	if(needsInitializers){
- 		checkStateTypes();
- 		FOREACH(shared_ptr<Engine> e, initializers){ e->scene=this; if(e->dead || !e->isActivated()) continue; e->action(); } 
--		forces.resize(bodies->size());
- 		needsInitializers=false;
- 	}
- 	if(!subStepping && subStep<0){
diff --git a/debian/patches/fix-memory-leak-in-InsertionSortCollider-lp721107.patch b/debian/patches/fix-memory-leak-in-InsertionSortCollider-lp721107.patch
deleted file mode 100644
index cfe3078..0000000
--- a/debian/patches/fix-memory-leak-in-InsertionSortCollider-lp721107.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Description: fixes memory leak in insertionsortcollider
-Author: Sergei Dorofeenko <dorofeenko@xxxxxxxxx>, Václav Šmilauer <eu@xxxxxxxx>
-Bug: https://bugs.launchpad.net/bugs/721107
-Applied-Upstream: http://bazaar.launchpad.net/~yade-dev/yade/0.60/revision/2565
-
---- a/pkg/common/InsertionSortCollider.cpp
-+++ b/pkg/common/InsertionSortCollider.cpp
-@@ -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;
---- a/pkg/common/VelocityBins.cpp
-+++ b/pkg/common/VelocityBins.cpp
-@@ -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)
---- a/pkg/common/VelocityBins.hpp
-+++ b/pkg/common/VelocityBins.hpp
-@@ -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
index 0618eb2..e69de29 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +0,0 @@
-fix-memory-leak-in-InsertionSortCollider-lp721107.patch
-vtkNetCDF-is-deleted-from-libs.patch
-fix-forcecontainer-crash-lp724396.patch
diff --git a/debian/patches/vtkNetCDF-is-deleted-from-libs.patch b/debian/patches/vtkNetCDF-is-deleted-from-libs.patch
deleted file mode 100644
index 43f41b3..0000000
--- a/debian/patches/vtkNetCDF-is-deleted-from-libs.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Description: vtkNetCDF was deleted from libs due to absence in libvtk5.6-dev. Seems, functionality is not corrupted.
-Author: Anton Gladky <gladky.anton@xxxxxxxxx>
-Applied-Upstream: http://bazaar.launchpad.net/~yade-dev/yade/0.60/revision/2566
-
---- a/SConstruct
-+++ b/SConstruct
-@@ -377,7 +377,7 @@
- 			else: featureNotOK('qt4','Building with Qt4 implies the QGLViewer library installed (package libqglviewer-qt4-dev package in debian/ubuntu, libQGLViewer in RPM-based distributions)')
- 	if 'vtk' in env['features']:
- 		ok=conf.CheckLibWithHeader(['vtkCommon'],'vtkInstantiator.h','c++','vtkInstantiator::New();',autoadd=1)
--		env.Append(LIBS=['vtkHybrid','vtkFiltering','vtkRendering','vtkIO','vtkexoIIc','vtkParallel','vtkGraphics','vtkverdict','vtkImaging','vtkftgl','vtkDICOMParser','vtkmetaio','vtksqlite','vtkNetCDF'])
-+		env.Append(LIBS=['vtkHybrid','vtkFiltering','vtkRendering','vtkIO','vtkexoIIc','vtkParallel','vtkGraphics','vtkverdict','vtkImaging','vtkftgl','vtkDICOMParser','vtkmetaio','vtksqlite'])
- 		if not ok: featureNotOK('vtk',note="Installer can`t find vtk-library. Be sure you have it installed (usually, libvtk5-dev package). Or you might have to add VTK header directory (e.g. /usr/include/vtk-5.4) to CPPPATH.")
- 	if 'gts' in env['features']:
- 		env.ParseConfig('pkg-config gts --cflags --libs');

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