예제 #1
0
void ChannelServer::threadFunc()
{
    sync_test("start testing");
    smoke_test();
    sync_test("after smoke_test");
    allocate_same_name_twice();
    sync_test("after alloc_same_name_twice");
    send_data_stress_test_with_confirmation();
    sync_test("after send_data_stress_test_with_confirmation");
    send_data_stress_test_no_confirmation();
    sync_test("after send_data_stress_test_no_confirmation");
    //send_big_data_test();sync_test("after send_big_data_test");
    alloc_dealloc_stress_test_with_confirmation();
    sync_test("after alloc_dealloc_stress_test_with_confirmation");
    alloc_dealloc_stress_test_no_confirmation();
    sync_test("after alloc_dealloc_stress_test_no_confirmation");
    smoke_test();
    sync_test("after smoke_test_with_errors");
    if(alloc_empty_name())
    {
        sync_test("after alloc_empty_name");
    }
    else
    {
        LOG4CPLUS_FATAL(logger, "alloc_empty_name failed!");
        exit(1);
    }
    sync_test("end");
}
예제 #2
0
파일: bw.c 프로젝트: soniczhao/fabtests
static int run_test(void)
{
	int ret = 0, i;

	if ((ret = sync_test())) {
		goto out;
	}

	if (bidir || client) {
		gettimeofday(&start, NULL);
		for (i = 0; i < iterations; i++) {
			if ((ret = write_xfer(transfer_size))) {
				goto out;
			}
		}
		if ((ret = poll_all_sends())) {
			goto out;
		}
		gettimeofday(&end, NULL);
		show_perf();
	}

	if ((ret = sync_test())) {
		goto out;
	}

out:
	return ret;
}
예제 #3
0
   virtual void go()
   {
      LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);

      for (int i = 0; i < max_count; ++i)
      {
         UInt32 chid = allocChannel(ePlainData, this);
         sync_test("MultipleOpenCloseTest alloc sync");
         closeChannel(chid);
         sync_test("MultipleOpenCloseTest close sync");
      }
   }
예제 #4
0
파일: rstream.c 프로젝트: VinGorilla/gpunet
static int run_test(void)
{
	int ret, i, t;

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

	gettimeofday(&start, NULL);
	for (i = 0; i < iterations; i++) {
		for (t = 0; t < transfer_count; t++) {
			ret = dst_addr ? send_xfer(transfer_size) :
					 recv_xfer(transfer_size);
			if (ret)
				goto out;
		}

		for (t = 0; t < transfer_count; t++) {
			ret = dst_addr ? recv_xfer(transfer_size) :
					 send_xfer(transfer_size);
			if (ret)
				goto out;
		}
	}
	gettimeofday(&end, NULL);
	show_perf();
	ret = 0;

out:
	return ret;
}
예제 #5
0
static int run_test(void)
{
	int ret, i;

	ret = sync_test();
	if (ret)
		return ret;

	clock_gettime(CLOCK_MONOTONIC, &start);
	for (i = 0; i < opts.iterations; i++) {
		ret = opts.dst_addr ? send_xfer(opts.transfer_size) :
				 recv_xfer(opts.transfer_size);
		if (ret)
			return ret;

		ret = opts.dst_addr ? recv_xfer(opts.transfer_size) :
				 send_xfer(opts.transfer_size);
		if (ret)
			return ret;
	}
	clock_gettime(CLOCK_MONOTONIC, &end);

	if (opts.machr)
		show_perf_mr(opts.transfer_size, opts.iterations, &start, &end, 2, opts.argc, opts.argv);
	else
		show_perf(test_name, opts.transfer_size, opts.iterations, &start, &end, 2);

	return 0;
}
예제 #6
0
static int run_test(void)
{
	int ret, i;

	ret = sync_test();
	if (ret) {
		fprintf(stderr, "sync_test failed!\n");
		goto out;
	}

	ft_start();
	if (opts.dst_addr) {
		for (i = 0; i < opts.iterations; i++) {
			ret = ft_tx(ep, remote_fi_addr, opts.transfer_size, &tx_ctx);
			if (ret)
				goto out;
		}
	} else {
		ret = wait_for_recv_completion(opts.iterations);
		if (ret)
			goto out;
	}
	ft_stop();

	if (opts.machr)
		show_perf_mr(opts.transfer_size, opts.iterations,
			&start, &end, 1, opts.argc, opts.argv);
	else
		show_perf(test_name, opts.transfer_size, opts.iterations,
			&start, &end, 1);

out:
	return ret;
}
예제 #7
0
파일: rds.c 프로젝트: aclisp/myqperf
/*
 * Measure RDS bandwidth (server side).
 */
