mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   New warning, didn't appear way back in the day (https://www.mersenneforum.org/showthread.php?t=26124)

JuanTutors 2020-10-24 05:34

New warning, didn't appear way back in the day
 
I just switched p95 v30.3 to run two threads instead of one to see if it would get a better throughput. Is it normal to get the following warning ONLY when running two threads and not one?

[quote]You have allocated more cores than are available. This is likely to GREATLY REDUCE performance. Do you want to correct this?[/quote]

S485122 2020-10-24 07:07

Suppose you have a processor with 2*n cores running one worker using 2*n cores.
If you change to two workers, you must change the first worker to use n core(s). The error message leads me to think that you changed the number of workers, without adapting the "CPU cores to use (Multithreading)" setting in consequence.

The total of the number of cores used by all the workers must not exceed the number of cores (or the number of threads in the case of a processor supporting hyper-threading.)

Jacob

LaurV 2020-10-24 08:21

[QUOTE=JuanTutors;560941]I just switched p95 v30.3 to run two threads instead of one to see if it would get a better throughput. Is it normal to get the following warning ONLY when running two threads and not one?[/QUOTE]
Each worker can use an arbitrary number of threads. Threads are specific for workers, in the sense that you can't have two workers sharing the same thread. Therefore, if you have for example, 2 workers and each uses 3 threads, then you have a total of 6 threads. If you have 2 workers and the first uses 3 threads and the second uses 4, then you have a total of 7 threads.

The optimal output (read as "the most efficient") for most types of works and for most systems, is when the total number of threads is equal to the total number of physical cores in your system. Some systems get some more output per wall clock time if you run [U]more[/U] threads than physical cores, but this depends on the system and on the work type. For example, ECM can get about 30% more performance in some systems if you run more threads than physical cores.

For the most of the programs you run in your computer, the processor is mostly free, it waits for you to type at the keyboard or move your mouse, for example, therefore you can run more threads than physical cores, and one core can take care of more than one thread. The CPU manufacturers even encourage this, making processors that present themselves to the external world with more cores than they really have. It is called "hyper-threading" (HT). Like the CPU lies to you, it says "hey, I have 8 cores, you can give me 8 tasks in the same time!", or "hey I have 12 cores, you can give me 12 tasks in the same time!", when in reality it only has 4. The most of the times, the CPU will get away with this "lie", because he can execute the tasks very fast, and switch from one to the other, and you can not see. But this is based on the fact that the most tasks you give him to do have gaps, waiting times, periods in which the CPU is not required to do much, and he can work on other tasks. So, he could finish two or three tasks in the same time allocated for one.

The "fictive" cores that the CPU claims to have, are called "virtual cores". So, you may have 4 physical cores only, but if the HT is enabled in your CPU, it will tell you that you have 8 or 12 cores.

Prime 95 is not such a "lazy, filled with waiting times" program. It is designed to be "very efficient", therefore running more threads than the number of cores in the same time, won't benefit you. Contrary, you will get less work done, or about the same work for a much higher energy consumption (to switch between tasks).

But you are free to try, and you may get the things done faster in your system if you don't care much about the heat you produce, about the lifetime of your components, and about your electricity bill.

However, Prime 95 will notify you every time your number of threads are higher than the number of physical cores or, if HT enabled, higher than the number of virtual cores.

That's the error you got. It is not an error, P95 will work very well with 100 threads, just it may not be very efficient, as it will lose more time switching threads to schedule them in your 4 cores, than doing useful work (computing).

To fix it, and only if you want to fix it, it is not mandatory, as I just said, you can run 100 threads, no problem, but if you want to "fix" it, then click Test in the menu, click Worker Windows, and there you can set the number of workers, and for each worker, the number of threads.

Run the Benchmark from Options menu first, to see what settings have the best output for your system.

After changing the number of workers or threads, you need to exit P95 (from Test/Exit, and not clicking the red X) and restart. The interface is a bit stupid and it will not update the windozes without a restart. Also, be careful that repeatedly changing the workers settings, you may end up with some unwanted assignments, or lose some, as the assignments are moved from one worker to the other, or new assignments are requested from server when you increase the number of workers.

And again, don't confuse workers with threads. One worker can run an arbitrary number of threads. In the ideal world, every thread will take a (physical) core, and that would be your best output.

retina 2020-10-24 08:39

[QUOTE=LaurV;560953]The "fictive" cores that the CPU claims to have, are called "virtual cores".[/QUOTE]I know everyone here likes to call these things "cores". But Intel called it hyper-[b]thread[/b]ing for a reason. It is a thread, not a core. It never was a core, it never will be a core.

Calling them physical and virtual cores is mighty confusing. All cores are physical. The rest are threads feeding the cores. No virtual-anything is required.

LaurV 2020-10-24 09:59

That's why they are "virtual".
"Fictive", fictional. Pufff ! Hihi.
I agree that it is kinda confusing, in some situations. I have colleagues which are smart and educated in related fields, like electronics or math, and they imagine you have 8 cores inside of a 4-core HT CPU, from which 4 are "real" and "better", and the other 4 are "not so good" or "not so real" but you still "can use them for some easy work".
But that's the terminology, confuse or not. :razz:
As bad as it can be in some situations, it saves headache in other. For example, "threads" is reserved for the things you are currently running in your computer. You may have 50 threads running in a machine with 4 physical cores, in spite fo the fact that, when HT is enabled, the OS believes the machine has 8 cores. (you can not say "machine has 8 threads" haha). And that's the situation always, just open Task Manager ans see how many processes and threads are running simultaneously in your machine (with 2*N virtual cores :razz:)

retina 2020-10-24 10:09

[QUOTE=LaurV;560964]... and they imagine you have 8 cores inside of a 4-core HT CPU, from which 4 are "real" and "better", and the other 4 are "not so good" or "not so real" but you still "can use them for some easy work".[/QUOTE]That is the very reason to stop calling them virtual. It creates such silly notions in people's heads.

LaurV 2020-10-24 10:13

Nope.

Read last paragraph I added to the post.

And yes, I know Intel calls them "threads" in their CPU "ark" page.

retina 2020-10-24 10:34

[QUOTE=LaurV;560964](you can not say "machine has 8 threads" haha). [/QUOTE]Sure I can. I just have to word it correctly.

"My CPU can process 8 threads simultaneously, through its 4 execution cores, a maximum of 2 threads per core. The OS has to schedule its 50 threads among the 8 CPU threads."

Not only is it not confusing, it is also accurate terminology.

LaurV 2020-10-24 10:56

[QUOTE=retina;560972]"My CPU can process 8 threads simultaneously, through its 4 execution cores, a maximum of 2 threads per core. The OS has to schedule its 50 threads among the 8 CPU threads."[/QUOTE]
:tu: That looks nice! Not all of us are native Chiglish speakers! :razz:

retina 2020-10-24 11:01

[QUOTE=LaurV;560974]... Chiglish ...[/QUOTE]我认为我的英语是差。这太糟糕了。我想我说的中式英语。你们知道中式英语?这意思是以中国人的想法说英语。例如,好久不见。

:razz:

xilman 2020-10-24 11:35

[QUOTE=retina;560954]I know everyone here likes to call these things "cores". But Intel called it hyper-[b]thread[/b]ing for a reason. It is a thread, not a core. It never was a core, it never will be a core.

Calling them physical and virtual cores is mighty confusing. All cores are physical. The rest are threads feeding the cores. No virtual-anything is required.[/QUOTE]All memory is physical.

Doesn't stop the term "virtual memory" from being a term which is both useful and widely understood.


All times are UTC. The time now is 18:39.

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