Skip to content

Failed to setting CPU affinity over 32-processor via cli arg #3231

Description

@filzrev

On current version of BenchmarkDotNet implementation.
--affinity command line argument is parsed as int (signed).

So it can't accept value that over int.MaxValue value and it can't specify over 32-processor affinity.

I thought, it need to change affinity parameter to nuint (unsigned) to pass affinity as bit mask.

Note: Currently BenchmarkDotNet seems not support CPU groups. So affinity can set up to 64 logical CPU cores.

// Max supported affinity without CPU groups is 64
long cpuMask = Environment.ProcessorCount >= 64 ? unchecked((long)0xFFFF_FFFF_FFFF_FFFF) : (1L << Environment.ProcessorCount) - 1;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions