Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mobject-store
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
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
mobject-store
Commits
d9dc798a
Commit
d9dc798a
authored
Oct 24, 2017
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified test client for io chains
parent
95f9d148
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
13 deletions
+31
-13
tests/io-chain/io-chain-client.c
tests/io-chain/io-chain-client.c
+31
-13
No files found.
tests/io-chain/io-chain-client.c
View file @
d9dc798a
#include <assert.h>
#include <stdio.h>
#include <abt.h>
#include <abt-snoozer.h>
#include <margo.h>
#include "types.h"
...
...
@@ -17,26 +15,46 @@ int main(int argc, char** argv)
margo_instance_id
mid
=
margo_init
(
"bmi+tcp"
,
MARGO_CLIENT_MODE
,
0
,
0
);
/* Register a RPC function */
hg_id_t
sum_rpc_id
=
MARGO_REGISTER
(
mid
,
"sum"
,
sum_in_t
,
sum_out_t
,
NULL
);
hg_id_t
write_op_rpc_id
=
MARGO_REGISTER
(
mid
,
"mobject_write_op"
,
write_op_in_t
,
write_op_out_t
,
NULL
);
hg_id_t
read_op_rpc_id
=
MARGO_REGISTER
(
mid
,
"mobject_read_op"
,
read_op_in_t
,
read_op_out_t
,
NULL
);
/* Lookup the address of the server */
hg_addr_t
svr_addr
;
margo_addr_lookup
(
mid
,
argv
[
1
],
&
svr_addr
);
int
i
;
sum_in_t
args
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
args
.
x
=
42
+
i
*
2
;
args
.
y
=
42
+
i
*
2
+
1
;
{
// WRITE OP TEST
write_op_in_t
in
;
// TODO fill the write_op_in_t
hg_handle_t
h
;
margo_create
(
mid
,
svr_addr
,
sum
_rpc_id
,
&
h
);
margo_create
(
mid
,
svr_addr
,
write_op
_rpc_id
,
&
h
);
margo_forward
(
h
,
&
args
);
sum_out_t
resp
;
write_op_out_t
resp
;
margo_get_output
(
h
,
&
resp
);
// printf("Got response: %d+%d = %d\n", args.x, args.y, resp.ret);
margo_free_output
(
h
,
&
resp
);
margo_destroy
(
h
);
}
{
// READ OP TEST
read_op_in_t
in
;
// TODO fill the read_op_in_t
hg_handle_t
h
;
margo_create
(
mid
,
svr_addr
,
read_op_rpc_id
,
&
h
);
margo_forward
(
h
,
&
args
);
read_op_out_t
resp
;
margo_get_output
(
h
,
&
resp
);
printf
(
"Got response: %d+%d = %d
\n
"
,
args
.
x
,
args
.
y
,
resp
.
ret
);
// print something
margo_free_output
(
h
,
&
resp
);
margo_destroy
(
h
);
...
...
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