← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3470: Fix runtime error in debug mode and without openmp.

 

------------------------------------------------------------
revno: 3470
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Tue 2014-10-14 17:52:06 +0200
message:
  Fix runtime error in debug mode and without openmp.
  
  See:
  https://answers.launchpad.net/yade/+question/255699
modified:
  pkg/common/Dispatching.cpp
  pkg/pfv/FlowEngine.ipp.in


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'pkg/common/Dispatching.cpp'
--- pkg/common/Dispatching.cpp	2014-07-04 17:46:32 +0000
+++ pkg/common/Dispatching.cpp	2014-10-14 15:52:06 +0000
@@ -17,7 +17,9 @@
 	updateScenePtr();
 	shared_ptr<BodyContainer>& bodies = scene->bodies;
 	const long numBodies=(long)bodies->size();
+	#ifdef YADE_OPENMP
 	#pragma omp parallel for num_threads(ompThreads>0 ? min(ompThreads,omp_get_max_threads()) : omp_get_max_threads())
+	#endif
 	for(int id=0; id<numBodies; id++){
 		if(!bodies->exists(id)) continue; // don't delete this check  - Janek
 		const shared_ptr<Body>& b=(*bodies)[id];

=== modified file 'pkg/pfv/FlowEngine.ipp.in'
--- pkg/pfv/FlowEngine.ipp.in	2014-10-07 18:41:54 +0000
+++ pkg/pfv/FlowEngine.ipp.in	2014-10-14 15:52:06 +0000
@@ -44,8 +44,9 @@
 	  backgroundSolver=solver;
 	  backgroundCompleted=true;
 	}
+  #ifdef YADE_OPENMP
 	solver->ompThreads = ompThreads>0? ompThreads : omp_get_max_threads();
-
+  #endif
         timingDeltas->checkpoint ( "Triangulating" );
 	updateVolumes ( *solver );
         timingDeltas->checkpoint ( "Update_Volumes" );