void
run_server_rds_bw(void)
{
    char *buf;
    int sockfd;

    sockfd = init();
    sync_test();
    buf = qmalloc(Req.msg_size);
    while (!Finished) {
        int n = read(sockfd, buf, Req.msg_size);
        if (Finished)
            break;
        if (n != Req.msg_size) {
            LStat.r.no_errs++;
            continue;
        }
        LStat.r.no_bytes += n;
        LStat.r.no_msgs++;
        if (Req.access_recv)
            touch_data(buf, Req.msg_size);
    }
    stop_test_timer();
    exchange_results();
    free(buf);
    close(sockfd);
}
예제 #8
0
파일: rds.c 프로젝트: aclisp/myqperf
/*
 * Measure RDS bandwidth (client side).
 */
void
run_client_rds_bw(void)
{
    char *buf;
    int sockfd;

    par_use(L_ACCESS_RECV);
    par_use(R_ACCESS_RECV);
    set_parameters(8*1024);
    client_send_request();
    sockfd = init();
    buf = qmalloc(Req.msg_size);
    sync_test();
    while (!Finished) {
        int n = sendto(sockfd, buf, Req.msg_size, 0, (SA *)&RAddr, RLen);

        if (Finished)
            break;
        if (n != Req.msg_size) {
            LStat.s.no_errs++;
            continue;
        }
        LStat.s.no_bytes += n;
        LStat.s.no_msgs++;
    }
    stop_test_timer();
    exchange_results();
    free(buf);
    close(sockfd);
    show_results(BANDWIDTH);
}
예제 #9
0
static int run_test(void)
{
	int ret, i;

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

	clock_gettime(CLOCK_MONOTONIC, &start);
	for (i = 0; i < iterations; i++) {
		ret = dst_addr ? send_xfer(transfer_size) :
				 recv_xfer(transfer_size);
		if (ret)
			goto out;

		ret = dst_addr ? recv_xfer(transfer_size) :
				 send_xfer(transfer_size);
		if (ret)
			goto out;
	}
	clock_gettime(CLOCK_MONOTONIC, &end);
	show_perf(test_name, transfer_size, iterations, &start, &end, 2);
	ret = 0;

out:
	return ret;
}
예제 #10
0
파일: aiocache.c 프로젝트: tridge/junkcode
int main(int argc, const char *argv[])
{
	const char *fname;
	int opt;
	int block_size = 1024*1024;
	int nblocks = 100;
	int rsize = 32*1024;

	while ((opt = getopt(argc, argv, "b:n:r:")) != -1) {
		switch (opt) {
		case 'b':
			block_size = strtol(optarg, NULL, 0);
			break;
		case 'n':
			nblocks = strtol(optarg, NULL, 0);
			break;
		case 'r':
			rsize = strtol(optarg, NULL, 0);
			break;
		default:
			printf("Invalid option '%c'\n", opt);
			usage();
			exit(1);
		}
	}

	argv += optind;
	argc -= optind;

	if (argc < 1) {
		usage();
		exit(1);
	}

	fname = argv[0];

	printf("Testing with block_size=%d nblocks=%d rsize=%d\n",
	       block_size,nblocks,rsize);
	
	async_test(fname, block_size, nblocks, rsize);
	sync_test(fname, rsize);
	async_test(fname, block_size, nblocks, rsize);
	sync_test(fname, rsize);

	return 0;	
}
예제 #11
0
   virtual void go()
   {
      LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);

      for (int i = 0; i < max_count; ++i)
      {
         UInt32 chid = allocChannel(ePlainData, this);
         //sync_test("DataLostAfterChannelAlloc alloc sync");

         int sem_res = data_sem.waitTimeout(timeout);
         assert(0 == sem_res && "data lost, sem exited by timeout");

         sync_test("DataLostAfterChannelAlloc data sync");

         closeChannel(chid);
         sync_test("DataLostAfterChannelAlloc close sync");
      }
   }
