View Single Post
Old 2020-10-24, 08:21   #3
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

220618 Posts
Default

Quote:
Originally Posted by JuanTutors View Post
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?
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 more 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.

Last fiddled with by LaurV on 2020-10-24 at 08:34
LaurV is online now   Reply With Quote