Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get ID of Dask worker from within a task

Is there a worker ID, or some unique identifier that a dask worker can access programmatically from within a task?

like image 342
MRocklin Avatar asked Jan 03 '19 18:01

MRocklin


Video Answer


1 Answers

Yes, you can use the get_worker function to access the worker that you're on currently, and then grab the id attribute.

from dask.distributed import get_worker
get_worker().id
like image 61
MRocklin Avatar answered Sep 20 '22 00:09

MRocklin