Index: NBody.py
===================================================================
--- NBody.py	(revision 127)
+++ NBody.py	(revision 128)
@@ -1,5 +1,4 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
 """
 Demonstrateur OpenCL d'interaction NCorps
 
@@ -13,7 +12,6 @@
 import pyopencl.array as cl_array
 from numpy.random import randint as nprnd
 
-
 BlobOpenCL= """
 #define znew  ((z=36969*(z&65535)+(z>>16))<<16)
 #define wnew  ((w=18000*(w&65535)+(w>>16))&65535)
@@ -209,24 +207,24 @@
     try:
         opts, args = getopt.getopt(sys.argv[1:],"hd:n:z:v:i:s:m:",["device=","number=","size=","velocity=","iterations=","step=","method="])
     except getopt.GetoptError:
-        print HowToUse % sys.argv[0]
+        print(HowToUse % sys.argv[0])
         sys.exit(2)
 
     for opt, arg in opts:
         if opt == '-h':
-            print HowToUse % sys.argv[0]
+            print(HowToUse % sys.argv[0])
 
-            print "\nInformations about devices detected under OpenCL:"
+            print("\nInformations about devices detected under OpenCL:")
             try:
                 Id=1
                 for platform in cl.get_platforms():
                     for device in platform.get_devices():
                         deviceType=cl.device_type.to_string(device.type)
-                        print "Device #%i from %s of type %s : %s" % (Id,platform.vendor.lstrip(),deviceType,device.name.lstrip())
+                        print("Device #%i from %s of type %s : %s" % (Id,platform.vendor.lstrip(),deviceType,device.name.lstrip()))
                         Id=Id+1
                 sys.exit()
             except ImportError:
-                print "Your platform does not seem to support OpenCL"
+                print("Your platform does not seem to support OpenCL")
                 sys.exit()
 
         elif opt in ("-d", "--device"):
@@ -244,13 +242,13 @@
         elif opt in ("-i", "--iterations"):
             Iterations=int(arg)
             
-    print "Device choosed : %s" % Device
-    print "Number of particules : %s" % Number
-    print "Size of Box : %s" % SizeOfBox
-    print "Initial velocity % s" % Velocity
-    print "Number of iterations % s" % Iterations
-    print "Step of iteration % s" % Step
-    print "Method of resolution % s" % Method
+    print("Device choosed : %s" % Device)
+    print("Number of particules : %s" % Number)
+    print("Size of Box : %s" % SizeOfBox)
+    print("Initial velocity % s" % Velocity)
+    print("Number of iterations % s" % Iterations)
+    print("Step of iteration % s" % Step)
+    print("Method of resolution % s" % Method)
     
     MyData = np.zeros(Number, dtype=cl_array.vec.float8)
 
@@ -261,12 +259,12 @@
             if Id==Device:
                 PlatForm=platform
                 XPU=device
-                print "CPU/GPU selected: ",device.name.lstrip()
+                print("CPU/GPU selected: ",device.name.lstrip())
                 HasXPU=True
             Id+=1
 
     if HasXPU==False:
-        print "No XPU #%i found in all of %i devices, sorry..." % (Device,Id-1)
+        print("No XPU #%i found in all of %i devices, sorry..." % (Device,Id-1))
         sys.exit()      
 
     # Je cree le contexte et la queue pour son execution
@@ -274,7 +272,7 @@
         ctx = cl.Context([XPU])
         queue = cl.CommandQueue(ctx,properties=cl.command_queue_properties.PROFILING_ENABLE)
     except:
-        print "Crash during context creation"
+        print("Crash during context creation")
    
 
     MyRoutines = cl.Program(ctx, BlobOpenCL).build()
@@ -291,12 +289,12 @@
     clData = cl.Buffer(ctx, mf.READ_WRITE, MyData.nbytes)
     #clData = cl.Buffer(ctx, mf.WRITE_ONLY|mf.COPY_HOST_PTR,hostbuf=MyData)
 
-    print 'Tous au meme endroit'
+    print('Tous au meme endroit')
 
 #    MyRoutines.SplutterPoints(queue,(Number,1),None,clDataIn,np.float32(SizeOfBox),np.float32(Velocity),np.uint32(nprnd(2**32)),np.uint32(nprnd(2**32)))
     MyRoutines.SplutterPoints(queue,(Number,1),None,clData,np.float32(SizeOfBox),np.float32(Velocity),np.uint32(110271),np.uint32(250173))
 
-    print 'Tous distribues'
+    print('Tous distribues')
  
     cl.enqueue_copy(queue, MyData, clData)
     t0=np.array([[MyData[0][0],MyData[0][1],MyData[0][2]]])
@@ -304,7 +302,7 @@
     tL=np.array([[MyData[-1][0],MyData[-1][1],MyData[-1][2]]])
 
     time_start=time.time()
-    for i in xrange(Iterations):
+    for i in range(Iterations):
         if Method=="RungeKutta":
             CLLaunch=MyRoutines.RungeKutta(queue,(Number,1),None,clData,np.float32(Step))
         else:
@@ -314,7 +312,7 @@
         t0=np.append(t0,[MyData[0][0],MyData[0][1],MyData[0][2]])
         t1=np.append(t1,[MyData[1][0],MyData[1][1],MyData[1][2]])
         tL=np.append(tL,[MyData[-1][0],MyData[-1][1],MyData[-1][2]])
-    print "\nDuration on %s for each %s" % (Device,(time.time()-time_start)/Iterations)
+    print("\nDuration on %s for each %s" % (Device,(time.time()-time_start)/Iterations))
     
     t0=np.transpose(np.reshape(t0,(Iterations+1,3)))
     t1=np.transpose(np.reshape(t1,(Iterations+1,3)))
