1

I am trying to control the CPU affinity of julia using taskset using

taskset -c 1,2 julia Foo.jl

However, internally Julia spawns may child processes to which this affinity mask does not seem to apply.

So mu question is: can I force a process and all its child processes to be limited to cpu-s 1 to 2.

gertian
  • 123
  • 5

1 Answers1

0

I can see the use case in an HPC environment, so this seems worth a feature-request on github.

That said, taskset takes a PID argument, so here is a potential interim solution:

pids = map(x -> fetch(@spawnat x getpid()), procs())
map(x -> run(`taskset -c 1,2 -p $x`), pids)

(untested though, currently on a mac)

Isaiah Norton
  • 4,205
  • 1
  • 24
  • 38