Index: Pi/XPU/PiXpuMPI.py
===================================================================
--- Pi/XPU/PiXpuMPI.py	(revision 107)
+++ Pi/XPU/PiXpuMPI.py	(revision 108)
@@ -247,35 +247,41 @@
 
                         r=1
                         time_start=time.time()
-                        for Device in Devices:
-                            InputCL={}
-                            InputCL['Iterations']=IterationsMPI
-                            InputCL['Steps']=Redo
-                            InputCL['Blocks']=Blocks
-                            InputCL['Threads']=Threads
+                        # Distribution of Devices over nodes
+                        InputCL={}
+                        InputCL['Iterations']=IterationsMPI
+                        InputCL['Steps']=Redo
+                        InputCL['Blocks']=Blocks
+                        InputCL['Threads']=Threads
+                        InputCL['RNG']=RNG
+                        InputCL['ValueType']=ValueType
+                        for Device in Devices[1:]:
+                            print "Send to device %i on rank %i" % (Device,r)
                             InputCL['Device']=Device
-                            InputCL['RNG']=RNG
-                            InputCL['ValueType']=ValueType
-                            print "Send to device %i on rank %i" % (Device,r)
                             comm.send('CONTINUE',dest=r,tag=11)
                             comm.send(InputCL,dest=r,tag=11)
                             r+=1
 
-                        Inside=0
-                        NewIterations=0
-                        for slave in xrange(1,len(Devices)+1):
-                            print "slave %i" % slave
+                        # Compute on rank 0
+                        print "Compute on rank 0"
+                        InputCL['Device']=Devices[0]
+                        OutputCL=MetropolisOpenCL(InputCL)
+                        Inside=OutputCL['Inside']
+                        NewIterations=OutputCL['NewIterations']
+                            
+                        for slave in xrange(1,len(Devices)):
+                            print "Get OutputCL from %i" % slave
                             OutputCL=comm.recv(source=slave,tag=11)
-                            print "OutputCL from rank %s %s" % (slave,OutputCL)
+                            print OutputCL
                             NewIterations+=OutputCL['NewIterations']
                             Inside+=OutputCL['Inside']
 
                         Duration=time.time()-time_start
                         print "Pi estimation %.8f" % (4./NewIterations*Inside)
                     except:
-                        print "Problem with (%i,%i) // computations on OpenCL" % (Blocks,Threads)            
-            Duration=OutputCL['Duration']
-            NewIterations=OutputCL['NewIterations']
+                        print "Problem with (%i,%i) // computations on OpenCL" % (Blocks,Threads)
+            #Duration=OutputCL['Duration']
+            #NewIterations=OutputCL['NewIterations']
             Rate=NewIterations/Duration
             
             avgD=numpy.append(avgD,numpy.average(Duration))
@@ -307,10 +313,11 @@
             if Signal=='CONTINUE':
                 # Receive information from Master
                 InputCL=comm.recv(source=0,tag=11)
-                print "Parameters retreive from master %s " % InputCL
+                print "Parameters retreive for rank %s of %s on %s from master:" % (rank,RankSize,gethostname())
+                print "Input CL:" % InputCL
                 # Execute on slave
                 OutputCL=MetropolisOpenCL(InputCL)
-                print OutputCL
+                print "Output CL:" % OutputCL
                 # Send information to Master
                 comm.send(OutputCL,dest=0,tag=11)
                 print "Data sent to master"
