1.1 --- a/examples/simple_create.py Sat Sep 15 15:57:18 2007 +0000
1.2 +++ b/examples/simple_create.py Sat Sep 15 15:57:34 2007 +0000
1.3 @@ -3,6 +3,9 @@
1.4 """
1.5 A simple example of parallel computation using message exchanges and the create
1.6 function.
1.7 +
1.8 +NOTE: We could use the with statement in the innermost loop to package the
1.9 +NOTE: try...finally functionality.
1.10 """
1.11
1.12 import pprocess
1.13 @@ -39,9 +42,7 @@
1.14
1.15 exchange.D = [0] * N * N
1.16
1.17 - # The parallel computation.
1.18 - # NOTE: Could use the with statement in the loop to package the
1.19 - # NOTE: try...finally functionality.
1.20 + # Perform the work.
1.21
1.22 print "Calculating..."
1.23 for i in range(0, N):
1.24 @@ -57,10 +58,12 @@
1.25
1.26 pprocess.exit(ch)
1.27
1.28 + # Wait for the results.
1.29 +
1.30 print "Finishing..."
1.31 exchange.finish()
1.32
1.33 - # Show the result.
1.34 + # Show the results.
1.35
1.36 print "Time taken:", time.time() - t
1.37 for i in range(0, N):