def plot(tr_unit_prof_df, info_df, unit_info_df, pilot_info_df, sid):

    print "Plotting %s ..." % sid

    labels = []

    # Legend info
    info = info_df.loc[sid]

    mpi = get_mpi(unit_info_df, sid)
    #mpi = True
    # For this call assume that there is only one pilot per session
    lms = get_lm(unit_info_df, pilot_info_df, sid, mpi)
    assert len(lms) == 1
    launch_method = lms.values()[0]

    # For this call assume that there is only one pilot per session
    spawners = get_spawners(unit_info_df, pilot_info_df, sid)
    assert len(spawners) == 1
    spawner = spawners.values()[0]

    # For this call assume that there is only one pilot per session
    resources = get_resources(unit_info_df, pilot_info_df, sid)
    assert len(resources) == 1
    resource_label = resources.values()[0]

    # Get only the entries for this session
    uf = unit_info_df[unit_info_df['sid'] == sid]

    result = pd.value_counts(uf['state'].values, sort=False)
    print result

    ax = result.plot(kind='pie', autopct='%.2f%%')
    ax.set_aspect('equal')

    print info
    #mp.pyplot.legend(labels, loc='upper left', fontsize=5)
    mp.pyplot.title("%s (%s)\n"
                    "%d CUs of %d core(s) with a %ds payload on a %d core pilot on %s.\n"
                    "%d sub-agent(s) with %d ExecWorker(s) each. All times are per CU.\n"
                    "RP: %s - RS: %s - RU: %s"
                   % (sid, time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime(info['created'])),
                      info['metadata.cu_count'], info['metadata.cu_cores'], info['metadata.cu_runtime'], info['metadata.pilot_cores'], resource_label,
                      info['metadata.num_sub_agents'], info['metadata.num_exec_instances_per_sub_agent'],
                      info['metadata.radical_stack.rp'], info['metadata.radical_stack.rs'], info['metadata.radical_stack.ru']
                      ), fontsize=8)

    mp.pyplot.savefig('%s_plot_states.pdf' % sid)
    mp.pyplot.close()
Ejemplo n.º 2
0
def plot(tr_unit_prof_df, info_df, unit_info_df, pilot_info_df, sid):

    print "Plotting %s ..." % sid

    labels = []

    # Legend info
    info = info_df.loc[sid]

    mpi = get_mpi(unit_info_df, sid)
    #mpi = True
    # For this call assume that there is only one pilot per session
    lms = get_lm(unit_info_df, pilot_info_df, sid, mpi)
    assert len(lms) == 1
    launch_method = lms.values()[0]

    # For this call assume that there is only one pilot per session
    spawners = get_spawners(unit_info_df, pilot_info_df, sid)
    assert len(spawners) == 1
    spawner = spawners.values()[0]

    # For this call assume that there is only one pilot per session
    resources = get_resources(unit_info_df, pilot_info_df, sid)
    assert len(resources) == 1
    resource_label = resources.values()[0]

    # Get only the entries for this session
    uf = unit_info_df[unit_info_df['sid'] == sid]

    # Get only the entries for this session
    tuf = tr_unit_prof_df[tr_unit_prof_df['sid'] == sid]

    result = pd.value_counts(tuf['aec_complete'].notnull(), sort=False)

    # result = pd.value_counts(uf['state'].values, sort=False)
    print result

    # Only take completed CUs into account
    #tuf = tuf[tuf['Done'].notnull()]

    #print tuf['aec_after_exec']
    #print tuf['aec_complete']

    #print 'c:', c

    ax = result.plot(kind='pie', autopct='%.2f%%')
    ax.set_aspect('equal')

    print info
    #mp.pyplot.legend(labels, loc='upper left', fontsize=5)
    mp.pyplot.title(
        "%s (%s)\n"
        "%d CUs of %d core(s) with a %ds payload on a %d core pilot on %s.\n"
        "%d sub-agent(s) with %d ExecWorker(s) each. All times are per CU.\n"
        "RP: %s - RS: %s - RU: %s" %
        (sid,
         time.strftime("%a, %d %b %Y %H:%M:%S +0000",
                       time.gmtime(info['created'])),
         info['metadata.cu_count'], info['metadata.cu_cores'],
         info['metadata.cu_runtime'], info['metadata.pilot_cores'],
         resource_label, info['metadata.num_sub_agents'],
         info['metadata.num_exec_instances_per_sub_agent'],
         info['metadata.radical_stack.rp'], info['metadata.radical_stack.rs'],
         info['metadata.radical_stack.ru']),
        fontsize=8)

    mp.pyplot.savefig('%s_plot_states.pdf' % sid)
    mp.pyplot.close()
