[Bf-blender-cvs] [d25ba1e] master: Changes to openmp threads commit (UI and RNA)

Campbell Barton noreply at git.blender.org
Mon Mar 31 23:32:19 CEST 2014


Commit: d25ba1eccdc7043c8f470991683dbc3cef93156e
Author: Campbell Barton
Date:   Tue Apr 1 08:30:24 2014 +1100
https://developer.blender.org/rBd25ba1eccdc7043c8f470991683dbc3cef93156e

Changes to openmp threads commit (UI and RNA)

- use same names as render threads
- remove OpenMP from UI
- remove details from tips

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

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/blenkernel/intern/scene.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 70ebf6a..7b10557 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1284,7 +1284,7 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
     def draw(self, context):
         layout = self.layout
         scene = context.scene
-		
+
         toolsettings = context.tool_settings
         sculpt = toolsettings.sculpt
         capabilities = sculpt.brush.sculpt_capabilities
@@ -1294,13 +1294,13 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
         col.label(text="Gravity:")
         col.prop(sculpt, "gravity", slider=True, text="Factor")
         col.prop(sculpt, "gravity_object")
-		
+
         col.separator()
-        col.label(text="OpenMP Threads:")
-        col.row(align=True).prop(scene, "omp_mode", expand=True)
+        col.label(text="Threads:")
+        col.row(align=True).prop(scene, "omp_threads_mode", expand=True)
         sub = col.column(align=True)
-        sub.enabled = scene.omp_mode == 'MANUAL'
-        sub.prop(scene, "omp_num_threads")
+        sub.enabled = (scene.omp_threads_mode != 'AUTO')
+        sub.prop(scene, "omp_threads")
         col.separator()
 
         layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 02bc1fc..e501010 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -638,8 +638,8 @@ Scene *BKE_scene_add(Main *bmain, const char *name)
 
 	sce->gm.exitkey = 218; // Blender key code for ESC
 
-	sce->omp_mode = SCE_OMP_AUTO;
-	sce->omp_num_threads = 1;
+	sce->omp_threads_mode = SCE_OMP_AUTO;
+	sce->omp_threads = 1;
 
 	sound_create_scene(sce);
 
@@ -1873,8 +1873,8 @@ int BKE_scene_num_threads(const Scene *scene)
 
 int BKE_scene_num_omp_threads(const struct Scene *scene)
 {
-	if (scene->omp_mode == SCE_OMP_AUTO)
+	if (scene->omp_threads_mode == SCE_OMP_AUTO)
 		return BLI_omp_thread_count();
 	else
-		return scene->omp_num_threads;
+		return scene->omp_threads;
 }
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 32c6f10..441ce0f 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -3787,6 +3787,7 @@ static void sculpt_omp_start(Scene *scene, Sculpt *sd, SculptSession *ss)
 	}
 	omp_set_num_threads(cache->num_threads);  /* set user-defined corecount wich is physical cores when "AUTO" ( atm. OSX-only )*/
 #else
+	(void)scene;
 	(void)sd;
 	cache->num_threads = 1;
 #endif
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index d135ae6..0c950ff 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1165,8 +1165,13 @@ typedef struct Scene {
 	
 	short flag;								/* various settings */
 	
-	short use_nodes;
-	
+	char use_nodes;
+
+	/* Openmp Global Settings */
+	char  omp_threads_mode;
+	short omp_threads;
+	char pad[6];
+
 	struct bNodeTree *nodetree;
 	
 	struct Editing *ed;								/* sequence editor data is allocated here */
@@ -1224,13 +1229,8 @@ typedef struct Scene {
 	
 	/* RigidBody simulation world+settings */
 	struct RigidBodyWorld *rigidbody_world;
-
-	/* Openmp Global Settings */
-	int omp_num_threads;
-	int omp_mode;
 } Scene;
 
-
 /* **************** RENDERDATA ********************* */
 
 /* flag */
@@ -1775,7 +1775,7 @@ typedef enum SculptFlags {
 
 /* OpenMP settings */
 #define SCE_OMP_AUTO 0
-#define SCE_OMP_MANUAL 1
+#define SCE_OMP_FIXED 1
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index b374e95..d15e9dc 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -5096,8 +5096,8 @@ void RNA_def_scene(BlenderRNA *brna)
 	};
 
 	static EnumPropertyItem omp_threads_mode_items[] = {
-		{SCE_OMP_AUTO, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
-		{SCE_OMP_MANUAL, "MANUAL", 0, "Manual", "Manually determine the number of threads"},
+		{SCE_OMP_AUTO, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads"},
+		{SCE_OMP_FIXED, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
 		{0, NULL, 0, NULL, NULL}
 	};
 
@@ -5463,14 +5463,13 @@ void RNA_def_scene(BlenderRNA *brna)
 	RNA_def_property_struct_type(prop, "ColorManagedSequencerColorspaceSettings");
 	RNA_def_property_ui_text(prop, "Sequencer Color Space Settings", "Settings of color space sequencer is working in");
 
-	prop = RNA_def_property(srna, "omp_num_threads", PROP_INT, PROP_NONE);
+	prop = RNA_def_property(srna, "omp_threads", PROP_INT, PROP_NONE);
 	RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
 	RNA_def_property_int_funcs(prop, "rna_omp_threads_get", NULL, NULL);
 	RNA_def_property_ui_text(prop, "OpenMP Threads",
-							 "Number of CPU threads to use simultaneously for openmp"
-							 "(for multi-core/CPU systems)");
+	                         "Number of CPU threads to use for openmp");
 
-	prop = RNA_def_property(srna, "omp_mode", PROP_ENUM, PROP_NONE);
+	prop = RNA_def_property(srna, "omp_threads_mode", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_items(prop, omp_threads_mode_items);
 	RNA_def_property_ui_text(prop, "OpenMP Mode", "Determine the amount of openmp threads used");




More information about the Bf-blender-cvs mailing list