Problem using dispynode

Help
Sebastian
2012-11-12
2016-02-06
  • Sebastian

    Sebastian - 2012-11-12

    Hi,

    I am working on your Dispy project.
    I tried to use Dispy on 3 beagleboard but we didn't succed to use Dispy correctly.

    I have 3 differents address which are :
    192.168.1.2 (node1)
    192.168.1.3 (node2)
    * 192.168.1.100 (master)

    I launched :
    (node1)#python dispynode.py -i 192.168.1.100
    (node2)#python dispynode.py -i 192.168.1.100

    But it doesn't work, I got the following error : "socket.error: [Errno 99] Cannot assign requested address"

    Then I tried
    (node1)#python dispynode.py -i 192.168.1.2
    (node2)#python dispynode.py -i 192.168.1.3

    It succced :
    2012-11-12 15:42:00,537 - dispynode - serving 2 cpus at 192.168.1.2:51348

    Then we launch the master :

    cluster=dispy.JobCluster('/bin/ls', nodes=['192.168.1.*'])
    cluster.stats()
    Node | CPUs | Jobs | Sec/Job | Node Time Sec


    192.168.1.2 (node1.local) | 2 | 0 | 0.000 | 0.000
    192.168.1.3 (node2.local) | 2 | 0 | 0.000 | 0.000

    But when I submit the programme,

    cluster.submit()

    node1@node1:~/Documents/dispy-3.6$ python dispynode.py -i 192.168.1.2 -d
    2012-11-12 17:14:22,292 - asyncoro - poller: epoll
    2012-11-12 17:14:22,293 - dispynode - auth_code for 192.168.1.2: dc4a6ef7ee6a101f20aa5b8a276d0793a8331121
    2012-11-12 17:14:22,293 - dispynode - serving 2 cpus at 192.168.1.2:51348
    2012-11-12 17:14:22,293 - dispynode - tcp server at 192.168.1.2:51348
    2012-11-12 17:14:22,316 - dispynode - dest_path for "/bin/ls": /tmp/dispy/b5dc04bf33a51b64
    2012-11-12 17:14:22,316 - dispynode - xfer_files given: /bin/ls
    2012-11-12 17:14:22,319 - dispynode - Copying file /bin/ls to /tmp/dispy/b5dc04bf33a51b64/ls (96284)
    2012-11-12 17:14:22,322 - dispynode - Copied file /tmp/dispy/b5dc04bf33a51b64/ls, ACK
    2012-11-12 17:14:35,608 - dispynode - New job id 1 from 192.168.1.100
    2012-11-12 17:14:35,615 - dispynode - Executing "['/tmp/dispy/b5dc04bf33a51b64/ls']"
    2012-11-12 17:14:35,621 - dispynode - Sending result for job 1 (10) to ('127.0.1.1', 51347)
    2012-11-12 17:14:35,622 - dispynode - Couldn't send results for 1 to ('127.0.1.1', 51347)
    2012-11-12 17:14:35,622 - dispynode - storing results for job 1
    The node try to send the job result to 127.0.1.1. So the result don't reach the master.

    When I execute dispynodes.py on the master, it works.

    import dispy
    cluster=dispy.JobCluster('/bin/ps', nodes=['192.168.1.*'])
    cluster.stats()
    ()
    Node | CPUs | Jobs | Sec/Job | Node Time Sec


    192.168.1.2 (node1.local) | 2 | 0 | 0.000 | 0.000
    ()
    Total job time: 0.000 sec
    ()

    job=cluster.submit()
    print job.stdout
    PID TTY TIME CMD
    17595 pts/5 00:00:00 bash
    23904 pts/5 00:00:00 python
    23924 pts/5 00:00:00 ps

    Did you already saw this problems and how do I can set up my cluster?
    Thank you for your help.

    Sebastian

     
  • Giridhar Pemmasani

    It looks to me as described in https://sourceforge.net/p/dispy/discussion/1771151/thread/27d60069/, the IP address for hostname in your case also is loop address 127.0.0.1 which can't be used for communicating with other machines. Using '-i' you can force different address (that is also configured to one of the network interfaces on that machine). Thus, starting node1 and node2 with '-i 192.168.1.100' does not work, as those nodes have different addresses. So next attempt at starting node1 and node2 with their configured addresses 192.168.1.1 and 192.168.1.2 worked for the nodes. Similarly, dispy client (what you call master) should use '192.168.1.100' as the IP address when dispy.JobCluster is initialized with

    cluster=dispy.JobCluster('/bin/ls', nodes='192.168.1.*', ip_addr='192.168.1.100')

    Without the ip_addr setup, the client uses 127.0.0.1 (which again is the IP address of hostname for master) as the return address for replies, which the nodes will use and that doesn't work.

     
    Last edit: Giridhar Pemmasani 2012-11-12
  • Sebastian

    Sebastian - 2012-11-13

    It works !
    I just change the ip_addr='192.168.1.100' parameter and my cluster is running.

    Thanks a lot for your help !

     
  • Abhijeet Thakurdesai

    hi ! my cluster of bbb was working fine in my college but when i bought it at home it didnt work!

    i have 2 addresses :
    192.168.0.105 (beaglebone black)
    192.168.0.104 (my pc with ubuntu 14.04)

    I performed the following steps :

    step 1 : on beaglebone black :

    abhijeet@abhijeet-desktop:~$ ssh root@192.168.0.105
    The authenticity of host '192.168.0.105 (192.168.0.105)' can't be established.
    ECDSA key fingerprint is c0:81:1a:f4:58:b9:51:15:00:df:ee:71:c4:d9:fd:54.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '192.168.0.105' (ECDSA) to the list of known hosts.
    Debian GNU/Linux 7
    
    BeagleBoard.org BeagleBone Debian Image 2014-04-23
    
    Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian
    Last login: Sat Feb  6 15:52:46 2016 from abhijeet-desktop.local
    
    root@beaglebone:~# dispynode.py -d -i 192.168.0.105
    2016-02-06 17:09:58,038 - dispynode - dispynode version 4.6.7
    2016-02-06 17:09:58,064 - asyncoro - poller: epoll
    2016-02-06 17:09:58,091 - dispynode - serving 1 cpus at 192.168.0.105:51348
    2016-02-06 17:09:58,093 - dispynode - tcp server at 192.168.0.105:51348
    2016-02-06 17:09:58,148 - asyncoro - waiting for 2 coroutines to terminate
    Enter "quit" or "exit" to terminate dispynode,
      "stop" to stop service, "start" to restart service,
      "cpus" to change CPUs used, anything else to get status: 
    

    so now the bbb is wating for jobs !

    step 2 : on my pc

    code :

    import dispy,time,logging
    
    def compute():
        return "hello"
    
    cluster=dispy.JobCluster(compute,nodes=["192.168.0.105"],ip_addr="192.168.0.104",loglevel=logging.DEBUG)
    
    time.sleep(1)
    
    cluster.stats()
    

    after running the above code i get output:

    2016-02-06 22:42:27,611 - asyncoro - poller: epoll
    2016-02-06 22:42:27,625 - dispy - dispy client at 192.168.0.104:51347
    2016-02-06 22:42:27,668 - dispy - Storing fault recovery information in "_dispy_20160206224227"
    2016-02-06 22:42:27,671 - dispy - Pending jobs: 0
    
                               Node |  CPUs |    Jobs |    Sec/Job | Node Time Sec
    ------------------------------------------------------------------------------
    
    Total job time: 0.000 sec
    
    2016-02-06 22:42:28,715 - dispy - shutting down scheduler ...
    2016-02-06 22:42:28,715 - dispy - scheduler quitting (0 / 0)
    2016-02-06 22:42:28,715 - dispy - scheduler quit
    Exception in thread Thread-1 (most likely raised during interpreter shutdown):
    Traceback (most recent call last):
      File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
      File "/usr/lib/python2.7/threading.py", line 763, in run
      File "/usr/local/lib/python2.7/dist-packages/asyncoro/__init__.py", line 3302, in _schedule
      File "/usr/local/lib/python2.7/dist-packages/asyncoro/__init__.py", line 1709, in poll
    <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'debug'
    

    what can be going wrong ?? please help me ! the node 192.168.0.105 is not visible after cluster.stats() ! i also tried route add default gw 192.168.0.1 but it didnt work.

     
    Last edit: Abhijeet Thakurdesai 2016-02-06

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks