PEATSA/Core/Environment.py
def splitArray(self, array):
	
		'''Splits array between all the processes in the environment.
		
		Each process will be returned a different section of the array to work on'''
	
		if Environment.isParallel:
			import pypar
			#Split the array into sections and return the section for this processor
			divisions = []
			if self.isRoot():
				#Root does the splitting - we send each processor the start and end index
				#NOTE: pypar broadcast won't work even when setting vanilla
				#It always returns message trucated error.
				divisions = self._divideArray(array)	
				for i in range(1,pypar.size()):
					pypar.send(divisions[i], i)
				start = divisions[0][0]
				end = divisions[0][1]
			else:	
				indexes = pypar.receive(0)
				start = indexes[0]
				end = indexes[1]
				
			return array[start:end]
		else:
			return array
Splits array between all the processes in the environment.
		
		Each process will be returned a different section of the array to work on
Splits array between all the processes in the environment.
Each process will be returned a different section of the array to work on
Splits array between all the processes in the environment . Each process will be returned a different section of the array to work on
def splitArray(self, array):
		if Environment.isParallel:
			import pypar
			divisions = []
			if self.isRoot():
				divisions = self._divideArray(array)	
				for i in range(1,pypar.size()):
					pypar.send(divisions[i], i)
				start = divisions[0][0]
				end = divisions[0][1]
			else:	
				indexes = pypar.receive(0)
				start = indexes[0]
				end = indexes[1]
			return array[start:end]
		else:
			return array
def splitArray ( self , array ) : if Environment . isParallel : import pypar divisions = [ ] if self . isRoot ( ) : divisions = self . _divideArray ( array ) for i in range ( 1 , pypar . size ( ) ) : pypar . send ( divisions [ i ] , i ) start = divisions [ 0 ] [ 0 ] end = divisions [ 0 ] [ 1 ] else : indexes = pypar . receive ( 0 ) start = indexes [ 0 ] end = indexes [ 1 ] return array [ start : end ] else : return array
Splits array between all the processes in the environment.
Splits array between all the processes in the environment .
'''Splits array between all the processes in the environment.
		
		Each process will be returned a different section of the array to work on''' #Split the array into sections and return the section for this processor #Root does the splitting - we send each processor the start and end index #NOTE: pypar broadcast won't work even when setting vanilla #It always returns message trucated error.
self
array