I want to use Python multiprocessing to run grid search for a predictive model. When I look at core usage, it always seem to be using only one core. Any idea what I\'m doing wro
Your problem is that you join each job immediately after you started it:
for g in grid:
p = multiprocessing.Process(target=worker, args=(g,GRID_hx))
jobs.append(p)
p.start()
p.join()
join blocks until the respective process has finished working. This means that your code starts only one process at once, waits until it is finished and then starts the next one.
In order for all processes to run in parallel, you need to first start them all and then join them all:
jobs = []
for g in grid:
p = multiprocessing.Process(target=worker, args=(g,GRID_hx))
jobs.append(p)
p.start()
for j in jobs:
j.join()
Documentation: link