Changes to openmp threads commit (UI and RNA)

- use same names as render threads
- remove OpenMP from UI
- remove details from tips
This commit is contained in:
Campbell Barton 2014-04-01 08:30:24 +11:00
parent 42fca2f145
commit d25ba1eccd
5 changed files with 24 additions and 24 deletions

View 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")

View 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;
}

View 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

View 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
}

View 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");