Documentation on using multiple threads in v0.5-dev?

291 views
Skip to first unread message

Douglas Bates

unread,
May 10, 2016, 12:58:22 PM5/10/16
to julia-dev
Is there documentation on how to compile v0.5-dev to allow for multiple threads and how to invoke julia when doing so?  In Make.user I have a line

override JULIA_THREADS=4

but I still get

julia> versioninfo(true)
Julia Version 0.5.0-dev+4011
Commit 89487db* (2016-05-10 04:13 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
  WORD_SIZE: 64
           Ubuntu 16.04 LTS
  uname: Linux 4.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC 2016 x86_64 x86_64
Memory: 15.561084747314453 GB (11693.4375 MB free)
Uptime: 7396.0 sec
Load Avg:  0.2685546875  0.439453125  0.5302734375
Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz: 
       speed         user         nice          sys         idle          irq
#1  3799 MHz     104047 s        584 s      18851 s     611960 s          0 s
#2  3692 MHz     110583 s        381 s      17647 s     607300 s          0 s
#3  3728 MHz     127508 s        367 s      19402 s     588641 s          0 s
#4  3738 MHz     102908 s        306 s      20362 s     608373 s          0 s

  BLAS: libopenblas (NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: liblapack
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, ivybridge)
Environment:
  TERM = screen
  ...

Package Directory: /home/bates/.julia/v0.5
4 required packages:
 - FlatBuffers                   0.0.1
 - IJulia                        1.1.9
 ...

julia> Threads.nthreads()
1


I don't see anything in the output of "julia --help" about threads.

Yichao Yu

unread,
May 10, 2016, 1:01:52 PM5/10/16
to Julia Dev
On Tue, May 10, 2016 at 12:58 PM, Douglas Bates <dmb...@gmail.com> wrote:
> Is there documentation on how to compile v0.5-dev to allow for multiple
> threads and how to invoke julia when doing so? In Make.user I have a line
>
> override JULIA_THREADS=4

threading is on by default. And I believe this variable is never used
to specify how many threads we use.

To turn on threading, you need to start julia with environment
variable `JULIA_NUM_THREAD=n` where `n` is the number of worker thread
(limited to number of cores).
There's current no way to compile a julia with threading on by default anymore.

Yichao Yu

unread,
May 10, 2016, 1:03:32 PM5/10/16
to Julia Dev
On Tue, May 10, 2016 at 1:01 PM, Yichao Yu <yyc...@gmail.com> wrote:
> On Tue, May 10, 2016 at 12:58 PM, Douglas Bates <dmb...@gmail.com> wrote:
>> Is there documentation on how to compile v0.5-dev to allow for multiple
>> threads and how to invoke julia when doing so? In Make.user I have a line
>>
>> override JULIA_THREADS=4
>
> threading is on by default. And I believe this variable is never used
> to specify how many threads we use.
>
> To turn on threading, you need to start julia with environment
> variable `JULIA_NUM_THREAD=n` where `n` is the number of worker thread
> (limited to number of cores).
> There's current no way to compile a julia with threading on by default anymore.

I realized that my first and last sentence contradict each other. What
I meant is that the threading code is built by default but there's no
way to compile julia that uses multiple threads by default (without
tweaking options in the source code `src/options.h`)

Douglas Bates

unread,
May 10, 2016, 1:21:12 PM5/10/16
to julia-dev
Thank you.  If I may venture another question, is there or will there be a Compat wrapper for the @threads macro?

Yichao Yu

unread,
May 10, 2016, 1:22:02 PM5/10/16
to Julia Dev
On Tue, May 10, 2016 at 1:21 PM, Douglas Bates <dmb...@gmail.com> wrote:
> Thank you. If I may venture another question, is there or will there be a
> Compat wrapper for the @threads macro?

There's a no-op one.

Douglas Bates

unread,
May 10, 2016, 1:31:42 PM5/10/16
to julia-dev
It's not in the released version of Compat, only the development version, which is what confused me.
Reply all
Reply to author
Forward
0 new messages