Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
sds-keyval
Commits
30606de1
Commit
30606de1
authored
Nov 01, 2017
by
David Rich
Committed by
Rob Latham
Nov 22, 2017
Browse files
Update README given API changes.
parent
98fbe554
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
30606de1
...
...
@@ -38,19 +38,26 @@ Client side, all of the remote functionality is abstracted under the client API,
int main(int argc, char **argv) {
int ret;
kv_context * context = kv_client_register(argc, argv);
// pass client address string (e.g. "ofi+tcp://") or NULL to use default
// default is currently "ofi+tcp://"
kv_context * context = kv_client_register(NULL);
/* open */
ret = kv_open(context, argv[1], "booger"
, KV_INT, KV_INT
);
ret = kv_open(context, argv[1], "booger");
/* put */
int key = 10;
int val = 10;
ret = kv_put(context, &key,
&val
);
ret = kv_put(context, &key,
sizeof(key), &val, sizeof(val)
);
/* get */
int remote_val;
ret = kv_get(context, &key, &remote_val);
int vsize = sizeof(remote_val);
// vsize is an in/out argument
// in value is size of receive buffer (e.g. &remote_val)
// out is actual size transferred
// this all makes more sense with complex values of arbitrary size
ret = kv_get(context, &key, sizeof(key), &remote_val, &vsize);
printf("key: %d in: %d out: %d\n", key, val, remote_val);
/* close */
...
...
@@ -62,9 +69,6 @@ int main(int argc, char **argv) {
To compile this code, you'll need to link against
`libkvclient`
in addition to the "mercury suite" dependencies.
The key and value type information passed to
`kv_open`
might not end up being
so useful in the end. We're still working on that one.
## Issues
...
...
test/test-mpi.cc
View file @
30606de1
...
...
@@ -99,6 +99,9 @@ int main(int argc, char *argv[])
hret
=
kv_open
(
context
,
server_addr_str
,
(
char
*
)
db
);
DIE_IF
(
hret
!=
HG_SUCCESS
,
"kv_open"
);
// these puts/gets do explicit marshalling/unmarshalling as an example
// it's not necessary when dealing with simple types
// put
for
(
int
i
=
1
;
i
<
rank
*
10
;
i
++
)
{
int32_t
key
=
10
*
rank
+
i
;
...
...
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