What is the load average used by the parallel view?

Using GNU make on Windows, what exactly is the load average?

For example:

make -j --load-average=2.5

      

What does 2.5 mean?

+2


source to share


2 answers


This means that make will not start a new thread until the number of running processes averaged over a period of time is below 2.5.

Edit, following the vine's
remark the runnable process, in Unix parlance, is a process that either waits for CPU time or runs easily. Technically, this is a process that is in the TASK_RUNNING state.



However ... this prompted me to re-read the original question and mark its " on Windows " part ....
If my original answer, freely, is correct for GNU Make on Unix-like hosts, it is clearly not true on Windows. The discrepancy in behavior is due to the fact that the two operating systems provide very different metrics to describe their "current" CPU utilization. Therefore, the Make logic must interpret these CPU load values ​​differently in order to serve its average load.

The purpose of the parameter --load-average

is to provide guidance as to when it can start new threads; forcing Make to share CPU resources with other applications (and within itself) more elegantly.
On Linux, the semantics of this parameter are very close to its name: new Threads are allowed when the load average as reported to the kernel (I assume this is the "one minute" average load, although it could be five minutes) is less than the parameter value.
On Windows, it calculates the load average from the weighted average of the processor load (as reported by the GetSystemTimes function) and the memory load (for example, from the GlobalMemoryStatusEx function).

+1


source


In Windows - nothing, apparently. This is a UNIX term: http://en.wikipedia.org/wiki/Load_%28computing%29

My copy of Cygwin reports load averages when I run the command uptime

. I don't think there is a quick way to calculate this on Windows; it has been posted on the Cygwin mailing list in the past.

In other words: it is not implemented, so it is always zero.



Here's an implementation getloadavg

, directly from the GNU Make 3.81 sources:

# if !defined (LDAV_DONE) && (defined (__MSDOS__) || defined (WINDOWS32))
#  define LDAV_DONE

  /* A faithful emulation is going to have to be saved for a rainy day.  */
  for ( ; elem < nelem; elem++)
    {
      loadavg[elem] = 0.0;
    }
# endif  /* __MSDOS__ || WINDOWS32 */

      

I haven't tested newer versions of GNU make, but I doubt this has changed.

0


source







All Articles