Example #1
0
    lg.draw_frame(False)


pp = PdfPages('../plot/capacity_miss.pdf')
pp.savefig( bbox_inches='tight', dpi=300)
pp.close()
plt.close(fig)




# average offload

res_p, res_o = [], []
for ant in [2,4,6,8]:
    res = utils.read_pickle('../dump/proc_offload_%d.pkl'%ant)
    res_p.append(res[0][0])
    res_o.append(res[1][0])


orig_proc = [741, 927, 1113, 1299]

fig = plt.figure(figsize=(4*1.7, 3*1.7))
ax = plt.gca()
N = 4
ind = np.arange(N)+0.2  # the x locations for the groups
width = 0.15

rectso = ax.bar(ind, orig_proc, width, color = 'white', alpha=1, capsize=8, linewidth= 1, label='Original Proc')
rects1 = ax.bar(ind+0.15, res_p, width, color = 'darkgray', alpha=1, capsize=8, linewidth= 1, label='Local Proc')
rects2 = ax.bar(ind+0.3, res_o, width, color = 'black', alpha=1, capsize=8, linewidth= 1, label='Offload')
Example #2
0
    for exp in exp_range:
        for samples in samples_range:
            for nants in nant_range:
                for prior in prior_range:
                    for sched in sched_range:

                        # run the C code
                        args = ' -n %d -s 15000 -d %d -p 10 -S F -e O -D 0 -X %d -Y %d -Z %d'%(nants, dur, T_T, T_P, N_P)
                        print args
                        subprocess.check_call('../src/gd.o'+args, shell=True)
                        _,avg_proc,avg_offload =  main(exp, samples, nants, nprocs, prior, sched, T_T, T_P, N_P)

                        for idx, ntrans in enumerate(range(nants)):

                            arrt = utils.read_pickle('../dump/gstat_exp%s_samp%d_trans%d_prior%d_sched%s_nant%d_nproc%d_T_T%d_T_P%d_N_P%d'%(exp, samples, idx, prior, sched,nants, nprocs, T_T, T_P, N_P))


                        arrps, arros = [], []
                        for idx, nproc in enumerate(range(nprocs)):


                            arrp = utils.read_pickle('../dump/gstat_exp%s_samp%d_proc%d_prior%d_sched%s_nant%d_nproc%d_T_T%d_T_P%d_N_P%d'%(exp, samples, idx, prior, sched,nants, nprocs, T_T, T_P, N_P))

                            arro = utils.read_pickle('../dump/gstat_exp%s_samp%d_offload%d_prior%d_sched%s_nant%d_nproc%d_T_T%d_T_P%d_N_P%d'%(exp, samples, idx, prior, sched,nants, nprocs, T_T, T_P, N_P))

                            # analyse the logs
                            res, arrp, arro, _, _ = time_analysis(arrp, arro)

                            arrts.append([arrt['duration']])
                            arrps.append(arrp)
Example #3
0
    sched_range = ['SCHED_FIFO']
    nant_range = [4]
    nprocs = 3


    ##############################
    # slack cdf vs policy
    exp = 'plain'
    samples = 1000
    prior = 99
    sched_range = ['SCHED_FIFO', 'SCHED_RR', 'SCHED_OTHER']
    nants = 4

    stats = {}
    for sched in sched_range:
        obj = utils.read_pickle('../dump/gstat_exp%s_samp%d_prior%d_sched%s_nant%d_nproc%d'%(exp, samples, prior,sched,nants, nprocs))
        stats[sched] = astat(obj.proc['slack'])


    fig = plt.figure(figsize=(4*1.5, 3*1.5))
    ax = plt.gca()
    bins = np.linspace(-500, 2000, 1000)
    plt.plot(bins, stats['SCHED_FIFO'].get_cdf(bins), linewidth=4, label='FIFO')
    plt.plot(bins, stats['SCHED_RR'].get_cdf(bins), linewidth=4, label='RR', color='#999fff')
    plt.plot(bins, stats['SCHED_OTHER'].get_cdf(bins), linewidth=4, label='OTHER', color='black')

    # ax.set_yticks(np.arange(0,6,1))
    plt.xlabel('Slack (us)')
    plt.ylabel('CDF')
    plt.ylim(0,1)
    nospines(ax)
Example #4
0
    # for num_bss in num_bss_range:
    for num_bss in [4]:

        nprocs = int(num_bss*math.ceil(1.0*lmax/1000))
        num_cores_bs = int(math.ceil(1.0*lmax/1000))
        max_cores = int(math.ceil(1.0*lmax/1000))*num_bss


        y1, y11 = [], []
        for exp in exp_range:
            y,z = [],[]
            for rtt in rtt_range:

                exp_str = 'exp%s_var%d_nbss%d_nants%d_ncores%d_Lmax%d_snr%d_mcs%d_delay%d'%(exp, var,num_bss, num_ants, max_cores, lmax, snr, mcs, rtt)
                ress = utils.read_pickle('../dump/ress11_%s.pkl'%(exp_str))
                # if ress[exp_str][0] < 0.0001:
                #     ress[exp_str][0] = 0

                y.append(ress[exp_str][0])
                z.append(ress[exp_str][2])
            y1.append(y[:])
            y11.append(z[:])

        # global 16 cores
        y,z = [],[]
        for rtt in rtt_range:
            exp_str = 'exp%s_var%d_nbss%d_nants%d_ncores%d_Lmax%d_snr%d_mcs%d_delay%d'%('global', var,num_bss, num_ants, 16, lmax, snr, mcs, rtt)
            ress = utils.read_pickle('../dump/ress11_%s.pkl'%(exp_str))
            y.append(ress[exp_str][0])
            z.append(ress[exp_str][2])