...
 
Commits (4)
ACLOCAL_AMFLAGS="-Im4"
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = maint/sds-keyval.pc
bin_PROGRAMS = test/bench-client \
test/test-client \
test/test-server
......@@ -11,6 +8,7 @@ test_bench_client_CXXFLAGS = -pthread -std=c++11 -g -Wall -mcx16 -Wno-invalid-of
test_bench_client_CPPFLAGS = ${CPPFLAGS} -I${srcdir}/src
test_bench_client_DEPENDENCIES = lib/libkvclient.la
test_bench_client_LDFLAGS = -Llib -lkvclient
test_bench_client_LDADD = ${LIBS} -lkvclient
lib_LTLIBRARIES = lib/libkvclient.la \
lib/libkvserver.la \
......@@ -51,16 +49,6 @@ check_PROGRAMS = test/test-client \
test/test-mpi-group
check_PROGRAMS = test/bench-client \
test/test-client \
test/test-server \
test/test-mpi \
test/test-mpi-group
test_bench_client_SOURCES = test/bench-client.cc
test_bench_client_CPPFLAGS = ${CPPFLAGS} -I${srcdir}/src
test_bench_client_LDADD = ${LIBS} -lkvclient
TESTS = test/test-client \
test/test-server \
test/bench-client \
......
......@@ -2,6 +2,7 @@
// All rights reserved.
#include "datastore.h"
#include <chrono>
#include <iostream>
#include <boost/filesystem.hpp>
......
......@@ -283,7 +283,7 @@ hg_return_t kv_close(kv_context_t *context)
return HG_SUCCESS;
}
bench_result_t *kv_benchmark(kv_context *context, int32_t count) {
bench_result_t *kv_benchmark(kv_context_t *context, int32_t count) {
hg_return_t ret;
hg_handle_t handle;
bench_in_t bench_in;
......@@ -294,6 +294,10 @@ bench_result_t *kv_benchmark(kv_context *context, int32_t count) {
context->bench_id, &handle);
assert(ret == HG_SUCCESS);
bench_in.count = count;
ret = margo_forward(handle, &bench_in);
assert(ret == HG_SUCCESS);
ret = margo_get_output(handle, &bench_out);
assert(ret == HG_SUCCESS);
......
......@@ -60,6 +60,7 @@ static hg_return_t open_handler(hg_handle_t handle)
#endif
out.ret = HG_OTHER_ERROR;
}
}
ret = margo_respond(handle, &out);
assert(ret == HG_SUCCESS);
......@@ -487,7 +488,6 @@ static hg_return_t bench_handler(hg_handle_t handle)
return HG_SUCCESS;
}
DEFINE_MARGO_RPC_HANDLER(bench_handler)
#endif
kv_context_t *kv_server_register(const margo_instance_id mid)
{
......@@ -545,7 +545,7 @@ kv_context_t *kv_server_register(const margo_instance_id mid)
context->shutdown_id = MARGO_REGISTER(context->mid, "shutdown",
void, void, shutdown_handler);
return context;
}
hg_return_t kv_server_wait_for_shutdown(kv_context_t *context) {
......
......@@ -289,7 +289,6 @@ static inline hg_return_t hg_proc_bench_result_t(hg_proc_t proc, void *data)
MERCURY_GEN_PROC(bench_in_t, ((int32_t)(count)))
MERCURY_GEN_PROC(bench_out_t, ((bench_result_t)(result)))
DECLARE_MARGO_RPC_HANDLER(bench_handler)
MERCURY_GEN_PROC(bench_out_t, ((bench_result)(result)) )
// kv-client API
......
......@@ -10,7 +10,7 @@ int main(int argc, char **argv) {
assert(argc == 2);
char *server_addr_str = argv[1];
margo_instance_id mid = kv_margo_init(kv_protocol(server_addr_str), MARGO_CLIENT_MODE);
margo_instance_id mid = margo_init(argv[1], MARGO_CLIENT_MODE, 0, -1);
kv_context_t *context = kv_client_register(mid);
/* open */
......
#include "sds-keyval.h"
int main(int argc, char **argv) {
margo_instance_id mid;
mid = margo_init("ofi+tcp://", MARGO_SERVER_MODE, 0, -1);
kv_context * context = kv_server_register(mid);
margo_wait_for_finalize(context->mid);
kv_server_deregister(context);
}
......@@ -4,9 +4,9 @@
int main(int argc, char **argv) {
assert(argc == 2);
char *addr_str = argv[1];
margo_instance_id mid = kv_margo_init(kv_protocol(addr_str), MARGO_SERVER_MODE);
margo_instance_id mid = margo_init(argv[1] == NULL ? "ofi+tcp://" : argv[1],
MARGO_SERVER_MODE, 0, -1);
kv_context_t *context = kv_server_register(mid);
hg_return_t ret;
......