[Merged by Bors] - Copy TaskPool resoures to subapps#4792
Closed
james7132 wants to merge 1 commit intobevyengine:mainfrom
Closed
[Merged by Bors] - Copy TaskPool resoures to subapps#4792james7132 wants to merge 1 commit intobevyengine:mainfrom
james7132 wants to merge 1 commit intobevyengine:mainfrom
Conversation
Contributor
|
This makes sense to me. The task pool configuration should be managing all the threads in the app. Ran many_cubes. Unsurprisingly seeing a small perf hit with this change. This is mostly expected since on my machine (12 logical cores) there are only 6 compute threads available, while on main the default pool was allocating 12 to the render world. The perf regression will be fixed by #4740. We could potentially roll up this change with that PR. I'm also ok merging this in by itself too, since the behavior isn't currently correct. |
mockersf
approved these changes
May 19, 2022
hymm
approved these changes
May 19, 2022
alice-i-cecile
approved these changes
May 30, 2022
Member
alice-i-cecile
left a comment
There was a problem hiding this comment.
This is clearly the correct behavior. Generating a new taskpool for each subapp is too inflexible and surprising.
Member
|
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
May 30, 2022
# Objective Fixes #4791. `ParallelExecutor` inserts a default `CompteTaskPool` if there isn't one stored as a resource, including when it runs on a different world. When spawning the render sub-app, the main world's `ComputeTaskPool` is not cloned and inserted into the render app's, which causes a second `ComputeTaskPool` with the default configuration to be spawned. This results in an excess number of threads being spawned. ## Solution Copy the task pools from the main world to the subapps upon creating them. ## Alternative An alternative to this would be to make the task pools global, as seen in #2250 or bevyengine/rfcs#54.
Contributor
james7132
added a commit
to james7132/bevy
that referenced
this pull request
Jun 7, 2022
# Objective Fixes bevyengine#4791. `ParallelExecutor` inserts a default `CompteTaskPool` if there isn't one stored as a resource, including when it runs on a different world. When spawning the render sub-app, the main world's `ComputeTaskPool` is not cloned and inserted into the render app's, which causes a second `ComputeTaskPool` with the default configuration to be spawned. This results in an excess number of threads being spawned. ## Solution Copy the task pools from the main world to the subapps upon creating them. ## Alternative An alternative to this would be to make the task pools global, as seen in bevyengine#2250 or bevyengine/rfcs#54.
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this pull request
Feb 1, 2023
# Objective Fixes bevyengine#4791. `ParallelExecutor` inserts a default `CompteTaskPool` if there isn't one stored as a resource, including when it runs on a different world. When spawning the render sub-app, the main world's `ComputeTaskPool` is not cloned and inserted into the render app's, which causes a second `ComputeTaskPool` with the default configuration to be spawned. This results in an excess number of threads being spawned. ## Solution Copy the task pools from the main world to the subapps upon creating them. ## Alternative An alternative to this would be to make the task pools global, as seen in bevyengine#2250 or bevyengine/rfcs#54.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Objective
Fixes #4791.
ParallelExecutorinserts a defaultCompteTaskPoolif there isn't one stored as a resource, including when it runs on a different world. When spawning the render sub-app, the main world'sComputeTaskPoolis not cloned and inserted into the render app's, which causes a secondComputeTaskPoolwith the default configuration to be spawned. This results in an excess number of threads being spawned.Solution
Copy the task pools from the main world to the subapps upon creating them.
Alternative
An alternative to this would be to make the task pools global, as seen in #2250 or bevyengine/rfcs#54.