コード例 #1
0
ファイル: msg_rma.c プロジェクト: charlesarcher/fabtests
static int run(void)
{
	int i, ret = 0;

	if (!opts.dst_addr) {
		ret = server_listen();
		if (ret)
			return ret;
	}

	ret = opts.dst_addr ? client_connect() : server_connect();
	if (ret)
		return ret;

	ret = exchange_addr_key();
	if (ret)
		return ret;

	if (!(opts.user_options & FT_OPT_SIZE)) {
		for (i = 0; i < TEST_CNT; i++) {
			if (test_size[i].option > opts.size_option)
				continue;
			opts.transfer_size = test_size[i].size;
			init_test(&opts, test_name, sizeof(test_name));
			ret = run_test();
			if (ret)
				goto out;
		}
	} else {
		init_test(&opts, test_name, sizeof(test_name));
		ret = run_test();
		if (ret)
			goto out;
	}

	sync_test();
	wait_for_data_completion(scq, max_credits - credits);
	/* Finalize before closing ep */
	ft_finalize(ep, scq, rcq, FI_ADDR_UNSPEC);
out:
	fi_shutdown(ep, 0);
	free_ep_res();
	if (!opts.dst_addr)
		free_lres();
	fi_close(&dom->fid);
	fi_close(&fab->fid);
	return ret;
}
コード例 #2
0
ファイル: rdm_atomic.c プロジェクト: luomiao/fabtests
static int run(void)
{
	int i, ret = 0;
	
	ret = init_fabric();
	if (ret)
			return ret;

	ret = init_av();
	if (ret)
			goto out;

	ret = exchange_addr_key();
	if (ret)
		goto out;

	if (run_all_sizes) {
		for (i = 0; i < TEST_CNT; i++) {
			if (test_size[i].option > size_option)
				continue;
			init_test(test_size[i].size, test_name,
					sizeof(test_name), &transfer_size,
					&iterations);
			ret = run_test();
			if (ret) {
				fprintf(stderr, "Test failed at iteration %d, "
						"msg size %d\n", i, 
						transfer_size);
				goto out;
			}
		}
	} else {
		ret = run_test();
		if (ret)
			goto out;
	}	

	sync_test();

out:
	fi_shutdown(ep, 0);
	fi_close(&ep->fid);
	free_ep_res();
	fi_close(&dom->fid);
	fi_close(&fab->fid);
	
	return ret;
}
コード例 #3
0
ファイル: rdm_atomic.c プロジェクト: ajaykulk/fabtests
static int run(void)
{
	int i, ret = 0;
	
	ret = init_fabric();
	if (ret)
			return ret;

	ret = init_av();
	if (ret)
			goto out;

	ret = exchange_addr_key();
	if (ret)
		goto out;

	if (!(opts.user_options & FT_OPT_SIZE)) {
		for (i = 0; i < TEST_CNT; i++) {
			if (test_size[i].option > opts.size_option)
				continue;
			opts.transfer_size = test_size[i].size;
			init_test(&opts, test_name, sizeof(test_name));
			ret = run_test();
			if (ret)
				goto out;
		}
	} else {
		init_test(&opts, test_name, sizeof(test_name));
		ret = run_test();
		if (ret)
			goto out;
	}
	/* Finalize before closing ep */
	ft_finalize(ep, scq, rcq, remote_fi_addr);
out:
	free_ep_res();
	fi_close(&dom->fid);
	fi_close(&fab->fid);
	
	return ret;
}