title: Get a unique ID for worker in python multiprocessing pool
body: <p>Is there a way to assign each worker in a python multiprocessing pool a unique ID in a way that a job being run by a particular worker in the pool could know which worker is running it? According to the docs, a <code>Process</code> has a <code>name</code> but</p>
  
  <blockquote>
    <p>The name is a string used for identification purposes only. It has no
    semantics. Multiple processes may be given the same name.</p>
  </blockquote>
  
  <p>For my particular use-case, I want to run a bunch of jobs on a group of four GPUs, and need to set the device number for the GPU that the job should run on. Because the jobs are of non-uniform length, I want to be sure that I don't have a collision on a GPU of a job trying to run on it before the previous one completes (so this precludes pre-assigning an ID to the unit of work ahead of time).  </p>