octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #44898] octave uses a bunch of system CPU over


From: anonymous
Subject: [Octave-bug-tracker] [bug #44898] octave uses a bunch of system CPU overhead
Date: Wed, 22 Apr 2015 07:06:56 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?44898>

                 Summary: octave uses a bunch of system CPU overhead
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Wed 22 Apr 2015 07:06:55 AM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Performance
                  Status: None
             Assigned to: None
         Originator Name: Wiliam Ehlhardt
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.1
        Operating System: GNU/Linux

    _______________________________________________________

Details:

On my system (Ubuntu 14.04 on a quad-core Core i5 processor), running a
numerics-heavy script [1] causes octave to saturate one CPU core with usermode
CPU usage (expected), and the other 3 cores with "sys" CPU usage (as reported
by top) (VERY UNEXPECTED).

Some spelunking with strace [2][3] shows ~1.8 million sched_yield syscalls
over the course of execution. Further hunting on mailing lists [4] brought me
to [5]. Based on [5], I tried the following workaround:

OPENBLAS_NUM_THREADS=1 octave ex4.m

With that environment variable set, octave saturates one core and generates no
weird sys CPU overhead, and strace shows no sched_yield calls.


EXPECTED BEHAVIOR: octave should not waste CPU with a zillion useless
syscalls. It probably needs to set the OpenBLAS flags correctly.


[1] https://github.com/merwan/ml-class/blob/master/mlclass-ex4/ex4.m ; git
clone the whole repository and run "octave ex4.m" to reproduce
[2] See attached strace_output_uniq.txt, generated roughly via strace octave
ex4.m 2> /tmp/loge; uniq -c /tmp/loge > strace_output_uniq.txt
[3] On the advice of the inimitable Karl Fogel. Yes, THE Karl Fogel.
[4] Actually, Karl Fogel did the hunting. Isn't he great?
[5] https://github.com/xianyi/OpenBLAS/wiki/faq#multi-threaded



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 22 Apr 2015 07:06:55 AM UTC  Name: strace_output_uniq.txt  Size:
517kB   By: None

<http://savannah.gnu.org/bugs/download.php?file_id=33736>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44898>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]