Example #1
0
def report_c1_t1_mx_sub(root_dir, config_name, test_name, metric_name):
    global result_title
    global result_table
    global first_p
    result_dir = root_dir + "result/" + test_name + "/"
    driver.sure_to_exist(result_dir)
    db_fn = config_name + "--" + test_name + "--" + metric_name + ".json"
    db_filename = result_dir + db_fn
    if verbose_p:
        print("use " + db_filename)
    json_data = load_json_file(db_filename)
    title = get_title(json_data)
    if title[0] != 'TITLE':
        driver.data_error('report_c1_t1_mx_sub 0')
    bar = title[1]
    if first_p:
        result_title.extend(bar)
    else:
        result_title.extend(bar[3:])
    data_size = len(bar) - 1
    index = 0
    for row in json_data[1:]:
        bb = row[0]
        data = row[1]
        if len(data) != data_size:
            driver.data_error('report_c1_t1_mx_sub 1')
        if first_p:
            data.insert(0, bb)
            result_table.append(data)
        else:
            result_table[index].extend(data[2:])
        index += 1
    first_p = False
Example #2
0
def report1_entry(arg_list):
    global verbose_p
    metric_name_list = []
    size = len(arg_list)
    if size < 5:
        usage()
    index = 1
    root_dir = arg_list[index]
    index += 1
    if arg_list[index] == '--v':
        verbose_p = True
        index += 1
    if size < 4:
        usage()
    config_name = arg_list[index]
    index += 1
    test_name = arg_list[index]
    index += 1
    report_id = arg_list[index]
    index += 1
    while index < size:
        metric_name = arg_list[index]
        metric_name_list.append(metric_name)
        index += 1
    report_dir = root_dir + "report/" + test_name + "/"
    driver.sure_to_exist(report_dir)
    csv_fn = config_name + '--' + test_name + '--' + report_id + '.csv'
    csv_filename = report_dir + csv_fn
    report_c1_t1_mx(root_dir, config_name, test_name, metric_name_list, csv_filename)
Example #3
0
def hcqc_score_entry(arg_list):
    global verbose_p
    metric_name_list = []
    size = len(arg_list)
    if size < 4:
        usage()
    index = 1
    root_dir = arg_list[index]
    index += 1
    if arg_list[index] == '--v':
        verbose_p = True
        index += 1
    if size < 4:
        usage()
    config_name = arg_list[index]
    index += 1
    test_name = arg_list[index]
    index += 1
    while index < size:
        metric_name = arg_list[index]
        metric_name_list.append(metric_name)
        index += 1
    report_dir = root_dir + "report/" + test_name + "/"
    driver.sure_to_exist(report_dir)
    calculate_score(root_dir, config_name, test_name, metric_name_list)
Example #4
0
def report_m_entry(arg_list):
    global verbose_p
    config_name_list = []
    metric_name_list = []
    size = len(arg_list)
    if size < 8:
        usage()
    index = 1
    root_dir = arg_list[index]
    index += 1
    if arg_list[index] == '--v':
        verbose_p = True
        index += 1
    if size < 6:
        usage()
    report_name = arg_list[index]
    index += 1
    test_name = arg_list[index]
    index += 1
    if arg_list[index] != '--c':
        usage()
    index += 1
    while True:
        if index == size:
            usage()
        config_name = arg_list[index]
        index += 1
        if config_name == '--m':
            break
        config_name_list.append(config_name)
    if index == size:
        usage()
    while index < size:
        metric_name = arg_list[index]
        metric_name_list.append(metric_name)
        index += 1
    report_dir = root_dir + "report/" + test_name + "/"
    driver.sure_to_exist(report_dir)
    c_list = '--'.join(config_name_list)
    csv_fn = report_name + '--' + test_name + '--' + c_list + '.csv'
    csv_filename = report_dir + csv_fn
    if verbose_p:
        print(config_name_list)
        print(metric_name_list)
    global_title = make_global_title(root_dir, test_name, config_name_list,
                                     metric_name_list, csv_filename)
    report_t1_cl_ml(root_dir, test_name, config_name_list, metric_name_list,
                    csv_filename, global_title)
