cpus#

cpus(arg: int, *, when: str | dict[str, str] | None = None) None#

This test requires this many CPUs

Usage#

.pyt:

import canary
canary.directives.cpus(arg, when=...)

.vvt: NA

Parameters#

  • arg: The number of CPUs required by this test.

The when expression is limited to the following conditions:

  • testname: Restrict processing of the directive to this test name

  • platform: Restrict processing of the directive to certain platform or platforms

  • option: Restrict processing of the directive to command line -o options

Notes#

  • Use cpus(int) to set a single, fixed resource requirement for a job without creating additional test instantiations.

  • Test naming reflects only parameters introduced via parameterize(). Therefore, when CPUs are set via cpus(arg), cpus=<arg> are not appended to the generated test name. If you want distinct named variants such as ...cpus=8, use parameterize("cpus", ...) instead.