I have a workstation whose operating system is 64 bit windows server 2012 R2. I am using Delphi XE7 Update 1. The workstation has 72 cores including hyperthreading. I want all my applications to run on all the cores that are available each time the application is run. I wish to do this programmatically rather that using set affinity in task master (which only applies to one group at a time and I have two groups of 36 cpus which I want to engage simultaneously) or boot options in advance setting from msconfig.
I realise that the question is similar to or encompasses the following questions that have already been asked on Stackoverflow
Delphi TParallel not using all available cpu
Strange behaviour of TParallel.For default ThreadPool
SetProcessAffinityMask - Select more than one processor?.
and I have also looked at the suggestion edn.embarcadero.com/article/27267.
But my SetProcessAffinityMask question relates to more that 64 cores using a 64 bit operation system and is not confined to using TParallel.
The solution that I have tried is an adaptation of the one proffered by Marco van de Voort
var
cpuset : set of 0..71;
i: integer;
begin
cpuset:=[];
for i:=0 to 71 do
cpuset:=cpuset+[i];
SetProcessAffinityMask(ProcInfo.hProcess, dword(cpuset));
end;
but it did not work.
I would be grateful for any suggestions.