[Pvfs2-cvs] commit by pcarns in pvfs2-1/test/io/trove:
trove-bench-concurrent.c
CVS commit program
cvs at parl.clemson.edu
Mon Jan 11 16:57:55 EST 2010
Update of /projects/cvsroot/pvfs2-1/test/io/trove
In directory parlweb1:/tmp/cvs-serv21336
Modified Files:
trove-bench-concurrent.c
Log Message:
add read support to trove concurrent I/O benchmark
Index: trove-bench-concurrent.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/test/io/trove/trove-bench-concurrent.c,v
diff -p -u -r1.3 -r1.4
--- trove-bench-concurrent.c 5 Jan 2010 16:45:01 -0000 1.3
+++ trove-bench-concurrent.c 11 Jan 2010 21:57:54 -0000 1.4
@@ -168,16 +168,25 @@ static int do_trove_test(char* dir)
tmp_op = qlist_entry(tmp_link, struct bench_op,
list_link);
- /* only writes for now */
- assert(tmp_op->type == WRITE);
-
- /* post operation */
total_size += tmp_op->size;
assert(tmp_buffer->size <= tmp_buffer->size);
- ret = trove_bstream_write_list(1, 1, &tmp_buffer->buffer,
- &tmp_op->size, 1, &tmp_op->offset, &tmp_op->size, 1,
- &out_size, TROVE_SYNC, NULL, tmp_buffer, trove_context, &op_id,
- NULL);
+
+ if(tmp_op->type == WRITE)
+ {
+ /* post operation */
+ ret = trove_bstream_write_list(1, 1, &tmp_buffer->buffer,
+ &tmp_op->size, 1, &tmp_op->offset, &tmp_op->size, 1,
+ &out_size, TROVE_SYNC, NULL, tmp_buffer, trove_context, &op_id,
+ NULL);
+ }
+ else
+ {
+ /* post operation */
+ ret = trove_bstream_read_list(1, 1, &tmp_buffer->buffer,
+ &tmp_op->size, 1, &tmp_op->offset, &tmp_op->size, 1,
+ &out_size, 0, NULL, tmp_buffer, trove_context, &op_id,
+ NULL);
+ }
inflight++;
assert(ret == 0);
@@ -252,9 +261,12 @@ int main(int argc, char *argv[])
tmp_op = malloc(sizeof(*tmp_op));
assert(tmp_op);
- /* only writes for now */
- assert(strcmp(op_string, "write") == 0);
- tmp_op->type = WRITE;
+ if(strcmp(op_string, "write") == 0)
+ tmp_op->type = WRITE;
+ else if(strcmp(op_string, "read") == 0)
+ tmp_op->type = READ;
+ else
+ assert(0);
tmp_op->offset = offset;
tmp_op->size = size;
qlist_add_tail(&tmp_op->list_link, &op_list);
More information about the Pvfs2-cvs
mailing list