How to get worker (numeric) ID or processes (numeric) ID in a node?

I am submitting jobs to GPU node and each node will be fit by 4 jobs, so each job will see different set of GPUs: (0,1), (2,3), (4,5), (6,7). I need process ID or worker ID in numbers to determine the visible GPUs for each submitted job. How do I get these information? get_worker().id only gives encrypted worker ID in letters. Thanks.

Thanks for the question @llodds. IIUC you should be able to get what you want by running os.getpid() on each worker like this

In [1]: from distributed import Client

In [2]: c = Client()

In [3]: def get_pid():
   ...:     import os
   ...:     return os.getpid()

In [4]:
{'tcp://': 93100,
 'tcp://': 93099,
 'tcp://': 93101,
 'tcp://': 93102}