Commit 60d0d4dd authored by Matthieu Dorier's avatar Matthieu Dorier

Merge branch 'dev-benchmark' into 'master'

Dev benchmark

See merge request !8
parents fc793933 cfe8fae8
......@@ -8,6 +8,10 @@ AM_CPPFLAGS = -I${srcdir}/src -I${srcdir}/include
bin_PROGRAMS = bin/sdskv-server-daemon \
bin/sdskv-shutdown
if BUILD_BENCHMARK
bin_PROGRAMS += bin/sdskv-benchmark
endif
check_PROGRAMS = test/sdskv-open-test \
test/sdskv-list-db-test \
test/sdskv-put-test \
......@@ -34,6 +38,13 @@ bin_sdskv_shutdown_DEPENDENCIES = lib/libsdskv-client.la
bin_sdskv_shutdown_LDFLAGS = -Llib -lsdskv-client
bin_sdskv_shutdown_LDADD = ${LIBS} -lsdskv-client
if BUILD_BENCHMARK
bin_sdskv_benchmark_SOURCES = src/sdskv-benchmark.cc
bin_sdskv_benchmark_DEPENDENCIES = lib/libsdskv-client.la lib/libsdskv-server.la
bin_sdskv_benchmark_LDFLAGS = -Llib -lsdskv-client -lsdskv-server
bin_sdskv_benchmark_LDADD = ${LIBS} -lsdskv-client -lsdskv-server ${SERVER_LIBS}
endif
#lib_LTLIBRARIES = lib/libkvclient.la \
# lib/libkvserver.la \
# lib/libkvgroupclient.la \
......
......@@ -159,6 +159,10 @@ if test "x${bwtree_backend}" == xyes ; then
CXXFLAGS="-pthread -g -Wall -mcx16 -Wno-invalid-offsetof ${CXXFLAGS}"
fi
AM_CONDITIONAL([BUILD_BDB], [test "x${berkelydb_backend}" == xyes])
AM_CONDITIONAL([BUILD_LEVELDB], [test "x${leveldb_backend}" == xyes])
AM_CONDITIONAL([BUILD_BWTREE], [test "x${bwtree_backend}" == xyes])
AC_ARG_ENABLE(remi,
[AS_HELP_STRING([--enable-remi],[Enable REMI (migration) support @<:@default=no@:>@])],
[case "${enableval}" in
......@@ -182,9 +186,22 @@ else
fi
AC_SUBST(USE_REMI)
AM_CONDITIONAL([BUILD_BDB], [test "x${berkelydb_backend}" == xyes])
AM_CONDITIONAL([BUILD_LEVELDB], [test "x${leveldb_backend}" == xyes])
AM_CONDITIONAL([BUILD_BWTREE], [test "x${bwtree_backend}" == xyes])
AC_ARG_ENABLE(benchmark,
[AS_HELP_STRING([--enable-benchmark],[Build SDSKV benchmark @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_benchmark="yes" ;;
no) enable_benchmark="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-benchmark) ;;
esac],
[enable_benchmark="no"]
)
AM_CONDITIONAL(BUILD_BENCHMARK, test x$enable_benchmark = xyes)
if test "$enable_benchmark" = "yes"; then
PKG_CHECK_MODULES(JSONCPP, jsoncpp)
LIBS="$JSONCPP_LIBS $LIBS"
CPPFLAGS="$JSONCPP_CFLAGS $CPPFLAGS"
CFLAGS="$JSONCPP_CFLAGS $CFLAGS"
fi
SERVER_LIBS="$SERVER_LIBS_PKG $SERVER_LIBS_EXT -lstdc++"
......
......@@ -5,7 +5,7 @@
#include <sdskv-common.hpp>
#define _CHECK_RET(__ret) \
if(__ret != BAKE_SUCCESS) throw exception(__ret)
if(__ret != SDSKV_SUCCESS) throw exception(__ret)
namespace sdskv {
......@@ -15,7 +15,7 @@ namespace sdskv {
class provider {
margo_instance_id m_mid = MARGO_INSTANCE_NULL;
sdskv_provider_t m_provider = SDSKV_PROVIDER_NULL;
sdskv_provider_t m_provider = NULL;
/**
* @brief Constructor is private. Use the create() factory method.
......@@ -55,7 +55,8 @@ class provider {
ABT_pool pool = SDSKV_ABT_POOL_DEFAULT)
{
auto p = new provider(mid, provider_id, pool);
margo_provider_push_finalize_callback(mid, this, &finalize_callback, this);
margo_provider_push_finalize_callback(mid, p, &finalize_callback, p);
return p;
}
/**
......@@ -82,7 +83,7 @@ class provider {
* @brief Destructor. Deregisters the provider.
*/
~provider() {
margo_provider_pop_finalize_callback(mid, this);
margo_provider_pop_finalize_callback(m_mid, this);
sdskv_provider_destroy(m_provider);
}
......@@ -191,5 +192,5 @@ class provider {
};
}
#undef _CHECK_RET
#endif
{
"protocol" : "tcp",
"seed" : 0,
"server" : {
"use-progress-thread" : false,
"rpc-thread-count" : 0,
"database" : {
"type" : "map",
"name" : "benchmark-db",
"path" : "/dev/shm"
}
},
"benchmarks" : [
{
"type" : "put",
"repetitions" : 10,
"num-entries" : 30,
"key-sizes" : [ 8, 32 ],
"val-sizes" : [ 24, 48 ],
"erase-on-teardown" : true
},
{
"type" : "put-multi",
"repetitions" : 10,
"num-entries" : 30,
"key-sizes" : [ 8, 32 ],
"val-sizes" : [ 24, 48 ],
"erase-on-teardown" : true
},
{
"type" : "get",
"repetitions" : 10,
"num-entries" : 30,
"key-sizes" : 64,
"val-sizes" : 128,
"erase-on-teardown" : true
},
{
"type" : "get-multi",
"repetitions" : 10,
"num-entries" : 30,
"key-sizes" : 32,
"val-sizes" : [ 56, 64 ],
"erase-on-teardown" : true
},
{
"type" : "length",
"repetitions" : 10,
"num-entries" : 30,
"key-sizes" : 64,
"val-sizes" : 128,
"erase-on-teardown" : true
},
{
"type" : "length-multi",
"repetitions" : 10,
"num-entries" : 30,
"key-sizes" : 32,
"val-sizes" : [ 56, 64 ],
"erase-on-teardown" : true
},
{
"type" : "erase",
"repetitions" : 10,
"num-entries" : 30,
"key-sizes" : 64,
"val-sizes" : 128
},
{
"type" : "erase-multi",
"repetitions" : 10,
"num-entries" : 30,
"key-sizes" : 32,
"val-sizes" : [ 56, 64 ]
}
]
}
This diff is collapsed.
......@@ -919,17 +919,17 @@ int sdskv_length_multi(sdskv_provider_handle_t provider,
hret = margo_bulk_create(provider->client->mid, num+1, key_seg_ptrs, key_seg_sizes,
HG_BULK_READ_ONLY, &in.keys_bulk_handle);
if(hret != HG_SUCCESS) {
fprintf(stderr,"[SDSKV] margo_bulk_create() failed in sdskv_get_multi()\n");
fprintf(stderr,"[SDSKV] margo_bulk_create() for keys failed in sdskv_length_multi()\n");
out.ret = SDSKV_ERR_MERCURY;
goto finish;
}
/* create the bulk handle for the server to put the values sizes */
hg_size_t vals_size_bulk_size = num*sizeof(hg_size_t);
hret = margo_bulk_create(provider->client->mid, num, (void**)&vsizes, &vals_size_bulk_size,
hret = margo_bulk_create(provider->client->mid, 1, (void**)&vsizes, &vals_size_bulk_size,
HG_BULK_WRITE_ONLY, &in.vals_size_bulk_handle);
if(hret != HG_SUCCESS) {
fprintf(stderr,"[SDSKV] margo_bulk_create() failed in sdskv_get_multi()\n");
fprintf(stderr,"[SDSKV] margo_bulk_create() for vsizes failed in sdskv_length_multi()\n");
out.ret = SDSKV_ERR_MERCURY;
goto finish;
}
......@@ -941,7 +941,7 @@ int sdskv_length_multi(sdskv_provider_handle_t provider,
provider->client->sdskv_length_multi_id,
&handle);
if(hret != HG_SUCCESS) {
fprintf(stderr,"[SDSKV] margo_create() failed in sdskv_get_multi()\n");
fprintf(stderr,"[SDSKV] margo_create() failed in sdskv_length_multi()\n");
out.ret = SDSKV_ERR_MERCURY;
goto finish;
}
......@@ -949,7 +949,7 @@ int sdskv_length_multi(sdskv_provider_handle_t provider,
/* forward the RPC handle */
hret = margo_provider_forward(provider->provider_id, handle, &in);
if(hret != HG_SUCCESS) {
fprintf(stderr,"[SDSKV] margo_forward() failed in sdskv_get_multi()\n");
fprintf(stderr,"[SDSKV] margo_forward() failed in sdskv_length_multi()\n");
out.ret = SDSKV_ERR_MERCURY;
goto finish;
}
......@@ -957,7 +957,7 @@ int sdskv_length_multi(sdskv_provider_handle_t provider,
/* get the response */
hret = margo_get_output(handle, &out);
if(hret != HG_SUCCESS) {
fprintf(stderr,"[SDSKV] margo_get_output() failed in sdskv_put_multi()\n");
fprintf(stderr,"[SDSKV] margo_get_output() failed in sdskv_length_multi()\n");
out.ret = SDSKV_ERR_MERCURY;
goto finish;
}
......
......@@ -652,6 +652,7 @@ static void sdskv_put_ult(hg_handle_t handle)
hret = margo_get_input(handle, &in);
if(hret != HG_SUCCESS) {
fprintf(stderr, "Error (sdskv_put_ult): margo_get_input failed with error %d\n", hret);
out.ret = SDSKV_ERR_MERCURY;
margo_respond(handle, &out);
margo_destroy(handle);
......@@ -662,6 +663,7 @@ static void sdskv_put_ult(hg_handle_t handle)
auto it = svr_ctx->databases.find(in.db_id);
if(it == svr_ctx->databases.end()) {
ABT_rwlock_unlock(svr_ctx->lock);
fprintf(stderr, "Error (sdskv_put_ult): could not find target database\n");
out.ret = SDSKV_ERR_UNKNOWN_DB;
margo_respond(handle, &out);
margo_free_input(handle, &in);
......@@ -677,6 +679,7 @@ static void sdskv_put_ult(hg_handle_t handle)
if(db->put(kdata, vdata)) {
out.ret = SDSKV_SUCCESS;
} else {
fprintf(stderr, "Error (sdskv_put_ult): put failed\n");
out.ret = SDSKV_ERR_PUT;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment