I work on a shared cluster. I've seen people run parallelized c code on this cluster which, when I use top
to see what processes are running, are shown to be using (for example) 400% of the CPU, since they are using four processors for a single instance of their code.
Now someone is running (what I hear to be) a parallelized Python code. However, instead of top
showing the Python code to be using 400% of the CPU, it is being shown as four different processes, each using their own processor (at 100%).
I am wondering, does Python (when parallelized) show with top
as running as many different processes (as opposed to C) or is this Python code not actually running in parallel?
I don't know if Stack Exchange would be a better place for this question. Since I am using top
I figured this place would be better. Let me know if I should move it.
multiprocessing
module it uses processes for parallelization so no surprise you are seeing what you are seeing – iruvar Jun 14 '14 at 0:05multiprocessing
module allows one to create a process pool with an arbitrary of helper processes. The default value is equal to the number of processors on the box but this can be programmatically overridden – iruvar Jun 14 '14 at 0:13