Ejemplo n.º 3
0
def plot(tr_unit_prof_df, info_df, unit_info_df, pilot_info_df, sid):

    print "Plotting %s ..." % sid

    labels = []

    # Legend info
    info = info_df.loc[sid]

    mpi = get_mpi(unit_info_df, sid)
    #mpi = True
    # For this call assume that there is only one pilot per session
    lms = get_lm(unit_info_df, pilot_info_df, sid, mpi)
    assert len(lms) == 1
    launch_method = lms.values()[0]

    # For this call assume that there is only one pilot per session
    spawners = get_spawners(unit_info_df, pilot_info_df, sid)
    assert len(spawners) == 1
    spawner = spawners.values()[0]

    #exit()

    # For this call assume that there is only one pilot per session
    resources = get_resources(unit_info_df, pilot_info_df, sid)
    assert len(resources) == 1
    resource_label = resources.values()[0]

    # Get only the entries for this session
    tuf = tr_unit_prof_df[tr_unit_prof_df['sid'] == sid]

    tuf = tuf[tuf['Done'].notnull()]

    # We sort the units based on the order ...
    #tufs = tuf.sort('awo_get_u_pend') # they arrived at the agent
    #tufs = tuf.sort('aec_work_u_pend') # they are picked up by an EW
    tufs = tuf.sort('asc_put_u_pend') # they are scheduled
    #tufs = tuf.sort('asc_get_u_pend') # the are picked up by the scheduler

    ax = (tufs['asc_released'] - tufs['asc_allocated'] - info['metadata.cu_runtime']).plot(kind='line', color='red')
    labels.append("Core Occupation overhead")

    ax = (tufs['aec_after_exec'] - tufs['aec_after_cd'] - info['metadata.cu_runtime']).plot(kind='line', color='orange')
    labels.append('%s LaunchMethod (%s)' % ('MPI' if mpi else 'Task', launch_method))

    ax = (tufs['aec_start_script'] - tufs['aec_handover']).plot(kind='line', color='black')
    labels.append("Spawner (%s)" % spawner)

    (tufs['asc_get_u_pend'] - tufs['asic_put_u_pend']).plot(kind='line', color='blue')
    labels.append("Scheduler Queue")

    ax = (tufs['aec_work_u_pend'] - tufs['asc_put_u_pend']).plot(kind='line', color='green')
    labels.append("ExecWorker Queue")

    ax = (tufs['asc_released'] - tufs['aec_complete']).plot(kind='line', color='magenta')
    labels.append("Postexec")

    mp.pyplot.legend(labels, loc='upper left', fontsize=5)
    mp.pyplot.title("%s (%s)\n"
                    "%d CUs of %d core(s) with a %ds payload on a %d core pilot on %s.\n"
                    "%d sub-agent(s) with %d ExecWorker(s) each. All times are per CU.\n"
                    "RP: %s - RS: %s - RU: %s"
                   % (sid, time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime(info['created'])),
                      info['metadata.cu_count'], info['metadata.cu_cores'], info['metadata.cu_runtime'], info['metadata.pilot_cores'], resource_label,
                      info['metadata.num_sub_agents'], info['metadata.num_exec_instances_per_sub_agent'],
                      info['metadata.radical_stack.rp'], info['metadata.radical_stack.rs'], info['metadata.radical_stack.ru']
                      ), fontsize=8)
    mp.pyplot.xlabel("Compute Units (ordered by agent arrival)")
    mp.pyplot.ylabel("Time (s)")
    mp.pyplot.ylim(-0.01)
    ax.get_xaxis().set_ticks([])

    mp.pyplot.savefig('%s_plot1.pdf' % sid)
    mp.pyplot.close()