Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sds-tests
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sds
sds-tests
Commits
ae4511fb
Commit
ae4511fb
authored
Jan 27, 2019
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make abt pool if requested
parent
ff616d5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
2 deletions
+65
-2
perf-regression/pmdk-bw.c
perf-regression/pmdk-bw.c
+65
-2
No files found.
perf-regression/pmdk-bw.c
View file @
ae4511fb
...
...
@@ -17,9 +17,9 @@
#include <errno.h>
#include <stdlib.h>
#include <mpi.h>
#include <abt.h>
#include <libpmemobj.h>
struct
options
{
...
...
@@ -47,6 +47,7 @@ static void usage(void);
static
struct
options
g_opts
;
static
char
*
g_buffer
=
NULL
;
static
ABT_pool
g_transfer_pool
;
static
int
run_benchmark
(
struct
options
*
opts
);
static
void
bench_worker
(
void
*
_arg
);
...
...
@@ -54,6 +55,11 @@ static void bench_worker(void *_arg);
int
main
(
int
argc
,
char
**
argv
)
{
int
ret
;
ABT_xstream
*
bw_worker_xstreams
=
NULL
;
ABT_sched
*
bw_worker_scheds
=
NULL
;
ABT_sched
self_sched
;
ABT_xstream
self_xstream
;
int
i
;
ret
=
parse_args
(
argc
,
argv
,
&
g_opts
);
if
(
ret
<
0
)
...
...
@@ -62,6 +68,18 @@ int main(int argc, char **argv)
exit
(
EXIT_FAILURE
);
}
ret
=
ABT_init
(
argc
,
argv
);
assert
(
ret
==
0
);
/* set primary ES to idle without polling */
ret
=
ABT_sched_create_basic
(
ABT_SCHED_BASIC_WAIT
,
0
,
NULL
,
ABT_SCHED_CONFIG_NULL
,
&
self_sched
);
assert
(
ret
==
0
);
ret
=
ABT_xstream_self
(
&
self_xstream
);
assert
(
ret
==
0
);
ret
=
ABT_xstream_set_main_sched
(
self_xstream
,
self_sched
);
assert
(
ret
==
0
);
/* allocate one big buffer for writes */
g_buffer
=
calloc
(
g_opts
.
total_mem_size
,
1
);
if
(
!
g_buffer
)
...
...
@@ -70,10 +88,55 @@ int main(int argc, char **argv)
return
(
-
1
);
}
/* set up abt pool */
if
(
g_opts
.
xstreams
==
0
)
{
ABT_pool
pool
;
ABT_xstream
xstream
;
/* run bulk transfers from primary pool */
ret
=
ABT_xstream_self
(
&
xstream
);
assert
(
ret
==
0
);
ret
=
ABT_xstream_get_main_pools
(
xstream
,
1
,
&
pool
);
assert
(
ret
==
0
);
g_transfer_pool
=
pool
;
}
else
{
/* run bulk transfers from a dedicated pool */
bw_worker_xstreams
=
malloc
(
g_opts
.
xstreams
*
sizeof
(
*
bw_worker_xstreams
));
bw_worker_scheds
=
malloc
(
g_opts
.
xstreams
*
sizeof
(
*
bw_worker_scheds
));
assert
(
bw_worker_xstreams
&&
bw_worker_scheds
);
ret
=
ABT_pool_create_basic
(
ABT_POOL_FIFO_WAIT
,
ABT_POOL_ACCESS_MPMC
,
ABT_TRUE
,
&
g_transfer_pool
);
assert
(
ret
==
ABT_SUCCESS
);
for
(
i
=
0
;
i
<
g_opts
.
xstreams
;
i
++
)
{
ret
=
ABT_sched_create_basic
(
ABT_SCHED_BASIC_WAIT
,
1
,
&
g_transfer_pool
,
ABT_SCHED_CONFIG_NULL
,
&
bw_worker_scheds
[
i
]);
assert
(
ret
==
ABT_SUCCESS
);
ret
=
ABT_xstream_create
(
bw_worker_scheds
[
i
],
&
bw_worker_xstreams
[
i
]);
assert
(
ret
==
ABT_SUCCESS
);
}
}
run_benchmark
(
&
g_opts
);
for
(
i
=
0
;
i
<
g_opts
.
xstreams
;
i
++
)
{
ABT_xstream_join
(
bw_worker_xstreams
[
i
]);
ABT_xstream_free
(
&
bw_worker_xstreams
[
i
]);
}
free
(
g_buffer
);
ABT_finalize
();
return
0
;
}
...
...
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