Add MaxConcurrency and ConcurrencyProcessorScale options for Flax.Build cmd line

This commit is contained in:
Wojtek Figat
2021-02-15 13:32:38 +01:00
parent 29f0834cc4
commit cdd68c9a89
2 changed files with 14 additions and 2 deletions

View File

@@ -27,12 +27,12 @@ namespace Flax.Build.BuildSystem.Graph
/// <summary>
/// The maximum amount of threads to be used for the parallel execution.
/// </summary>
public int ThreadCountMax = 1410;
public int ThreadCountMax = Configuration.MaxConcurrency;
/// <summary>
/// The amount of threads to allocate per processor. Use it to allocate more threads for faster execution or use less to keep reduce CPU usage during build.
/// </summary>
public float ProcessorCountScale = 1.0f;
public float ProcessorCountScale = Configuration.ConcurrencyProcessorScale;
/// <inheritdoc />
public override int Execute(List<Task> tasks)

View File

@@ -133,6 +133,18 @@ namespace Flax.Build
[CommandLine("logfile", "<path>", "The log file path relative to the working directory. Set to empty to disable it/")]
public static string LogFile = "Cache/Intermediate/Log.txt";
/// <summary>
/// The maximum allowed concurrency for a build system (maximum active worker threads count).
/// </summary>
[CommandLine("maxConcurrency", "<threads>", "The maximum allowed concurrency for a build system (maximum active worker threads count).")]
public static int MaxConcurrency = 1410;
/// <summary>
/// The concurrency scale for a build system that specifies how many worker threads allocate per-logical processor.
/// </summary>
[CommandLine("concurrencyProcessorScale", "<scale>", "The concurrency scale for a build system that specifies how many worker threads allocate per-logical processor.")]
public static float ConcurrencyProcessorScale = 1.0f;
/// <summary>
/// The output binaries folder path relative to the working directory.
/// </summary>