def compute_workload(num_cores, num_flows, spread):
 sigma = fsum(spread[0:num_cores])
 workload = [trunc(((num_flows * x) / sigma)) for x in spread[0:num_cores]]
 while (sum(workload) < num_flows):
  finish = (workload[0] / spread[0])
  i = 0
  for x in range(1, num_cores):
   t = (workload[x] / spread[x])
   if (t < finish):
    finish = t
    i = x
  workload[i] += 1
 return workload

def compute_workload ( num_cores , num_flows , spread ) : sigma = fsum ( spread [ 0 : num_cores ] ) workload = [ trunc ( ( ( num_flows * x ) / sigma ) ) for x in spread [ 0 : num_cores ] ] while ( sum ( workload ) < num_flows ) : finish = ( workload [ 0 ] / spread [ 0 ] ) i = 0 for x in range ( 1 , num_cores ) : t = ( workload [ x ] / spread [ x ] ) if ( t < finish ) : finish = t i = x workload [ i ] += 1 return workload
compute workload for each individual worker num_flows: total number of flows to be processed num_cores: total number of workers available for processing the flows spread: relative performance of the each worker .