Problem with multithreading in numpy with OpenBLAS

1,323 views
Skip to first unread message

gavru...@gmail.com

unread,
Jan 30, 2014, 9:25:37 AM1/30/14
to openbla...@googlegroups.com
Hi All,

I have installed numpy with OpenBLAS according this instruction

after making the OpenBlas the output was:
==================================================
OpenBLAS build complete. (BLAS CBLAS LAPACK LAPACKE)

  OS               ... Linux             
  Architecture     ... x86_64               
  BINARY           ... 64bit                 
  C compiler       ... GCC  (command line : gcc)
  Fortran compiler ... GFORTRAN  (command line : gfortran)
  Library Name     ... libopenblas_nehalemp-r0.2.9.rc1.a (Multi threaded; Max num-threads is 2)

To install the library, you can run "make PREFIX=/path/to/your/installation install".
==================================================

I have checked that everything is ok by running this test

But when I try to change the number of cores OpenBLAS utilizes via OPENBLAS_NUM_THREADS nothing happens(I see from htop that numpy still uses only one cpu). The same for GOTO_NUM_THREADSЪ and OMP_NUM_THREADS.

How can I resolve this problem?

Zhang Xianyi

unread,
Jan 31, 2014, 3:20:24 AM1/31/14
to gavru...@gmail.com, openbla...@googlegroups.com
Hi,

What's your CPU? Did you use a virtual machine?

Xianyi


2014-01-30 <gavru...@gmail.com>:

--
You received this message because you are subscribed to the Google Groups "OpenBLAS-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openblas-user...@googlegroups.com.
To post to this group, send email to openbla...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

gavru...@gmail.com

unread,
Feb 2, 2014, 8:04:09 AM2/2/14
to openbla...@googlegroups.com, gavru...@gmail.com
Yes it is a virtual machine.

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 26
model name      : Intel(R) Xeon(R) CPU           X5550  @ 2.67GHz
stepping        : 5
microcode       : 0x11
cpu MHz         : 2666.760
cache size      : 8192 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 4˙
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm dtherm
bogomips        : 5333.52
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:


processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 26
model name      : Intel(R) Xeon(R) CPU           X5550  @ 2.67GHz
stepping        : 5
microcode       : 0x11
cpu MHz         : 2666.760
cache size      : 8192 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni ssse3 cx16 sse4_1 sse4_2 popcnt hypervisor lahf_lm dtherm
bogomips        : 5333.52
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

Пʼятниця, 31 січня 2014 р. 10:20:24 UTC+2 користувач Zhang Xianyi написав:

gavru...@gmail.com

unread,
Feb 3, 2014, 3:59:20 AM2/3/14
to openbla...@googlegroups.com, gavru...@gmail.com
By virtual I mean that it is amazon ec2 instance.

Неділя, 2 лютого 2014 р. 15:04:09 UTC+2 користувач gavru...@gmail.com написав:

Zhang Xianyi

unread,
Feb 3, 2014, 9:53:02 AM2/3/14
to gavru...@gmail.com, openbla...@googlegroups.com
Hi,

According to your /proc/cpuinfo, actually, it is one CPU core with hyper-threading. Thus, you can see 2 cores.

By default, if there are 2 hyper-threading logical cores, OpenBLAS will use only one core.

You can compile OpenBLAS with NO_AFFINITY=1 to disable this feature.

Xianyi


2014-02-03 <gavru...@gmail.com>:

gavru...@gmail.com

unread,
Feb 3, 2014, 12:05:16 PM2/3/14
to openbla...@googlegroups.com, gavru...@gmail.com
Thank you very much. Compilation with NO_AFFINITY=1 resolves my problem. 

So my questions are:
Will affinity increase performance in the case of real dual-core?
And what parameters will be optimal in the case of both multi-core and hyper-threaded system?

Понеділок, 3 лютого 2014 р. 16:53:02 UTC+2 користувач Zhang Xianyi написав:

Carter Schonwald

unread,
Feb 3, 2014, 1:01:43 PM2/3/14
to gavru...@gmail.com, openbla...@googlegroups.com
there are rules of thumb, but they can only help guide. When in doubt, benchmark! :) 
Reply all
Reply to author
Forward
0 new messages