diff options
author | Jens Verwiebe <info@jensverwiebe.de> | 2014-03-31 15:51:40 +0400 |
---|---|---|
committer | Jens Verwiebe <info@jensverwiebe.de> | 2014-03-31 15:51:49 +0400 |
commit | 277fb1a31fc4b0c9691b3bbab43fd1a970d3e575 (patch) | |
tree | 14fdf30a1783d0d4b17ca83f4de8b4e0c4276c66 /source/blender/blenkernel/intern/scene.c | |
parent | e05d35bfaffec69ed4d990f6a90a1b9244970aa4 (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/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 28cc4305da8..02bc1fcb699 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -638,6 +638,9 @@ 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; + sound_create_scene(sce); /* color management */ @@ -1868,3 +1871,10 @@ int BKE_scene_num_threads(const Scene *scene) return BKE_render_num_threads(&scene->r); } +int BKE_scene_num_omp_threads(const struct Scene *scene) +{ + if (scene->omp_mode == SCE_OMP_AUTO) + return BLI_omp_thread_count(); + else + return scene->omp_num_threads; +} |