Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
margo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
sds
margo
Commits
a0799a63
Commit
a0799a63
authored
Dec 17, 2015
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix lookup function and test
parent
78688cfd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
17 deletions
+31
-17
examples/client.c
examples/client.c
+1
-1
include/margo.h
include/margo.h
+2
-1
src/margo.c
src/margo.c
+28
-15
No files found.
examples/client.c
View file @
a0799a63
...
...
@@ -213,7 +213,7 @@ static void run_my_rpc(void *_arg)
sprintf
((
char
*
)
buffer
,
"Hello world!
\n
"
);
/* find addr for server */
ret
=
NA_Addr_lookup_wait
(
arg
->
network_class
,
"tcp://localhost:1234"
,
&
svr_addr
);
ret
=
margo_na_addr_lookup
(
arg
->
mid
,
arg
->
network_class
,
arg
->
na_context
,
"tcp://localhost:1234"
,
&
svr_addr
);
assert
(
ret
==
0
);
/* create handle */
...
...
include/margo.h
View file @
a0799a63
...
...
@@ -89,7 +89,8 @@ na_return_t margo_na_addr_lookup(
margo_instance_id
mid
,
na_class_t
*
na_class
,
na_context_t
*
context
,
const
char
*
name
);
const
char
*
name
,
na_addr_t
*
addr
);
/**
* Retrive the Margo instance that has been associated with a Mercury class
...
...
src/margo.c
View file @
a0799a63
...
...
@@ -167,16 +167,6 @@ hg_return_t margo_forward(
return
(
hret
);
}
static
na_return_t
margo_na_addr_lookup_cb
(
const
struct
na_cb_info
*
callback_info
)
{
na_return_t
nret
=
callback_info
->
ret
;
ABT_eventual
*
eventual
=
callback_info
->
arg
;
/* propagate return code out through eventual */
ABT_eventual_set
(
*
eventual
,
&
nret
,
sizeof
(
nret
));
return
(
NA_SUCCESS
);
}
static
hg_return_t
margo_bulk_transfer_cb
(
const
struct
hg_bulk_cb_info
*
hg_bulk_cb_info
)
{
...
...
@@ -189,18 +179,40 @@ static hg_return_t margo_bulk_transfer_cb(const struct hg_bulk_cb_info *hg_bulk_
return
(
HG_SUCCESS
);
}
struct
lookup_cb_evt
{
na_return_t
nret
;
na_addr_t
addr
;
};
static
na_return_t
margo_na_addr_lookup_cb
(
const
struct
na_cb_info
*
callback_info
)
{
struct
lookup_cb_evt
evt
;
evt
.
nret
=
callback_info
->
ret
;
evt
.
addr
=
callback_info
->
info
.
lookup
.
addr
;
ABT_eventual
*
eventual
=
callback_info
->
arg
;
/* propagate return code out through eventual */
ABT_eventual_set
(
*
eventual
,
&
evt
,
sizeof
(
evt
));
return
(
NA_SUCCESS
);
}
na_return_t
margo_na_addr_lookup
(
margo_instance_id
mid
,
na_class_t
*
na_class
,
na_context_t
*
context
,
const
char
*
name
)
const
char
*
name
,
na_addr_t
*
addr
)
{
na_return_t
nret
;
na_return_t
*
waited_nre
t
;
struct
lookup_cb_evt
*
ev
t
;
ABT_eventual
eventual
;
int
ret
;
ret
=
ABT_eventual_create
(
sizeof
(
nre
t
),
&
eventual
);
ret
=
ABT_eventual_create
(
sizeof
(
*
ev
t
),
&
eventual
);
if
(
ret
!=
0
)
{
return
(
HG_NOMEM_ERROR
);
...
...
@@ -210,8 +222,9 @@ na_return_t margo_na_addr_lookup(
&
eventual
,
name
,
NA_OP_ID_IGNORE
);
if
(
nret
==
0
)
{
ABT_eventual_wait
(
eventual
,
(
void
**
)
&
waited_nret
);
nret
=
*
waited_nret
;
ABT_eventual_wait
(
eventual
,
(
void
**
)
&
evt
);
*
addr
=
evt
->
addr
;
nret
=
evt
->
nret
;
}
ABT_eventual_free
(
&
eventual
);
...
...
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