Re: erlang:system_info(cpu_topology) strange behavior

Frank Muller <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <CAFA6GnBK1bashF-v=rrXXVjjSMUCZsLivRba+SGsBfg=YvkzEw@mail.gmail.com>
Thanks Rickard.

8 oct. 2020 at 19:47, Rickard Green <[email protected]> wrote

> On Thu, Oct 8, 2020 at 7:36 PM Frank Muller <[email protected]>
> wrote:
>
>> Answering my own question.
>>
>> The second attempt worked because I was under “root”.
>>
>> Attaching to the release with -remsh failed because the node was running
>> under user “orca” which has less privileges.
>>
>> Is this an expected behavior?
>>
>> /Frank
>>
>>
> The runtime system gets the information about cpu topology by reading
> files under /sys/devices/system/. If it cannot read and parse the files
> there, it will fail to detect the cpu topology. Seems like only root is
> allowed to read that part of the file-system in your case.
>
> Regards,
> Rickard Green
>
>
>
>> Frank<[email protected]>
>>
>>> Hi guys,
>>>
>>> When I attached (-remsh) to my release application (/opt/orca), this
>>> call returns undefined:
>>>
>>> ([email protected])1> erlang:system_info(cpu_topology).
>>> undefined
>>>
>>> If try this instead, the call seems to work as expected:
>>>
>>> $ /opt/orca/erts-10.7.2.4/bin/erl
>>> 1> erlang:system_info(cpu_topology).
>>> [{processor,[{core,[{thread,{logical,0}},
>>>                     {thread,{logical,4}}]},
>>>              {core,[{thread,{logical,1}},{thread,{logical,5}}]},
>>>              {core,[{thread,{logical,2}},{thread,{logical,6}}]},
>>>              {core,[{thread,{logical,3}},{thread,{logical,7}}]}]}]
>>>
>>>
>>> I’m on Ubuntu16 LTS kernel 4.4.0, Erlang 22.3.4.11.
>>>
>>> Help appreciated
>>>
>>> /Frank
>>>
>>
>
> --
> Rickard Green, Erlang/OTP, Ericsson AB
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.