Commit f838b291 authored by David Rich's avatar David Rich Committed by Rob Latham
Browse files

Compile fixups.

parent 6b18039a
...@@ -131,7 +131,7 @@ hg_return_t kv_bulk_put(kv_context *context, void *key, void *data, uint64_t *da ...@@ -131,7 +131,7 @@ hg_return_t kv_bulk_put(kv_context *context, void *key, void *data, uint64_t *da
bpin.key = *(uint64_t*)key; bpin.key = *(uint64_t*)key;
bpin.size = *(uint64_t*)data_size; bpin.size = *(uint64_t*)data_size;
ret = margo_bulk_create(context->mid, 1, &data, &data_size, ret = margo_bulk_create(context->mid, 1, &data, data_size,
HG_BULK_READ_ONLY, &bpin.bulk_handle); HG_BULK_READ_ONLY, &bpin.bulk_handle);
assert(ret == HG_SUCCESS); assert(ret == HG_SUCCESS);
ret = margo_forward(context->bulk_put_handle, &bpin); ret = margo_forward(context->bulk_put_handle, &bpin);
......
...@@ -103,17 +103,18 @@ int main(int argc, char *argv[]) ...@@ -103,17 +103,18 @@ int main(int argc, char *argv[])
DIE_IF(hret != HG_SUCCESS, "kv_open"); DIE_IF(hret != HG_SUCCESS, "kv_open");
// do a set of puts/gets // do a set of puts/gets
for (i=0; i<rank; i++) { for (int i=0; i<rank; i++) {
uint64_t key = rank+i; uint64_t key = rank+i;
// put // put
int put_val = rank+i; int put_val = rank+i;
std::vector<char> put_data; std::vector<char> put_data;
put_data.resize(sizeof(put_val)); put_data.resize(sizeof(put_val));
memcpy(put_data.data(), &put_val, sizeof(put_val)); uint64_t data_size = put_data.size();
memcpy(put_data.data(), &put_val, data_size);
hret = kv_bulk_put(context, (void*)&key, (void*)put_data.data(), put_data.size()); hret = kv_bulk_put(context, (void*)&key, (void*)put_data.data(), &data_size);
printf("(put) key %lu, size=%lu, rc=%d\n", key, put_data.size(), (int32_t)ret); printf("(put) key %lu, size=%lu\n", key, data_size);
DIE_IF(hret != HG_SUCCESS, "kv_bulk_put"); DIE_IF(hret != HG_SUCCESS, "kv_bulk_put");
sleep(2); sleep(2);
...@@ -122,14 +123,14 @@ int main(int argc, char *argv[]) ...@@ -122,14 +123,14 @@ int main(int argc, char *argv[])
int get_val; int get_val;
std::vector<char> get_data; std::vector<char> get_data;
get_data.resize(sizeof(get_val)); get_data.resize(sizeof(get_val));
uint64_t data_size = get_data.size(); data_size = get_data.size();
printf("(get) key %lu, estimated size=%lu\n", key, data_size); printf("(get) key %lu, estimated size=%lu\n", key, data_size);
hret = kv_bulk_get(context, (void*)&key, (void*)get_data.data(), &data_size); hret = kv_bulk_get(context, (void*)&key, (void*)get_data.data(), &data_size);
DIE_IF(hret != HG_SUCCESS, "kv_bulk_get"); DIE_IF(hret != HG_SUCCESS, "kv_bulk_get");
printf("(get) key %lu, actual size=%lu\n", key, data_size); printf("(get) key %lu, actual size=%lu\n", key, data_size);
get_data.resize(data_size); get_data.resize(data_size);
memcpy(&get_val, get_data.data(), sizeof(get_val)); memcpy(&get_val, get_data.data(), data_size);
printf("key: %lu in: %d out: %d\n", key, put_val, get_val); printf("key: %lu in: %d out: %d\n", key, put_val, get_val);
} }
......
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