using System; public class EPStream { movable fun( Channel( TimeSpan ) result ) { int m = 2000001; int n = 10; Random r = new Random(); double[] a = new double[m]; double[] b = new double[m]; double[] c = new double[m]; for ( int i = 0; i < m; i++ ) { b [i] = r.NextDouble(); c [i] = r.NextDouble(); } double alpha = r.NextDouble(); TimeSpan ts = new TimeSpan( Int32.MaxValue ); for ( int i = 0; i < n; i++ ) { DateTime from = DateTime.Now; for ( int j = 0; j < m; j++ ) a [j] = b [j] + alpha * c[j]; TimeSpan ts2 = DateTime.Now.Subtract( from ); if ( ts2 < ts ) ts = ts2; } result.Send( 24 * m * TimeSpan.TicksPerSecond * Math.Pow( 10, -9 ) / ts.Ticks ); } double GetResult() & Channel result( double performance ) { return performance; } public static void Main( string[] args ) { EPStream e = new EPStream(); for ( int i = 0; i < CommWorld.Size; i++ ) e.fun( e.result ); double performance = 0; for ( int i = 0; i < CommWorld.Size; i++ ) performance += e.GetResult(); Console.WriteLine( "Total performance: " + performance + " Gbytes/sec." ); } }