Fluid threads: re-add an erratically forgotten line, fix typo, set default threadcoun...
authorJens Verwiebe <info@jensverwiebe.de>
Wed, 10 Apr 2013 23:19:57 +0000 (23:19 +0000)
committerJens Verwiebe <info@jensverwiebe.de>
Wed, 10 Apr 2013 23:19:57 +0000 (23:19 +0000)
intern/elbeem/intern/simulation_object.cpp
source/blender/modifiers/intern/MOD_fluidsim_util.c

index 4227351f9888b039900507b2b91b45e8ac03a7c5..d89b28bbf7a8920b9737e56b2ec29f5c4f1d482c 100644 (file)
@@ -73,7 +73,7 @@ SimulationObject::~SimulationObject()
        debMsgStd("SimulationObject",DM_MSG,"El'Beem Done!\n",10);
 #if PARALLEL==1
        omp_set_num_threads(omp_threadcache);
-       printf("Resetting omp_threads to cached vakue %d \n", omp_threadcache);
+       printf("Resetting omp_threads to cached value %d \n", omp_threadcache);
 #endif
 }
 
@@ -185,6 +185,7 @@ int SimulationObject::initializeLbmSimulation(ntlRenderGlobals *glob)
                mpLbm->setSmoothing(1.0 * mpElbeemSettings->surfaceSmoothing, 1.0 * mpElbeemSettings->surfaceSmoothing);
                mpLbm->setIsoSubdivs(mpElbeemSettings->surfaceSubdivs);
 #if PARALLEL==1
+               omp_threadcache = omp_get_max_threads();
                omp_set_num_threads(mpElbeemSettings->threads);
                printf("Setting omp_threads to usersetting %d \n", mpElbeemSettings->threads);
 #endif
index 6afe121be904d0cd2bf600d9cd66aad300219f1b..ed42a30b3512f11b70bb5a816b47d6a5009e30e9 100644 (file)
@@ -46,6 +46,7 @@
 #include "BLI_blenlib.h"
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
+#include "BLI_threads.h"
 
 #include "BKE_main.h"
 #include "BKE_fluidsim.h" /* ensure definitions here match */
@@ -75,7 +76,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
                
                fss->fmd = fluidmd;
                fss->type = OB_FLUIDSIM_ENABLE;
-               fss->threads = 4;
+               fss->threads = BLI_system_thread_count();
                fss->show_advancedoptions = 0;
 
                fss->resolutionxyz = 65;