示例#1
0
文件: bw.c 项目: soniczhao/fabtests
static void init_test(int size)
{
	transfer_size = size;
	if (!custom_iterations) {
		iterations = size_to_count(transfer_size);
	}
}
示例#2
0
static void init_test(int size)
{
	char sstr[5];

	size_str(sstr, sizeof sstr, size);
	snprintf(test_name, sizeof test_name, "%s_lat", sstr);
	transfer_size = size;
	iterations = size_to_count(transfer_size);
}
示例#3
0
void init_test(struct cs_opts *opts, char *test_name, size_t test_name_len)
{
    char sstr[FT_STR_LEN];

    size_str(sstr, opts->transfer_size);
    snprintf(test_name, test_name_len, "%s_lat", sstr);
    if (!(opts->user_options & FT_OPT_ITER))
        opts->iterations = size_to_count(opts->transfer_size);
}
示例#4
0
static void init_bandwidth_test(int size)
{
	char sstr[5];

	size_str(sstr, sizeof sstr, size);
	snprintf(test_name, sizeof test_name, "%s_bw", sstr);
	iterations = 1;
	transfer_size = size;
	transfer_count = size_to_count(transfer_size);
}
示例#5
0
文件: shared.c 项目: luomiao/fabtests
void init_test(int size, char *test_name, size_t test_name_len,
	int *transfer_size, int *iterations)
{
	char sstr[FI_STR_LEN];

	size_str(sstr, size);
	snprintf(test_name, test_name_len, "%s_lat", sstr);
	*transfer_size = size;
	*iterations = size_to_count(*transfer_size);
}
示例#6
0
static int ft_run_bandwidth(void)
{
	size_t recv_cnt;
	int ret, i;

	for (i = 0; i < ft_ctrl.size_cnt; i += ft_ctrl.inc_step) {
		ft_tx_ctrl.msg_size = ft_ctrl.size_array[i];
		if (ft_tx_ctrl.msg_size > fabric_info->ep_attr->max_msg_size)
			break;

		if (((test_info.class_function == FT_FUNC_INJECT) ||
			(test_info.class_function == FT_FUNC_INJECTDATA)) &&
			(ft_tx_ctrl.msg_size > fabric_info->tx_attr->inject_size))
			break;

		ft_ctrl.xfer_iter = test_info.test_flags & FT_FLAG_QUICKTEST ?
				5 : size_to_count(ft_tx_ctrl.msg_size);
		recv_cnt = ft_ctrl.xfer_iter;

		ret = ft_sync_test(0);
		if (ret)
			return ret;

		ret = ft_post_recv_bufs();
		if (ret)
			return ret;

		clock_gettime(CLOCK_MONOTONIC, &start);
		ret = (test_info.ep_type == FI_EP_DGRAM) ?
			ft_bw_dgram(&recv_cnt) : ft_bw();
		clock_gettime(CLOCK_MONOTONIC, &end);
		if (ret) {
			FT_PRINTERR("bw test failed!", ret);
			return ret;
		}

		show_perf("bw", ft_tx_ctrl.msg_size, recv_cnt, &start, &end, 1);
	}

	return 0;
}