PEATSA/Core/Environment.py
def loadSkew(self, numberTasks):
	
		'''Computes the skew in the number of tasks to be processed by each node
		
		The skew is the standard deviation of the task number across the nodes'''				
										
		if Environment.isParallel:
			import pypar
			if self.isRoot():
				taskDistribution = [numberTasks]
				for i in range(1, pypar.size()):
					numberTasks = pypar.receive(i)
					taskDistribution.append(numberTasks)
				
				mean = reduce(operator.add, taskDistribution)
				mean = mean/float(len(taskDistribution))
				
				#Std. dev
				stdev = 0
				for el in taskDistribution:
					stdev = stdev + math.pow((el - mean), 2)
					
				skew = stdev/float(len(taskDistribution))
				skew = math.sqrt(skew)	
				
				for i in range(1, pypar.size()):
					pypar.send(skew, i)
				
			else:
				#Send the fragment
				pypar.send(numberTasks, 0)
				#Retrieve the array
				skew = pypar.receive(0)
		else:
			skew = 0								
										
		return skew
Computes the skew in the number of tasks to be processed by each node
		
		The skew is the standard deviation of the task number across the nodes
Computes the skew in the number of tasks to be processed by each node
The skew is the standard deviation of the task number across the nodes
Computes the skew in the number of tasks to be processed by each node The skew is the standard deviation of the task number across the nodes
def loadSkew(self, numberTasks):
		if Environment.isParallel:
			import pypar
			if self.isRoot():
				taskDistribution = [numberTasks]
				for i in range(1, pypar.size()):
					numberTasks = pypar.receive(i)
					taskDistribution.append(numberTasks)
				mean = reduce(operator.add, taskDistribution)
				mean = mean/float(len(taskDistribution))
				stdev = 0
				for el in taskDistribution:
					stdev = stdev + math.pow((el - mean), 2)
				skew = stdev/float(len(taskDistribution))
				skew = math.sqrt(skew)	
				for i in range(1, pypar.size()):
					pypar.send(skew, i)
			else:
				pypar.send(numberTasks, 0)
				skew = pypar.receive(0)
		else:
			skew = 0								
		return skew
def loadSkew ( self , numberTasks ) : if Environment . isParallel : import pypar if self . isRoot ( ) : taskDistribution = [ numberTasks ] for i in range ( 1 , pypar . size ( ) ) : numberTasks = pypar . receive ( i ) taskDistribution . append ( numberTasks ) mean = reduce ( operator . add , taskDistribution ) mean = mean / float ( len ( taskDistribution ) ) stdev = 0 for el in taskDistribution : stdev = stdev + math . pow ( ( el - mean ) , 2 ) skew = stdev / float ( len ( taskDistribution ) ) skew = math . sqrt ( skew ) for i in range ( 1 , pypar . size ( ) ) : pypar . send ( skew , i ) else : pypar . send ( numberTasks , 0 ) skew = pypar . receive ( 0 ) else : skew = 0 return skew
Computes the skew in the number of tasks to be processed by each node
The skew is the standard deviation of the task number across the nodes
Computes the skew in the number of tasks to be processed by each node The skew is the standard deviation of the task number across the nodes
'''Computes the skew in the number of tasks to be processed by each node
		
		The skew is the standard deviation of the task number across the nodes''' #Std. dev #Send the fragment #Retrieve the array
self
numberTasks