def get_batch_stat (path, numSim):

  pkt_lat_tot_avg_array = []
  pkt_lat_tot_max_array = []
  pkt_lat_net_avg_array = []
  pkt_lat_net_max_array = []
  throughput_array = []
  deflect_array = []
  for sim_index in range(1, numSim+1, 1):
    input_file = path + "sim_" + str(sim_index) + ".out"
    exist = os.path.exists(input_file)
    if (exist is False):
      print "Fail to find " + str (sim_index) + ".out or its counterpart."
      continue

    stat = get.get_stat (input_file)
    [pkt_lat_tot_avg, pkt_lat_tot_max] = get.get_pkt_lat_tot (stat)
    pkt_lat_tot_avg_array.append(pkt_lat_tot_avg)
    pkt_lat_tot_max_array.append(pkt_lat_tot_max)
    [pkt_lat_net_avg, pkt_lat_net_max] = get.get_pkt_lat_net (stat)
    pkt_lat_net_avg_array.append(pkt_lat_net_avg)
    pkt_lat_net_max_array.append(pkt_lat_net_max)
    throughput = get.get_throughput(stat)
    throughput_array.append(throughput)
    deflect = get.get_deflect(stat)
    deflect_array.append(deflect)
  return pkt_lat_tot_avg_array, pkt_lat_net_avg_array, throughput_array, deflect_array
示例#2
0
for lat_avg, lat_max in zip(pkt_lat_tot_avg_array, pkt_lat_tot_max_array):
  inj_rate = inj_rate + 0.02
  print inj_rate, lat_avg, lat_max

print  "-------Packet Network Latency --------"

pkt_lat_tot_avg_array = []
pkt_lat_tot_max_array = []
for sim_index in range(1, 21, 1):
  input_file = dir_0 + "sim_" + str(sim_index) + ".out"
  exist = os.path.exists(input_file)
  if (exist is False):
    print "Fail to find " + str (sim_index) + ".out or its counterpart."
    continue
  stat = get.get_stat (input_file)
  [pkt_lat_tot_avg, pkt_lat_tot_max] = get.get_pkt_lat_net (stat)
  pkt_lat_tot_avg_array.append(pkt_lat_tot_avg)
  pkt_lat_tot_max_array.append(pkt_lat_tot_max)

print "injRate latAvg latMax"
inj_rate = 0
for lat_avg, lat_max in zip(pkt_lat_tot_avg_array, pkt_lat_tot_max_array):
  inj_rate = inj_rate + 0.02
  print inj_rate, lat_avg, lat_max

print "----------------------------------------------------------"
print "Multicast sweep under fixed unicast rate"
print "uc_rate = 0.1"
dir_0 = "../preliminary/synthSweep/mc/uc_0.1/"
pkt_lat_tot_avg_array = []
pkt_lat_tot_max_array = []