GetLogicalProcessorCount() not work on W2022 Server 48core

This forum is for eXpress++ general support.
Post Reply
Message
Author
Victorio
Posts: 643
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

GetLogicalProcessorCount() not work on W2022 Server 48core

#1 Post by Victorio »

Hi,
I am testing my app on Windows Server 2022 with 48 cores. Function GetLogicalProcessorCount() show only 32 ? Why ?

AI say, that it is because limitation DWORD to 32bit, but I am not sure if this is true.

Also not work good set CPU :

Code: Select all

FUNCTION SmpSetCPU(nCpuMask)         // nastavenie na zadanř CPU
LOCAL rc
    rc := DllCall("Xpprt1.dll",DLL_CDECL, "_sysSetCPU", nCpuMask)
RETURN rc

Wolfgang Ciriack
Posts: 492
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: GetLogicalProcessorCount() not work on W2022 Server 48core

#2 Post by Wolfgang Ciriack »

_______________________
Best Regards
Wolfgang

Victorio
Posts: 643
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: GetLogicalProcessorCount() not work on W2022 Server 48core

#3 Post by Victorio »

Yes, I read this, but I am not understand :
SetLogicalProcessor( RandomInt(GetLogicalProcessorCount()) )

I am testing it, maximal CPU can set to 32, no more, byt I have on server 48 CPUs.

If GetLogicalProcessorCount (by RandomInt) return number of CPU, and on Server is 48CPUs, I mean this also crash on number bigger than 32 ?

On this forum I saw Jimmy has some solution for 64bit harbour, I am not test how can I use this solution.

I need switch application to a specific CPU from 0 to 47, because on one CPU No more than one process, or more precisely a separate exe application launched via Runshell, may be running on one CPU.

Is some solution maybe external utility to set how CPU will be use to run exe module ?

I found command/parameter :
C:\Windows\system32>start /affinity 1 notepad.exe

Is possible run my external application/exe file with Runshell for any from 48 CPU ?

C:\Windows\system32>start /affinity 140737488355328 notepad.exe

where 140737488355328 mean binary 100000000000000000000000000000000000000000000000000 48bit number ???

User avatar
Tom
Posts: 1288
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: GetLogicalProcessorCount() not work on W2022 Server 48core

#4 Post by Tom »

Windows itself can't address a higher number of processors. There is no processor #33. It's number one on cluster two. There are API functions to get the number of processor groups and select one of them, but within a group, the maximum number of processors is 32, no matter how much logical processors are available. Imagine there are two buildings with parking lots, each has 32 of them. There is no way to get your car from parking lot #1 of buidling #2 if you are inside building #1.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply