Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Verwiebe <info@jensverwiebe.de>2014-03-31 15:51:40 +0400
committerJens Verwiebe <info@jensverwiebe.de>2014-03-31 15:51:49 +0400
commit277fb1a31fc4b0c9691b3bbab43fd1a970d3e575 (patch)
tree14fdf30a1783d0d4b17ca83f4de8b4e0c4276c66 /source/blender/makesrna/intern/rna_scene.c
parente05d35bfaffec69ed4d990f6a90a1b9244970aa4 (diff)
Sculpt/dyntopo: Make the omp threads configurable to overcome performance issues
- autodetect optimal default, which typically avoids HT threads - can store setting in .blend per scene - this does not touch general omp max threads, due i found other areas where the calculations are fitting for huge corecount - Intel notes, some of the older generation processors with HyperThreading would not provide significant performance boost for FPU intensive applications. On those systems you might want to set OMP_NUM_THREADS = total number of cores (not total number of hardware theads).
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 0c70e332053..d1b04bdc1a9 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -43,6 +43,7 @@
#include "BKE_freestyle.h"
#include "BKE_editmesh.h"
#include "BKE_paint.h"
+#include "BKE_scene.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
@@ -680,6 +681,17 @@ static char *rna_RenderSettings_path(PointerRNA *UNUSED(ptr))
return BLI_sprintfN("render");
}
+static void rna_omp_threads_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
+{
+ BKE_scene_omp_threads_update(scene);
+}
+
+static int rna_omp_threads_get(PointerRNA *ptr)
+{
+ Scene *scene = (Scene *)ptr->data;
+ return BKE_scene_num_omp_threads(scene);
+}
+
static int rna_RenderSettings_threads_get(PointerRNA *ptr)
{
RenderData *rd = (RenderData *)ptr->data;
@@ -5088,6 +5100,12 @@ void RNA_def_scene(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
+ 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"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
/* Struct definition */
srna = RNA_def_struct(brna, "Scene", "ID");
RNA_def_struct_ui_text(srna, "Scene",
@@ -5450,6 +5468,17 @@ 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);
+ 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)");
+
+ prop = RNA_def_property(srna, "omp_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");
+
/* Nestled Data */
/* *** Non-Animated *** */
RNA_define_animate_sdna(false);