Let the user specify the number of real tries in each of the IPC tests.
Take the default number of real tries as 1000, as it was previously
hard-coded.
Change-Id: I016e1f38479ecf4a81ed72a38900e51ccae54231
int nprocs;
int msize;
+int n_real_tries;
int lt_cnt;
double min, max, total;
unsigned long long bw;
+ (unsigned long long)clock.tv_nsec;
}
- if(bw_cnt == REAL_TRY) {
+ if(bw_cnt == n_real_tries) {
clock_gettime (CLOCK_REALTIME, &clock);
end = (unsigned long long)clock.tv_sec * NS
+(unsigned long long)clock.tv_nsec;
GDBusNodeInfo *introspection_data = NULL;
introspection_data = g_dbus_node_info_new_for_xml (_interface_introspection_xml, NULL);
- state.iters = WARMUP_TRY + REAL_TRY;
+ state.iters = WARMUP_TRY + n_real_tries;
state.is_lt = is_lt;
state.buf = buf;
state.main_loop = g_main_loop;
g_assert(conn != NULL);
sleep(2);
- for(int i = 0; i < WARMUP_TRY + REAL_TRY; i++) {
+ for(int i = 0; i < WARMUP_TRY + n_real_tries; i++) {
struct timespec clock;
memset(cptr, 0, size);
if(nprocs == 1)
nprocs = 2;
+ n_real_tries = REAL_TRY;
msize = 3;
lt_on = bw_on = false;
- while((opt = getopt(argc, argv, "m:p:blhr")) != -1) {
+ while((opt = getopt(argc, argv, "m:p:blhrt:")) != -1) {
switch(opt) {
case 'm':
msize = atoi(optarg);
case 'l':
lt_on = true;
break;
+ case 't':
+ n_real_tries = atoi(optarg);
+ if (n_real_tries <= 0) {
+ printf("Number of real tries must be larger than 0\n");
+ exit(0);
+ }
+ break;
case 'r':
raw_data_on = true; /* dump raw data */
break;
int nprocs;
int msize;
+int n_real_tries;
int lt_cnt;
double min, max, total;
unsigned long long bw;
+ (unsigned long long)clock.tv_nsec;
}
- if(bw_cnt == REAL_TRY) {
+ if(bw_cnt == n_real_tries) {
clock_gettime (CLOCK_REALTIME, &clock);
end = (unsigned long long)clock.tv_sec * NS
+(unsigned long long)clock.tv_nsec;
exit(1);
}
- state.iters = WARMUP_TRY + REAL_TRY;
+ state.iters = WARMUP_TRY + n_real_tries;
state.is_lt = is_lt;
state.buf = buf;
dbus_connection_register_object_path (conn, path, &vtable, &state);
- //for(int i = 0; i < WARMUP_TRY + REAL_TRY; i++) {
+ //for(int i = 0; i < WARMUP_TRY + n_real_tries; i++) {
while(1) {
if(!dbus_connection_read_write_dispatch(conn, -1)) {
printf("read on parent error\n");
}
sleep(2);
- for(int i = 0; i < WARMUP_TRY + REAL_TRY; i++) {
+ for(int i = 0; i < WARMUP_TRY + n_real_tries; i++) {
struct timespec clock;
memset(cptr, 0, size);
if(nprocs == 1)
nprocs = 2;
+ n_real_tries = REAL_TRY;
msize = 3;
lt_on = bw_on = false;
- while((opt = getopt(argc, argv, "m:p:blhr")) != -1) {
+ while((opt = getopt(argc, argv, "m:p:blhrt:")) != -1) {
switch(opt) {
case 'm':
msize = atoi(optarg);
case 'p':
nprocs = atoi(optarg);
if(nprocs <= 0) {
- printf("The number of process should be larger than 0\n");
+ printf("The number of process must be larger than 0\n");
exit(0);
}
if(nprocs % 2 != 0) {
case 'l':
lt_on = true;
break;
+ case 't':
+ n_real_tries = atoi(optarg);
+ if (n_real_tries <= 0) {
+ printf("Number of real tries should be larger than 0\n");
+ exit(0);
+ }
+ break;
case 'r':
raw_data_on = true; /* dump raw data */
break;
case 't':
n_real_tries = atoi(optarg);
if (n_real_tries <= 0) {
- printf("Number of real tries should be larger than 0\n");
+ printf("Number of real tries must be larger than 0\n");
exit(0);
}
break;
int nprocs;
int msize;
+int n_real_tries;
int lt_cnt;
double min, max, total;
unsigned long long bw;
unsigned long long end;
register char *buf = (char *)malloc(size);
- for(int i = 0; i < WARMUP_TRY + REAL_TRY; i++) {
+ for(int i = 0; i < WARMUP_TRY + n_real_tries; i++) {
if(is_lt) {
if (read(rfd1, (void *)&start, sizeof(unsigned long long))
!= sizeof(unsigned long long)) {
+ (unsigned long long)clock.tv_nsec;
}
- if(bw_cnt == REAL_TRY) {
+ if(bw_cnt == n_real_tries) {
clock_gettime (CLOCK_REALTIME, &clock);
end = (unsigned long long)clock.tv_sec * NS
+(unsigned long long)clock.tv_nsec;
register char *cptr = (char *)malloc(size);
sleep(2);
- for(int i = 0; i < WARMUP_TRY + REAL_TRY; i++) {
+ for(int i = 0; i < WARMUP_TRY + n_real_tries; i++) {
int wres1, wres2;
struct timespec clock;
if(nprocs == 1)
nprocs = 2;
+ n_real_tries = REAL_TRY;
msize = 3;
lt_on = bw_on = false;
- while((opt = getopt(argc, argv, "m:p:blhr")) != -1) {
+ while((opt = getopt(argc, argv, "m:p:blhrt:")) != -1) {
switch(opt) {
case 'm':
msize = atoi(optarg);
case 'l':
lt_on = true;
break;
+ case 't':
+ n_real_tries = atoi(optarg);
+ if (n_real_tries <= 0) {
+ printf("Number of real tries must be larger than 0\n");
+ exit(0);
+ }
+ break;
case 'r':
raw_data_on = true; /* dump raw data */
break;
int nprocs;
int msize;
+int n_real_tries;
int lt_cnt;
double min, max, total;
unsigned long long bw;
register char read_cnt = 0;
register char *buf = (char *)malloc(size);
- for(int i = 0; i < WARMUP_TRY + REAL_TRY; i++) {
+ for(int i = 0; i < WARMUP_TRY + n_real_tries; i++) {
repeat:
if(r2[1] == read_cnt)
goto repeat;
+ (unsigned long long)clock.tv_nsec;
}
- if(bw_cnt == REAL_TRY) {
+ if(bw_cnt == n_real_tries) {
clock_gettime (CLOCK_REALTIME, &clock);
end = (unsigned long long)clock.tv_sec * NS
+(unsigned long long)clock.tv_nsec;
register char *cptr = (char *)malloc(size);
sleep(2);
- for(int i = 0; i < WARMUP_TRY + REAL_TRY; i++) {
+ for(int i = 0; i < WARMUP_TRY + n_real_tries; i++) {
struct timespec clock;
repeat:
if(w2[2] == write_cnt) {
if(nprocs == 1)
nprocs = 2;
+ n_real_tries = REAL_TRY;
msize = 3;
lt_on = bw_on = false;
- while((opt = getopt(argc, argv, "m:p:blrh")) != -1) {
+ while((opt = getopt(argc, argv, "m:p:blrht:")) != -1) {
switch(opt) {
case 'm':
msize = atoi(optarg);
case 'l':
lt_on = true;
break;
+ case 't':
+ n_real_tries = atoi(optarg);
+ if (n_real_tries <= 0) {
+ printf("Number of real tries must be larger than 0\n");
+ exit(0);
+ }
+ break;
case 'r':
raw_data_on = true; /* dump raw data */
break;
int nprocs;
int msize;
+int n_real_tries;
int lt_cnt;
double min, max, total;
unsigned long long bw;
unsigned long long end;
register char *buf = (char *)malloc(size);
- for(int i = 0; i < WARMUP_TRY + REAL_TRY; i++) {
+ for(int i = 0; i < WARMUP_TRY + n_real_tries; i++) {
if(is_lt) {
if (read(rfd1, (void *)&start, sizeof(unsigned long long))
!= sizeof(unsigned long long)) {
+ (unsigned long long)clock.tv_nsec;
}
- if(bw_cnt == REAL_TRY) {
+ if(bw_cnt == n_real_tries) {
clock_gettime (CLOCK_REALTIME, &clock);
end = (unsigned long long)clock.tv_sec * NS
+(unsigned long long)clock.tv_nsec;
register char *cptr = (char *)malloc(size);
sleep(2);
- for(int i = 0; i < WARMUP_TRY + REAL_TRY; i++) {
+ for(int i = 0; i < WARMUP_TRY + n_real_tries; i++) {
int wres1, wres2;
struct timespec clock;
if(nprocs == 1)
nprocs = 2;
+ n_real_tries = REAL_TRY;
msize = 3;
lt_on = bw_on = false;
- while((opt = getopt(argc, argv, "m:p:blrh")) != -1) {
+ while((opt = getopt(argc, argv, "m:p:blrht:")) != -1) {
switch(opt) {
case 'm':
msize = atoi(optarg);
case 'l':
lt_on = true;
break;
+ case 't':
+ n_real_tries = atoi(optarg);
+ if (n_real_tries <= 0) {
+ printf("Number of real tries must be larger than 0\n");
+ exit(0);
+ }
+ break;
case 'r':
raw_data_on = true; /* dump raw data */
break;