mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software > Mlucas

Reply
 
Thread Tools
Old 2022-01-10, 12:45   #1
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

2F16 Posts
Question "sched_setaffinity: Invalid argument"?

I'm trying to run Mlucas on a Huawei Matepad pro 10.5" 2021, with Harmony OS 2.0.0(runs Android apps but said to be not Android), Snapdragon 870 and 8GiB RAM. I'm using all 8 cores and running v20.1.1 (02 Dec 2021).
After compiling, when running selftests I saw a lot of information lines as I quoted in the title. It repeats several times (roughly from 6 times to 12, as I see it) for each radix-set. For example:
Code:
Using complex FFT radices ..............
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
mers_mod_square: Init threadpool of 8 threads
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
sched_setaffinity: Invalid argument
Using 8 threads in carry step
sched_setaffinity: Invalid argument
After that it runs actual FFT and prints the results. For now the selftest hasn't completed but almost all radix-sets was successful. However I don't remember seeing these lines when testing with another Android device 2 months before (possibly using an earlier patch version of Mlucas). Also, actual pm1 running on that Android device doesn't produce such lines.

So does this mean anything usual or terrible?

Last fiddled with by leonardyan96 on 2022-01-10 at 13:02 Reason: Append some details
leonardyan96 is offline   Reply With Quote
Old 2022-01-10, 12:53   #2
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

47 Posts
Default

These lines also appear when running single-threaded (omitting -cpu flags).
leonardyan96 is offline   Reply With Quote
Old 2022-01-10, 14:17   #3
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

4710 Posts
Default

After some search I learned this is a function provided by the Linux environment. I tried the following command, it successfully finished and that message still appeared twice.
Code:
./Mlucas -fft 192 -iters 100 -radset 0 -cpu 1
leonardyan96 is offline   Reply With Quote
Old 2022-01-10, 14:35   #4
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

47 Posts
Default

According to what I found with some more tests, when I specify any cpu cores other than 2 and 3 the error message will appear. When -cpu 2, -cpu 3 or -cpu 2:3 the screen output gets clean. It might be something weird with the OS or SoC, but doesn't stop the FFT from being correctly finished.
leonardyan96 is offline   Reply With Quote
Old 2022-01-10, 16:34   #5
chris2be8
 
chris2be8's Avatar
 
Sep 2009

23×103 Posts
Default

What is in /proc/cpuinfo ? It sounds as if Linux thinks it only has CPUs 2 and 3.
chris2be8 is offline   Reply With Quote
Old 2022-01-10, 21:36   #6
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

22·5·587 Posts
Default

Quote:
Originally Posted by chris2be8 View Post
What is in /proc/cpuinfo ? It sounds as if Linux thinks it only has CPUs 2 and 3.
Echoed - some OSes do weird things with respect to physical and/or logical core numbering. An attempt to set a thread's affinity to a non-existent core (based on the OS' core numbering scheme, as captured in /proc/cpuinfo) will simply leave any thread affinity management to the OS, but obviously one would prefer to not get warning messages in one's runs.
ewmayer is offline   Reply With Quote
Old 2022-01-10, 23:27   #7
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

47 Posts
Default

Quote:
Originally Posted by chris2be8 View Post
What is in /proc/cpuinfo ? It sounds as if Linux thinks it only has CPUs 2 and 3.
IMO if there's only 2 cores shown in /proc/cpuinfo, Mlucas will report 2 cores too, instead of 8.

I'll check this later.
leonardyan96 is offline   Reply With Quote
Old 2022-01-11, 01:22   #8
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

1011112 Posts
Default

Selftest just finished. In mlucas.cfg the timings look bad, from 2000 to 7000 ms/iter. Seems that it failed to utilize all the cores.
leonardyan96 is offline   Reply With Quote
Old 2022-01-11, 01:33   #9
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

47 Posts
Default

Quote:
Originally Posted by chris2be8 View Post
What is in /proc/cpuinfo ? It sounds as if Linux thinks it only has CPUs 2 and 3.
CPU numbers in it looks normal, from 0 to 7.
I tried taskset yet doesn't work.

I'm going to give up, since I'm not able to root it or flash a custom ROM, and I'm not planning to run Mlucas on it for a long term. It's purchased only a few months ago.
leonardyan96 is offline   Reply With Quote
Old 2022-01-11, 02:46   #10
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

47 Posts
Default

Just did another test on my daily phone with Snapdragon 835. It has 8 cores, among which little cores are 0-3 and big cores are 4-7.
The little cores can all be safely specified without any warning. However those big cores look tricky. Sometimes it's 4 and 5 which work, sometimes 4 & 6, and sometimes 5 & 7. It seems unstable.
According to the timing, when I specify only 1 core and it warns "Invalid argument", the program seems to fall back to only one small core(cpu 0?). This is the slowest case.
I'm not sure if root or custom ROM works. Qualcomm chips are really a pain in the ass...

Last fiddled with by leonardyan96 on 2022-01-11 at 02:49
leonardyan96 is offline   Reply With Quote
Old 2022-01-11, 19:07   #11
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

22·5·587 Posts
Default

Quote:
Originally Posted by leonardyan96 View Post
Just did another test on my daily phone with Snapdragon 835. It has 8 cores, among which little cores are 0-3 and big cores are 4-7.
The little cores can all be safely specified without any warning. However those big cores look tricky. Sometimes it's 4 and 5 which work, sometimes 4 & 6, and sometimes 5 & 7. It seems unstable.
According to the timing, when I specify only 1 core and it warns "Invalid argument", the program seems to fall back to only one small core(cpu 0?). This is the slowest case.
I'm not sure if root or custom ROM works. Qualcomm chips are really a pain in the ass...
Have you ever been able to run using '-cpu 0:7' without the invalid-argument warnings, or is 6 cores the maximum that has (sometimes) worked? It sounds like the OS is doing some kind of dynamic core binding/unbinding. Note that the pthread affinity-setting is formally a *hint* to the OS, whether it gets respected or not depends on the OS and the particuar device in question. Apple M1 is another such 4-big|4-little 8-core hybrid, but there cores 0-7 are always available. I suggest you try just using -cpu 0:3 and run self-tests (preferably with the phone mostly idle at the time and in some decent airflow), in hopes the OS will remap the process to mostly use the performance cores.
ewmayer is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is "mung" or "munged" a negative word in a moral sense? Uncwilly Lounge 15 2020-04-14 18:35
GQQ: a "deterministic" "primality" test in O(ln n)^2 Chair Zhuang Miscellaneous Math 21 2018-03-26 22:33
Stockfish game: "Move 8 poll", not "move 3.14159 discussion" MooMoo2 Other Chess Games 5 2016-10-22 01:55
Aouessare-El Haddouchi-Essaaidi "test": "if Mp has no factor, it is prime!" wildrabbitt Miscellaneous Math 11 2015-03-06 08:17
Would Minimizing "iterations between results file" may reveal "is not prime" earlier? nitai1999 Software 7 2004-08-26 18:12

All times are UTC. The time now is 11:38.


Thu Aug 18 11:38:43 UTC 2022 up 9:07, 0 users, load averages: 1.21, 1.20, 1.17

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