Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
abt-io
Commits
9edc44ce
Commit
9edc44ce
authored
May 22, 2020
by
Philip Carns
Browse files
consistent oflags, add fallocate
parent
def99ec4
Changes
1
Show whitespace changes
Inline
Side-by-side
examples/concurrent-write-bench.c
View file @
9edc44ce
...
...
@@ -21,6 +21,8 @@
#define O_DIRECT 0
#endif
#define OFLAGS (O_WRONLY|O_CREAT|O_DIRECT)
/* This is a simple benchmark that measures the
* streaming, concurrent, sequentially-issued write throughput for a
* specified number of concurrent operations. It includes an abt-io version and
...
...
@@ -175,12 +177,14 @@ static void abt_bench(int buffer_per_thread, unsigned int concurrency, size_t si
void
*
buffer
;
double
start
;
fd
=
open
(
filename
,
O
_WRONLY
|
O_CREAT
|
O_SYNC
|
O_DIRECT
,
S_IWUSR
|
S_IRUSR
);
fd
=
open
(
filename
,
O
FLAGS
,
S_IWUSR
|
S_IRUSR
);
if
(
!
fd
)
{
perror
(
"open"
);
assert
(
0
);
}
ret
=
fallocate
(
fd
,
0
,
0
,
10737418240UL
);
assert
(
ret
==
0
);
tid_array
=
malloc
(
concurrency
*
sizeof
(
*
tid_array
));
assert
(
tid_array
);
...
...
@@ -292,12 +296,14 @@ static void abt_bench_nb(int buffer_per_thread, unsigned int concurrency, size_t
abt_io_op_t
**
ops
;
ssize_t
*
wrets
;
fd
=
open
(
filename
,
O
_WRONLY
|
O_CREAT
|
O_SYNC
,
S_IWUSR
|
S_IRUSR
);
fd
=
open
(
filename
,
O
FLAGS
,
S_IWUSR
|
S_IRUSR
);
if
(
!
fd
)
{
perror
(
"open"
);
assert
(
0
);
}
ret
=
fallocate
(
fd
,
0
,
0
,
10737418240UL
);
assert
(
ret
==
0
);
/* initialize abt_io */
/* NOTE: for now we are going to use the same number of execution streams
...
...
@@ -382,12 +388,14 @@ static void pthread_bench(int buffer_per_thread, unsigned int concurrency, size_
void
*
buffer
;
double
start
;
fd
=
open
(
filename
,
O
_WRONLY
|
O_CREAT
|
O_SYNC
,
S_IWUSR
|
S_IRUSR
);
fd
=
open
(
filename
,
O
FLAGS
,
S_IWUSR
|
S_IRUSR
);
if
(
!
fd
)
{
perror
(
"open"
);
assert
(
0
);
}
ret
=
fallocate
(
fd
,
0
,
0
,
10737418240UL
);
assert
(
ret
==
0
);
id_array
=
malloc
(
concurrency
*
sizeof
(
*
id_array
));
assert
(
id_array
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment