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
AgeCommit message (Collapse)Author
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-15Cleanup: comment line length (blenlib)Campbell Barton
Prevents clang-format wrapping text before comments.
2018-12-12Merge branch 'master' into blender2.8Campbell Barton
2018-12-12Cleanup: use colon separator after parameterCampbell Barton
Helps separate variable names from descriptive text. Was already used in some parts of the code, double space and dashes were used elsewhere.
2018-12-04BLI_task: fix queue in work_and_wait, and support resetting.Alexander Gavrilov
To make the pool more usable for running multiple stages of tasks, fix local queue handling in BLI_task_pool_work_and_wait. Specifically, after the wait loop the local queue should be empty, or the wait part of the function contract isn't fulfilled. Instead, check and run any tasks in queue before the wait loop. Also, add a new function that resets the suspended state of the pool.
2018-12-04Merge branch 'master' into blender2.8Sergey Sharybin
2018-12-04Cleanup: SpellingSergey Sharybin
2018-11-20Merge branch 'master' into blender2.8Sergey Sharybin
2018-11-20Task scheduler: Optimize parallel loop over listsSergey Sharybin
The goal is to address performance regression when going from few threads to 10s of threads. On a systems with more than 32 CPU threads the benefit of threaded loop was actually harmful. There are following tweaks now: - The chunk size is adaptive for the number of threads, which minimizes scheduling overhead. - The number of tasks is adaptive to the list size and chunk size. Here comes performance comparison on the production shot: Number of threads DEG time before DEG time after 44 0.09 0.02 32 0.055 0.025 16 0.025 0.025 8 0.035 0.033
2018-11-08Cleanup, spellingSergey Sharybin
2018-09-02Cleanup: comment blocksCampbell Barton
2018-09-02Cleanup: comment blocksCampbell Barton
2018-03-13Cleanup: doxygen commentsCampbell Barton
2018-02-15Cleanup: rename BLI_thread.h APICampbell Barton
- Use BLI_threadpool_ prefix for (deprecated) thread/listbase API. - Use BLI_thread as prefix for other functions. See P614 to apply instead of manually resolving conflicts.
2018-02-15Cleanup: use '_len' instead of '_size' w/ BLI APICampbell Barton
- When returning the number of items in a collection use BLI_*_len() - Keep _size() for size in bytes. - Keep _count() for data structures that don't store length (hint this isn't a simple getter). See P611 to apply instead of manually resolving conflicts.
2018-01-11Cleanup typo in comment.Bastien Montagne
2018-01-10Task scheduler: Use more const qualifiersSergey Sharybin
2018-01-09Task scheduler: Use single thread branch when range fits into single chunkSergey Sharybin
2018-01-09Task scheduler: Fix wrong tasks calculation when chunk size is too bigSergey Sharybin
2018-01-09Task scheduler: Use const qualifiers in parallel rangeSergey Sharybin
2018-01-09Task scheduler: Avoid over-allocation of tasks for parallel rangesSergey Sharybin
This seems to only cause extra rthreading overhead on systems with 10s of threads, without actually solving anything.
2018-01-09Task scheduler: Add minimum number of iterations per thread in parallel rangeSergey Sharybin
The idea is to support following: allow doing parallel for on a small range, each iteration of which takes lots of compute power, but limit such range to a subset of threads. For example, on a machine with 44 threads we can occupy 4 threads to handle range of 64 elements, 16 elements per thread, where each block of 16 elements is very complex to compute. The idea should be to use this setting instead of global use_threading flag, which is only based on size of array. Proper use of the new flag will improve threadability. This commit only contains internal task scheduler changes, this setting is not used yet by any areas.
2018-01-09Task scheduler: Simplify parallel range functionSergey Sharybin
Basically, split it up and avoid extra abstraction level.
2018-01-09Task scheduler: Use single parallel range function with more flexible functionSergey Sharybin
Now all the fine-tuning is happening using parallel range settings structure, which avoid passing long lists of arguments, allows extend fine-tuning further, avoid having lots of various functions which basically does the same thing.
2018-01-09Task scheduler: Get rid of extended version of parallel range callbackSergey Sharybin
Wrap all arguments into TLS type of argument. Avoids some branching and also makes it easier to extend things in the future.
2017-12-22Task scheduler: Clarify why do we need an atomic add of 0Sergey Sharybin
2017-12-22Task scheduler: Start with suspended pool to avoid threading overhead on pushSergey Sharybin
The idea is to avoid any threading overhead when we start pushing tasks in a loop. Similarly to how we do it from the new dependency graph. Gives couple of percent of speedup here, but also improves scalability.
2017-11-23Add a new parallel looper for MemPool items to BLI_task.Bastien Montagne
It merely uses the new thread-safe iterators system of mempool, quite straight forward. Note that to avoid possible confusion with two void pointers as parameters of the callback, a dummy opaque struct pointer is used instead for the second parameter (pointer generated by iteration over mempool), callback functions must explicitely convert it to expected real type. Also added a basic gtest for this new feature.
2017-11-23Cleanup: use signed atomic ops when needed.Bastien Montagne
2017-06-12Cleanup: indentation, long linesCampbell Barton
2017-05-31Task scheduler: Optimize subsequent pushing bunch of tasksSergey Sharybin
The idea is to accumulate all new tasks in a thread local queue first without doing any thread synchronization (aka, locks and conditional variables) and move those tasks to a scheduler queue once they are all ready. This way we avoid per-task-pool lock and only have one lock per bunch of tasks. This is particularly handy when scheduling new dependency graph node children. Brings FPS of cached simulation from the linked below file from ~30 to ~50. See documentation for BLI_task_pool_delayed_push_{begin, end} and for TaskThreadLocalStorage::do_delayed_push. Fixes T50027: Rigidbody playback and simulation performance regression with new depsgraph Thanks Bastien for the review!
2017-05-31Cleanup: Easier to read constant nameSergey Sharybin
2017-04-13Task scheduler: Fix typo in TLS for pools created from non-main threadSergey Sharybin
Did a mistake which started to use same TLS for all threads for such pools. Also added some extra asserts to help catching the bugs.
2017-04-12Task scheduler: Prevent race condition for the pools created from non-main ↵Sergey Sharybin
thread We can not re-use anything for such pools, because we will know nothing about whether the main thread is sleeping or not. So we identify such threads as 0, but we don't use main thread's TLS. This fixes dead-locks and crashes reported by Luca when doing playblasts.
2017-04-04Task: Remove non-atomic pool suspended flag assignmentSergey Sharybin
This was done some lines above by atomic fetch and and.
2017-03-11Cleanup: code style & cmakeCampbell Barton
2017-03-08Fix T50886: Blender crashes on renderSergey Sharybin
Was a mistake in one of the previous TLS commits. See comment in the pool_create to see some details why it was crashing.
2017-03-07Task scheduler: Add concept of suspended poolsSergey Sharybin
Suspended pools allows to push huge amount of initial tasks without any threading synchronization and hence overhead. This gives ~50% speedup of cached rigid body with file from T50027 and seems to have no negative affect in other scenes here.
2017-03-07Task scheduler: Initial implementation of local tasks queuesSergey Sharybin
The idea is to allow some amount of tasks to be pushed from working thread to it's local queue, so we can acquire some work without doing whole mutex lock. This should allow us to remove some hacks from depsgraph which was added there to keep threads alive.
2017-03-07Task scheduler: Use real pthread's TLS to access active thread's dataSergey Sharybin
This allows us to avoid TLS stored in pool which gives us advantage of using pre-allocated tasks pool for the pools created from non-main thread. Even on systems with slow pthread TLS it should not be a problem because we access it once at a pool construction time. If we want to use this more often (for example, to get rid of push_from_thread) we'll have to do much more accurate benchmark.
2017-03-07Task scheduler: Refactor the way we store thread-spedific dataSergey Sharybin
Basically move all thread-specific data (currently it's only task memory pool) from a dedicated array of taskScheduler to TaskThread. This way we can add more thread-specific data in the future with less of a hassle.
2017-03-07Task scheduler: Remove per-pool threads limitSergey Sharybin
This feature was adding extra complexity to task scheduling which required yet extra variables to be worried about to be modified in atomic manner, which resulted in following issues: - More complex code to maintain, which increases risks of something going wrong when we modify the code. - Extra barriers and/or locks during task scheduling, which causes extra threading overhead. - Unable to use some other implementation (such as TBB) even for the comparison tests. Notes about other changes. There are two places where we really had to use that limit. One of them is the single threaded dependency graph. This will now construct a single-threaded scheduler at evaluation time. This shouldn't be a problem because it only happens when using debugging command line arguments and the code simply don't run in regular Blender operation. The code seems a bit duplicated here across old and new depsgraph, but think it's OK since the old depsgraph is already gone in 2.8 branch and i don't see where else we might want to use such a single-threaded scheduler. When/if we'll want to do so, we can move it to a centralized single-threaded scheduler in threads.c. OpenGL render was a bit more tricky to port, but basically we are using conditional variables to wait background thread to do all the job.
2017-03-06Task scheduler: Cleanup, use BLI_assert() instead of assert()Sergey Sharybin
2017-03-03Get rid of `BLI_task_pool_stop()`.Bastien Montagne
Comments said that function was supposed to 'stop worker threads', but it absolutely did not do anything like that, was merely wiping out TODO queue of tasks from given pool (kind of subset of what `BLI_task_pool_cancel()` does). Misleading, and currently useless, we can always add it back if we need it some day, but for now we try to simplify that area.
2017-03-03Fix ugly mistake in BLI_task - freeing while some tasks are still being ↵Bastien Montagne
processed. Freeing pool was calling `BLI_task_pool_stop()`, which only clears pool's tasks that are in TODO queue, whithout ensuring no more tasks from that pool are being processed in worker threads. This could lead to use-after-free random (and seldom) crashes. Now use instead `BLI_task_pool_cancel()`, which does waits for all tasks being processed to finish, before returning.
2017-03-03Cleanup: IndentationSergey Sharybin
2017-03-01Task scheduler: Remove query for the pool's number of threadsSergey Sharybin
Not really happy of per-pool threads limit, need to find better approach to that. But at least it's possible to get rid of half of the nastyness here by removing getter which was only used in an assert statement. That piece of code was already well-tested and this code becomes obsolete in the new depsgraph and does no longer exists in blender 2.8 branch.
2017-03-01Task scheduler: Remove counter of done tasksSergey Sharybin
This was only used for progress report, and it's wrong because: - Pool might in theory be re-used by different tasks - We should not make any decision based on scheduling stats Proper way is to take care of progress by the task itself.