p.Chaos.Deformable.GSParallelMax
p.Chaos.Deformable.GSParallelMax
#Overview
name: p.Chaos.Deformable.GSParallelMax
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Minimal number of particles to process in parallel for Gauss Seidel constraints. [def: 100]
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Deformable.GSParallelMax is to set the minimal number of particles to process in parallel for Gauss-Seidel constraints in the Chaos deformable physics system.
This setting variable is primarily used in the Chaos physics engine, specifically in the deformable physics module. It’s part of the Unreal Engine’s experimental Chaos physics system, which is designed to handle complex simulations including soft body dynamics.
The value of this variable is set through a console variable (CVar) named “p.Chaos.Deformable.GSParallelMax”. It’s initialized with a default value of 100, but can be changed at runtime through the console or configuration files.
The associated variable GSParallelMax directly interacts with p.Chaos.Deformable.GSParallelMax. They share the same value, with GSParallelMax being the actual variable used in the code, while p.Chaos.Deformable.GSParallelMax is the console variable that allows for runtime modification.
Developers should be aware that this variable affects the parallelization of Gauss-Seidel constraint solving for deformable bodies. A higher value may increase parallelism but could potentially lead to more overhead for smaller simulations.
Best practices when using this variable include:
- Adjusting it based on the scale and complexity of your deformable simulations.
- Profiling performance with different values to find the optimal setting for your specific use case.
- Being cautious about setting it too low, as it might reduce the benefits of parallelization.
Regarding the associated variable GSParallelMax:
- It’s used directly in the FDeformableSolver class, specifically in the InitializeGaussSeidelConstraintVariables function.
- It’s passed as a parameter when creating FGaussSeidelMainConstraint objects, which are part of the Gauss-Seidel constraint solving system for deformable bodies.
- Developers should treat GSParallelMax as the internal representation of the console variable, and modify it through the p.Chaos.Deformable.GSParallelMax CVar rather than directly.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Deformable/ChaosDeformableSolver.cpp:92
Scope (from outer to inner):
file
namespace Chaos::Softs
Source code excerpt:
int32 GSParallelMax = 100;
FAutoConsoleVariableRef CVarDeformableGSParrelMax(TEXT("p.Chaos.Deformable.GSParallelMax"), GSParallelMax, TEXT("Minimal number of particles to process in parallel for Gauss Seidel constraints. [def: 100]"));
FDeformableSolver::FDeformableSolver(FDeformableSolverProperties InProp)
: CurrentInputPackage(TUniquePtr < FDeformablePackage >(nullptr))
, PreviousInputPackage(TUniquePtr < FDeformablePackage >(nullptr))
, Property(InProp)
{
#Associated Variable and Callsites
This variable is associated with another variable named GSParallelMax
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Deformable/ChaosDeformableSolver.cpp:91
Scope (from outer to inner):
file
namespace Chaos::Softs
Source code excerpt:
FCriticalSection FDeformableSolver::SolverEnabledMutex;
int32 GSParallelMax = 100;
FAutoConsoleVariableRef CVarDeformableGSParrelMax(TEXT("p.Chaos.Deformable.GSParallelMax"), GSParallelMax, TEXT("Minimal number of particles to process in parallel for Gauss Seidel constraints. [def: 100]"));
FDeformableSolver::FDeformableSolver(FDeformableSolverProperties InProp)
: CurrentInputPackage(TUniquePtr < FDeformablePackage >(nullptr))
, PreviousInputPackage(TUniquePtr < FDeformablePackage >(nullptr))
, Property(InProp)
{
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Deformable/ChaosDeformableSolver.cpp:1201
Scope (from outer to inner):
file
namespace Chaos::Softs
function void FDeformableSolver::InitializeGaussSeidelConstraintVariables
Source code excerpt:
PERF_SCOPE(STAT_ChaosDeformableSolver_InitializeGaussSeidelConstraintVariables);
GSMainConstraint.Reset(new Chaos::Softs::FGaussSeidelMainConstraint<FSolverReal, FSolverParticles>(Evolution->Particles(), Property.bDoQuasistatics, Property.bUseSOR, Property.OmegaSOR, GSParallelMax));
if (Property.bUseGSNeohookean)
{
GSNeohookeanConstraints.Reset(new Chaos::Softs::FGaussSeidelNeohookeanConstraints<FSolverReal, FSolverParticles>(
Evolution->Particles(), *AllElements, *AllTetEMeshArray, *AllTetNuMeshArray, MoveTemp(*AllTetAlphaJArray), MoveTemp(*AllIncidentElements), MoveTemp(*AllIncidentElementsLocal), 0, Evolution->Particles().Size(), Property.bDoQuasistatics, Property.bUseSOR, Property.OmegaSOR, GDeformableXPBDCorotatedParams));
Evolution->ResetConstraintRules();