Example #5
0
def report_t1_cl_ml_sub(root_dir, config_name, test_name, metric_name,
                        part_global_title, first_p):
    global result_table
    global verbose_p
    global only_summary_p
    result_dir = root_dir + "result/" + test_name + "/"
    driver.sure_to_exist(result_dir)
    db_fn = config_name + "--" + test_name + "--" + metric_name + ".json"
    db_filename = result_dir + db_fn
    if verbose_p:
        print("use " + db_filename)
    json_data = load_json_file(db_filename)
    title = get_title(json_data)
    if title[0] != 'TITLE':
        driver.data_error('report_t1_cl_ml_sub 0')
    bar = title[1]
    fix_bar = None
    if first_p:
        fix_bar = bar
    else:
        # Skip "CFG", "SIZE" and "DEPTH"
        fix_bar = bar[3:]
    data_size = len(bar) - 1
    index = 0
    row_list = json_data[1:]
    if only_summary_p:
        row_list = row_list[-1:]
    for row in row_list:
        bb = row[0]
        data = row[1]
        if len(data) != data_size:
            driver.data_error('report_t1_cl_ml_sub 1')
        fix_data = None
        if first_p:
            fix_data = [bb]
            fix_data.extend(data)
        else:
            # Skip BB
            fix_data = data[1:]
        if len(fix_data) != len(fix_bar):
            driver.data_error('report_t1_cl_ml_sub 2')
        fix_data = pad_data(fix_bar, fix_data, part_global_title)
        if first_p:
            result_table.append(fix_data)
        else:
            result_table[index].extend(fix_data)
        index += 1
Example #6
0
def make_global_title_sub(root_dir, config_name, test_name, metric_name,
                          first_p):
    global result_title
    result_dir = root_dir + "result/" + test_name + "/"
    driver.sure_to_exist(result_dir)
    db_fn = config_name + "--" + test_name + "--" + metric_name + ".json"
    db_filename = result_dir + db_fn
    if verbose_p:
        print("use " + db_filename)
    json_data = load_json_file(db_filename)
    title = get_title(json_data)
    if title[0] != 'TITLE':
        driver.data_error('make_global_title_sub')
    bar = title[1]
    if first_p:
        result_title.extend(bar)
    else:
        result_title.append(-1)
        result_title.extend(bar[2:])
Example #7
0
def calculate_score_sub(root_dir, config_name, test_name, metric_name):
    global first_p
    score = 0
    if first_p:
        score += get_dynamic_score(root_dir, test_name, config_name, metric_name)
        first_p = False
    result_dir = root_dir + "result/" + test_name + "/"
    driver.sure_to_exist(result_dir)
    db_fn = config_name + "--" + test_name + "--" + metric_name + ".json"
    db_filename = result_dir + db_fn
    if verbose_p:
        print("use " + db_filename)
    json_data = load_json_file(db_filename)
    title = get_title(json_data)
    if title[0] != 'TITLE':
        driver.data_error('calculate_score_sub 0')
    bar = title[1]
    if verbose_p:
        print(bar)
    data_size = len(bar) - 1
    if json_data[-1][0] != '*SUMMARY*':
        driver.data_error('calculate_score_sub 1')
    for row in json_data[1:-1]:
        bb = row[0]
        data = row[1]
        if len(data) != data_size:
            driver.data_error('calculate_score_sub 1')
        size = data[0]
        depth = data[1]
        if verbose_p:
            print("size=" + size + ",depth=" + depth)
        index = 3
        for d in data[2:]:
            c = bar[index]
            if verbose_p:
                print("index=" + str(index) + ",bar=" + c + ",d=" + d)
            score += get_term_score(metric_name, depth, c, d)
            index += 1
    return score