From 6fa2180e9b32d068020859a3922cadf48f7b2547 Mon Sep 17 00:00:00 2001 From: Pramod R Sanaga Date: Wed, 11 Jul 2007 19:34:54 +0000 Subject: [PATCH] Added error notification when incorrect delay offset is detected in the cross-correlation checks. This should completely take care of detecting the faulty TCP runs we saw last week. --- pelab/SanityCheck.py | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/pelab/SanityCheck.py b/pelab/SanityCheck.py index 9eab5a069..f545660c7 100755 --- a/pelab/SanityCheck.py +++ b/pelab/SanityCheck.py @@ -538,13 +538,28 @@ def CalcCorrelationFFT(InFile1, InFile2, transportFlag, plabAvg, elabAvg): # Calculate the denominator sx = 0 sy = 0 + x_meandiff = 0 + y_meandiff = 0 + x_variance = 0.0 + y_variance = 0.0 for i in range(0,n): #{ - sx += (x[i] - mx) * (x[i] - mx) - sy += (y[i] - my) * (y[i] - my) + x_meandiff = x[i] - mx + y_meandiff = y[i] - my + + x_meandiff *= x_meandiff + y_meandiff *= y_meandiff + + sx += x_meandiff + sy += y_meandiff + + x_variance += x_meandiff + y_variance += y_meandiff #} + x_variance /= float(n) + y_variance /= float(n) denom = math.sqrt(sx*sy) @@ -692,8 +707,6 @@ def CalcCorrelation(InFile1, InFile2, transportFlag, plabAvg, elabAvg): for delay in range(-maxdelay,maxdelay): #{ sxy = 0 - sys.stdout.write("\$") - sys.stdout.flush() for i in range(0,n): #{ @@ -837,6 +850,16 @@ def PrintReport(correlationDataFile, numNodes, numNodesProcessed, reportFileName errorFlag = 1 #} +# Check the delay offset by comparing it against the sum +# of Emulab-to-Planetlab RTT + Planetlab internode RTT. +# Not implemented yet. + if ( ( int(matchObj.group(4)) ) and ( float (matchObj.group(1)) > 0.0 ) and ( int(matchObj.group(2)) == 0 ) ) : + + #{ + print "\n***** ERROR: This Flexlab run is possibly tainted. \nDetected " + matchObj.group(3) + " cross-correlation mismatch for files '" + flexLabFile + "' and '" + pLabFile + "'" + reportFileHandle.write( "***** ERROR: This Flexlab run is possibly tainted. \nDetected " + matchObj.group(3) + " cross-correlation mismatch for files '" + flexLabFile + "' and '" + pLabFile + "'\n") + errorFlag = 1 + #} #} -- GitLab