Using PARTR in Julia 1.2?


from what I understand, PARTR (resp. parts of what it will become) will be part of Julia 1.2. I’m keen to try it out, if possible, by my attempts at starting tasks within an @threads loop have failed, the tasks always seem to run on thread 1.

Does someone have a short PARTR example (assuming it’s indeed part of v1.2-rc1)?



1 Like

I believe one has to set an environment variable, export JULIA_NUM_THREADS=2, or of course any number that fits your machine.


PetrKrysl@Spectre MINGW64 ~/Downloads/FinEtools.jl (master)
$ julia
   _       _ _(_)_     |  Documentation:
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.3.0-DEV.250 (2019-05-19)
 _/ |\__'_|_|_|\__'_|  |  Commit ab3ecdfbcb (31 days old master)
|__/                   |

julia> versioninfo()
Julia Version 1.3.0-DEV.250
Commit ab3ecdfbcb (2019-05-19 17:49 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-8705G CPU @ 3.10GHz
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
1 Like

Sure, I do set JULIA_NUM_THREADS, of course, and the @threads loop uses them - just the tasks I spawn in there all seem to run on thread one. By maybe I misunderstand how PARTR is supposed to work?

Is there a MWE?

See here:

Ah, thanks, that clears thing up regarding @threads. So there’s some machinery for PARTR in v1.2, but not enough to use it yet? Or does one use it independently from @threads?

The machinery is mostly all in place, but for now @threads will still use the regular static scheduling.

We don’t know yet if there will be a different syntax to use depth-first scheduling.

For now then, there are pretty much no user-facing changes, which the exception as @jeff.bezanson said that a few more operations (IO and task switches) work inside @threads.

Maybe Jeff can give an update in case something changed since April.

Thanks for the infos! I guess we’ll hear more exiting things in this direction in Baltimore. :slight_smile: