When using Parallel Python, is there a way to indicate which machine is running?

I wrote a simple program using parallel python and everything works fine. However, mainly for the sake of curiosity, I would like to know on which machine each task worked, and how much time has passed.

Is there a way to programmatically get this information for the returned job?

+3
source share
1 answer

A uuid1 can help:

>>> import uuid
>>> uuid.uuid1()
UUID('b46fa8cf-1fc1-11df-b891-001641ec3fab')
>>>

For more details see pydoc uuid and RFC 4122, I think the last 48 bits are unique to the host. Not sure if you are calling / returning this in Parallel python.

In pp.pyI found:

self.__stats[hostid] = _Statistics(ncpus, rworker)

get_stats() :

get_stats () .

+1

Source: https://habr.com/ru/post/1733803/


All Articles