diff --git a/src/commands/spec.ts b/src/commands/spec.ts index 7df89bb..2436467 100644 --- a/src/commands/spec.ts +++ b/src/commands/spec.ts @@ -1,20 +1,20 @@ -import { optFlag, undefList } from "./common" +import { optFlag, optSwitch, undefList } from "./common"; export interface RunCPUOptions { /** * Config file, used for compiling flags, compiler versions, etc. */ - config?: string + config?: string; /** * SPEC workload scale for each benchmark */ - workload?: "test" | "train" | "ref" + workload?: "test" | "train" | "ref"; /** * Selected benchmarks */ - benchmarks?: string[] + benchmarks?: string[]; buildType?: "nobuild" | "rebuild" | "plain", @@ -49,6 +49,14 @@ export interface RunCPUOptions { | "screen" /** Plain ASCII text file */ | "text")[]; + + + /** + * Synonyms: none + * Default: --setprocgroup + * Meaning: Attempt to create all processes in a single group. Improves the chances that ^C will get the whole run, not just one of the children. + */ + setprocgroup?: boolean; } export function runcpuOptions(o: RunCPUOptions): string[] { @@ -58,14 +66,15 @@ export function runcpuOptions(o: RunCPUOptions): string[] { ...undefList(o.buildType, opt => { switch (opt) { case "nobuild": - return ["--nobuild"] + return ["--nobuild"]; case "rebuild": - return ["--rebuild"] + return ["--rebuild"]; case "plain": - return [] + return []; } }), ...undefList(o.benchmarks, bench => bench), ...undefList(o.outputFormat, of => ["--output_format", of.join(",")]), - ] + ...optSwitch("--setprocgroup", o.setprocgroup), + ]; }