From: Stephane Genaud Date: Thu, 15 Sep 2011 14:47:42 +0000 (+0200) Subject: avoid anonymous print args X-Git-Tag: exp_20120216~195^2~30 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/33ad65963c7afda101f37e5c636b1d4742f2416a?ds=sidebyside avoid anonymous print args --- diff --git a/contrib/network_model/regress.py b/contrib/network_model/regress.py index 60f0dc36fb..6bffd97faa 100755 --- a/contrib/network_model/regress.py +++ b/contrib/network_model/regress.py @@ -1,6 +1,10 @@ #!/usr/bin/env python #--------------------------------------------------------------------------------------------------- +# Example invokation: +# % ./regress.py griffon_skampi_pt2pt.ski.dat 65536 120832 +# +# # Given two vectors of same length n: message size S(.. s_i ..), and communication time T( .. t_i .. ) # where t_i is the time associated to a mesage size s_i, computes the segmentation of the vectors # in 3 segments such that linear regressions on the 3 segments maximize correlation. @@ -25,7 +29,7 @@ from math import sqrt,log,exp if len(sys.argv) != 2 and len(sys.argv) != 4: print("Usage : {} datafile".format(sys.argv[0])) - print("or : {} datafile p1 p2".format(sys.argv[0])) + print("or : {0} datafile p1 p2".format(sys.argv[0])) print("where : p1 < p2 belongs to sizes in datafiles") sys.exit(-1) @@ -119,7 +123,6 @@ def correl_split_weighted_logerr( X , Y , segments ): Z.append( a * X[i] + b ) # compare real values and computed values e = mean_logerr( Y[start:stop+1] , Z ) - #print(" range [%d,%d] err=%f‰ weight=%f" % (X[start],X[stop],e,(stop-start+1)/len(X))) correl.append( (e, stop-start+1) ); # store correl. coef + number of values (segment length) interv.append( (a,b, X[start],X[stop],e) ); @@ -296,7 +299,8 @@ if len(sys.argv) == 4: for k in range(top_n_sol): (err,interval) = result[k] - print("\n RANK {}\n-------".format(k)) + print(k) + print("\n RANK {0}\n-------".format(k)) print("** overall metric = {0}".format(err)) for (a,b,i,j,e) in interval: print("** OPT: [{0} .. {1}] segment_metric={2} slope: {3} x + {4}".format(i,j,e,a,b))