Changes to openmp threads commit (UI and RNA)
authorCampbell Barton <ideasman42@gmail.com>
Mon, 31 Mar 2014 21:30:24 +0000 (08:30 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 31 Mar 2014 21:30:24 +0000 (08:30 +1100)
- use same names as render threads
- remove OpenMP from UI
- remove details from tips

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

index 70ebf6aac79c1582d164ec73837f0c397042cc1a..7b1055758e0df8ac8d336bec277a7c16b14dced1 100644 (file)
@@ -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")
index 02bc1fcb699a0f98fdba7972861db2f6700b781c..e501010fc56aa3682c9e143eadfd82799f0e1695 100644 (file)
@@ -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;
 }
index 32c6f108ac434e9d5420e416eef6f0aaf44a95fe..441ce0f29b6d84336dd46be633d55be945d70005 100644 (file)
@@ -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
index d135ae6a9627e95a74c53824a2e3e90cdd619dbd..0c950ff9ff0f5464535b9d28302ceaa5c0f1f3e1 100644 (file)
@@ -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
 }
index b374e9552be27cf40a0b00f9ae65628103fbd793..d15e9dc344177cb3546fc1696817f96bdd132da1 100644 (file)
@@ -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");