Author Topic: ImageAligment - 5 threads on 4 core CPU  (Read 787 times)

Offline moscow

  • Newcomer
  • Posts: 17
    • View Profile
ImageAligment - 5 threads on 4 core CPU
« on: 2017 October 15 13:24:16 »
Hi.

Got a liitle bug in ImageAligment.
It starting 5 threads on my i7 four core CPU.

1.8.5 on windows 7 (64)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6828
    • View Profile
    • http://pixinsight.com/
Re: ImageAligment - 5 threads on 4 core CPU
« Reply #1 on: 2017 October 16 00:42:56 »
No bug here, this is the expected behavior. By default, StarAlignment uses a 20% more worker threads than the number of processors available. This is what we call thread overload. In intensive tests carried out before releasing the latest versions of SA, a moderate thread overload showed small performance improvements. The reason is probably that if there are some spare threads available, they can be fired up as soon as other threads start waiting for I/O completion. In this way thread overload reduces idle wait states and allows to exploit the available processing power somewhat more. This technique only works in some cases for tasks where relatively long I/O operations represent a significant part of the total work.

You can control thread overload with the fileThreadOverload parameter, which can be changed by editing an instance's source code (click the Edit Instance Source Code button on the tool's window, or select the same option by right-clicking on a process icon). Set fileThreadOverload=1 to disable thread overload. The default values are 1.0 for ImageIntegration and 1.2 for StarAlignment.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline moscow

  • Newcomer
  • Posts: 17
    • View Profile
Re: ImageAligment - 5 threads on 4 core CPU
« Reply #2 on: 2017 October 16 01:08:54 »
Thanks for describe how to disable this "feature".
Cause this feature (and realtime process priority by default) blocks pc, prevent normal work on it in time of using pix.

PixInsight - not single program on pc.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6828
    • View Profile
    • http://pixinsight.com/
Re: ImageAligment - 5 threads on 4 core CPU
« Reply #3 on: 2017 October 16 01:34:11 »
Quote
Cause this feature (and realtime process priority by default) blocks pc, prevent normal work on it in time of using pix.

1. Real-time thread priority is never used by any standard PixInsight tool. The maximum module thread priority parameter of the Preferences process is the maximum allowed thread priority for modules. Since you are a programmer, I'm sure you understand this documentation entry, where ThreadPriority::DefaultMax (a platform-dependent optimized thread priority) is explicitly recommended for all threads running in PixInsight modules. Note that in current PCL versions ThreadPriority::DefaultMax is equal to ThreadPriority::Normal on Windows. So all StarAlignment threads are running at normal priority on your machine, not real-time.

2. A moderate thread overload (a 20% in the case of StarAlignment) applied to an intensive batch process does not block a well-designed, reasonably powerful machine. It just helps taking advantage of idle I/O wait states to improve overall performance of the running tasks. Obviously SA can be a heavy process when it has to align a large number of large images, especially on machines with limited resources. This is something inherent to the task it performs.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline moscow

  • Newcomer
  • Posts: 17
    • View Profile
Re: ImageAligment - 5 threads on 4 core CPU
« Reply #4 on: 2017 October 16 01:38:11 »
Thanks for new feature. Thanks for method to disable it.
Its not a bug. I think topic not actual.