[Bf-blender-cvs] [eabf79e] master: Get rid of OMP in MOD_build.

Bastien Montagne noreply at git.blender.org
Tue Dec 22 20:14:23 CET 2015


Commit: eabf79e40ad64c1e80c9c52227099e211c6092af
Author: Bastien Montagne
Date:   Tue Dec 22 17:08:52 2015 +0100
Branches: master
https://developer.blender.org/rBeabf79e40ad64c1e80c9c52227099e211c6092af

Get rid of OMP in MOD_build.

Reasons:
  - Only parallelized piece of code gives little local speedup (code block only about 25% quicker even on 1M polys cube).
  - No gain nor loss using new BLI_task system.
  - At 10% of build, parallelized piece of code is only about 5% of total func runtime (run-time explodes as build proportion increases).

See no point in adding (in utmost best optimistic case, in real use-case, when  depsgraph will likely already fire several evaluations in parallel,
speedup would be even smaller) 1% speedup here at the cost of threading complexity...

Note that since later code uses hashes, I don't think it's easy to thread it, so think we can leave with it for now.

===================================================================

M	source/blender/modifiers/intern/MOD_build.c

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c
index 507fad4..a364eef 100644
--- a/source/blender/modifiers/intern/MOD_build.c
+++ b/source/blender/modifiers/intern/MOD_build.c
@@ -106,15 +106,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
 	edgeMap = MEM_mallocN(sizeof(*edgeMap) * numEdge_src, "build modifier edgeMap");
 	faceMap = MEM_mallocN(sizeof(*faceMap) * numPoly_src, "build modifier faceMap");
 
-#pragma omp parallel sections if (numVert_src + numEdge_src + numPoly_src >= BKE_MESH_OMP_LIMIT)
-	{
-#pragma omp section
-		{ range_vn_i(vertMap, numVert_src, 0); }
-#pragma omp section
-		{ range_vn_i(edgeMap, numEdge_src, 0); }
-#pragma omp section
-		{ range_vn_i(faceMap, numPoly_src, 0); }
-	}
+	range_vn_i(vertMap, numVert_src, 0);
+	range_vn_i(edgeMap, numEdge_src, 0);
+	range_vn_i(faceMap, numPoly_src, 0);
 
 	frac = (BKE_scene_frame_get(md->scene) - bmd->start) / bmd->length;
 	CLAMP(frac, 0.0f, 1.0f);




More information about the Bf-blender-cvs mailing list