Ian Jauslin
summaryrefslogtreecommitdiff
blob: f61cdd7228cd224d7a6ead8c2284b4c0fcc5a413 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# split up 1...n among workers
function spawn_workers(n::Int64)
  # number of workers
  nw=nworkers()
  # split jobs among workers
  work=Array{Array{Int64,1},1}(undef,nw)
  # init empty arrays
  for p in 1:nw
    work[p]=Int64[]
  end
  for i in 1:n
    append!(work[(i-1)%nw+1],[i])
  end

  return work
end