예제 #12
0
static int run_op(void)
{
	int ret, i;

	count = (size_t *) malloc(sizeof(size_t));
	sync_test();
	clock_gettime(CLOCK_MONOTONIC, &start);
	
	switch (op_type) {
	case FI_MIN:
	case FI_MAX:
	case FI_ATOMIC_READ:
	case FI_ATOMIC_WRITE:
		ret = is_valid_base_atomic_op(op_type);
		if (ret > 0) {
			for (i = 0; i < iterations; i++) {
				ret = execute_base_atomic_op(op_type);
				if (ret)
					break;
			}
		}

		ret = is_valid_fetch_atomic_op(op_type);
		if (ret > 0) {
			for (i = 0; i < iterations; i++) {
				ret = execute_fetch_atomic_op(op_type);
				if (ret)
					break;
			}
		}
		break;
	case FI_CSWAP:
		ret = is_valid_compare_atomic_op(op_type);
		if (ret > 0) {
			ret = execute_compare_atomic_op(op_type);
		} else {
			goto out;
		}
		break;
	default:
		ret = -EINVAL;
		goto out;
	}

	clock_gettime(CLOCK_MONOTONIC, &end);
	
	if (ret)
		goto out;
		
	show_perf(test_name, transfer_size, iterations, &start, &end, 2);
	ret = 0;

out:
	free(count);
	return ret;
}
예제 #13
0
static int run_test(void)
{
	int ret, i, t;
	off_t offset;
	uint8_t marker = 0;

	poll_byte = buf + transfer_size - 1;
	*poll_byte = -1;
	offset = riomap(rs, buf, transfer_size, PROT_WRITE, 0, 0);
	if (offset ==  -1) {
		perror("riomap");
		ret = -1;
		goto out;
	}
	ret = sync_test();
	if (ret)
		goto out;

	gettimeofday(&start, NULL);
	for (i = 0; i < iterations; i++) {
		if (dst_addr) {
			for (t = 0; t < transfer_count - 1; t++) {
				ret = send_xfer(transfer_size);
				if (ret)
					goto out;
			}
			*poll_byte = (uint8_t) marker++;
			ret = send_xfer(transfer_size);
			if (ret)
				goto out;

			ret = recv_xfer(transfer_size, marker++);
		} else {
			ret = recv_xfer(transfer_size, marker++);
			if (ret)
				goto out;

			for (t = 0; t < transfer_count - 1; t++) {
				ret = send_xfer(transfer_size);
				if (ret)
					goto out;
			}
			*poll_byte = (uint8_t) marker++;
			ret = send_xfer(transfer_size);
		}
		if (ret)
			goto out;
	}
	gettimeofday(&end, NULL);
	show_perf();
	ret = riounmap(rs, buf, transfer_size);

out:
	return ret;
}
예제 #14
0
   virtual void go()
   {
      LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);

      UInt8 data[1] = { 42 };

      for (int i = 0; i < max_count; ++i)
      {
         UInt32 chid = allocChannel(ePlainData, this);
         //sync_test("DataLostAfterChannelAlloc alloc sync");

         ERROR_CODE err = sendData(chid, data, 1);
         assert(ERR_OK == err && "sendData error");
         // if (ERR_OK != err)
         // {
         //    LOG4CPLUS_WARN(msLogger, "sendData err = " + covertIntegerToString((int)err));
         // }

         sync_test("DataLostAfterChannelAlloc data sync");

         closeChannel(chid);
         sync_test("DataLostAfterChannelAlloc close sync");
      }
   }
예제 #15
0
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;
}
예제 #16
0
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;
}
예제 #17
0
static int run_test(void)
{
	int ret, i;

	ret = sync_test();
	if (ret)
		return ret;

	clock_gettime(CLOCK_MONOTONIC, &start);
	for (i = 0; i < opts.iterations; i++) {
		switch (op_type) {
		case FT_RMA_WRITE:
			ret = write_data(opts.transfer_size);
			break;
		case FT_RMA_WRITEDATA:
			ret = write_data_with_cq_data(opts.transfer_size);
			if (ret)
				return ret;
			ret = wait_remote_writedata_completion();
			break;
		case FT_RMA_READ:
			ret = read_data(opts.transfer_size);
			break;
		}
		if (ret)
			return ret;

		ret = ft_wait_for_comp(txcq, 1);
		if (ret)
			return ret;
	}
	clock_gettime(CLOCK_MONOTONIC, &end);

	if (opts.machr)
		show_perf_mr(opts.transfer_size, opts.iterations, &start, &end,
				1, opts.argc, opts.argv);
	else
		show_perf(test_name, opts.transfer_size, opts.iterations,
				&start, &end, 1);

	return 0;
}
예제 #18
0
void ChannelServer::alloc_dealloc_stress_test_core(bool confirm)
{
    for (int i=0; i<gAttemptsLimit; i++)
    {
        iviLink::Error error = iviLink::Channel::allocateChannel((confirm? gMultipleAlDealC : gMultipleAlDeal)+convertIntegerToString(i), this, mCids[i]);
        if (!error.isNoError() || mCids[i]==0)
        {
            LOG4CPLUS_ERROR(logger, "alloc_dealloc_stress_test failed in allocation stage! Step No." + convertIntegerToString(i));
            return;
        }
        if (confirm)
        {
            mCliSyncSem.signal();
        }
    }
    if (confirm)
    {
        sync_test("alloc_dealloc_stress_test between stages");
    }
    mSrvSyncSem.wait();
}
예제 #19
0
파일: rds.c 프로젝트: aclisp/myqperf
/*
 * Measure RDS latency (client side).
 */
