pgiri / dispy

Distributed and Parallel Computing Framework with / for Python
https://dispy.org
Other
266 stars 55 forks source link

[bug] dispynetrelay.py : Task(self.verify_broadcast, addrnifo, msg) #166

Closed niubaty closed 5 years ago

niubaty commented 5 years ago

In dispynetrelay.py :

Task(self.verify_broadcast, addrnifo, msg)

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pycos/__init__.py", line 3611, in _schedule
    retval = task._generator.send(task._value)
  File "dispynetrelay.py", line 183, in relay_udp_proc
    Task(self.verify_broadcast, addrnifo, msg)
NameError: global name 'addrnifo' is not defined

addrnifo might be addrinfo

niubaty commented 5 years ago

I'm a little confuse about the role of dispynetrelay. UDP broadcast packet can not forwarding through different network, so there should be a relay tell the dispynodes where the client(jobcluster) is. The client and dispynode must be reachable to each other in Layer 3( network layer of OSI 7 layer model ) Am I correct?

pgiri commented 5 years ago

UDP broadcast works only in local network. The use case for dispynetrelay is to use nodes in remote network. Assume that local network is 192.168.1.x and remote network is 10.1.1.x. To use nodes in 10.1.1.x, the client can either list all those nodes with nodes parameter (which may be inconvenient), or start dispynetrelay on some computer, say, on 10.1.1.5. Then client can use nodes=['*', '10.1.1.5']. dispy will then send client information to dispynetrelay at 10.1.1.5 which will broadcast this information to all nodes in 10.1.1.x which will then contact dispy client. If firewalls are used in either network, appropriate forwarding and possibly ext_ip_addr must be used.

niubaty commented 5 years ago

Thank you @pgiri