void
run_client_rds_lat(void)
{
    char *buf;
    int sockfd;

    set_parameters(1);
    client_send_request();
    sockfd = init();
    buf = qmalloc(Req.msg_size);
    sync_test();
    while (!Finished) {
        int n = sendto(sockfd, buf, Req.msg_size, 0, (SA *)&RAddr, RLen);

        if (Finished)
            break;
        if (n != Req.msg_size) {
            LStat.s.no_errs++;
            continue;
        }
        LStat.s.no_bytes += n;
        LStat.s.no_msgs++;

        n = read(sockfd, buf, Req.msg_size);
        if (Finished)
            break;
        if (n != Req.msg_size) {
            LStat.r.no_errs++;
            continue;
        }
        LStat.r.no_bytes += n;
        LStat.r.no_msgs++;
    }
    stop_test_timer();
    exchange_results();
    free(buf);
    close(sockfd);
    show_results(LATENCY);
}
예제 #20
0
파일: rds.c 프로젝트: aclisp/myqperf
/*
 * Measure RDS latency (server side).
 */
void
run_server_rds_lat(void)
{
    char *buf;
    int sockfd;

    sockfd = init();
    sync_test();
    buf = qmalloc(Req.msg_size);
    while (!Finished) {
        SS raddr;
        socklen_t rlen = sizeof(raddr);
        int n = recvfrom(sockfd, buf, Req.msg_size, 0, (SA *)&raddr, &rlen);

        if (Finished)
            break;
        if (n != Req.msg_size) {
            LStat.r.no_errs++;
            continue;
        }
        LStat.r.no_bytes += n;
        LStat.r.no_msgs++;

        n = sendto(sockfd, buf, Req.msg_size, 0, (SA *)&raddr, rlen);
        if (Finished)
            break;
        if (n != Req.msg_size) {
            LStat.s.no_errs++;
            continue;
        }
        LStat.s.no_bytes += n;
        LStat.s.no_msgs++;
    }
    stop_test_timer();
    exchange_results();
    free(buf);
    close(sockfd);
}
예제 #21
0
 ~Test()
 {
    sync_test("~Test()");
 }
예제 #22
0
 Test()
 {
    sync_test("Test()");
 }
예제 #23
0
static int run(void)
{
	int ret = 0;
	ret = init_fabric();
	if (ret)
		return ret;

	ret = init_av();
	if (ret)
		goto out;
	
	// Receiver
	if (opts.dst_addr) {
		// search for initial tag, it should fail since the sender 
		// hasn't sent anyting
		fprintf(stdout, "Searching msg with tag [%" PRIu64 "]\n", tag_data);
		tagged_search(tag_data);
		
		fprintf(stdout, "Posting buffer for msg with tag [%" PRIu64 "]\n", 
				tag_data + 1);
		ret = post_recv(tag_data + 1);
		if (ret)
			goto out;
		
		// synchronize with sender
		fprintf(stdout, "\nSynchronizing with sender..\n\n");
		ret = sync_test();
		if (ret)
			goto out;
		
		// wait for the completion event of the next tag
		ret = wait_for_tagged_completion(rcq, 1);
		if (ret)
			goto out;
		fprintf(stdout, "Received completion event for msg with tag "
				"[%" PRIu64 "]\n", tag_data + 1);
		
		// search again for the initial tag, it should be successful now
		fprintf(stdout,
			"Searching msg with initial tag [%" PRIu64 "]\n",
			tag_data);
		tagged_search(tag_data);
		
		// wait for the completion event of the initial tag
		ret = recv_msg(tag_data);	
		if (ret)
			goto out;
		fprintf(stdout, "Posted buffer and received completion event for"
			       " msg with tag [%" PRIu64 "]\n", tag_data);
	} else {
		// Sender	
		// synchronize with receiver
		fprintf(stdout, "Synchronizing with receiver..\n\n");
		ret = sync_test();
		if (ret)
			goto out;

		fprintf(stdout, "Sending msg with tag [%" PRIu64 "]\n",
			tag_data);
		ret = send_msg(16, tag_data);
		if (ret)
			goto out;

		fprintf(stdout, "Sending msg with tag [%" PRIu64 "]\n",
			tag_data + 1);
		ret = send_msg(16, tag_data + 1);
		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;
}