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
19
Issues
19
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
d3132d64
Commit
d3132d64
authored
Feb 27, 2017
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement mplex registration fn
parent
10c569c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
6 deletions
+38
-6
examples/multiplex/svc1.c
examples/multiplex/svc1.c
+1
-5
src/margo.c
src/margo.c
+37
-1
No files found.
examples/multiplex/svc1.c
View file @
d3132d64
...
...
@@ -134,11 +134,7 @@ int svc1_register(margo_instance_id mid, ABT_pool pool, uint32_t mplex_id)
return
(
ret
);
}
/* TODO: for each function:
* - register with margo
* - this will put into hash table in mid that can map <id,mplex_id> to
* <pool>, checking for duplicate first
*
/* TODO:
* - elsewhere:
* - new variant of DEFINE_MARGO_RPC_HANDLER that:
* - looks up registered margo thing
...
...
src/margo.c
View file @
d3132d64
...
...
@@ -16,9 +16,23 @@
#include "margo.h"
#include "margo-timer.h"
#include "utlist.h"
#include "uthash.h"
#define MERCURY_PROGRESS_TIMEOUT_UB 100
/* 100 milliseconds */
struct
mplex_key
{
hg_id_t
id
;
uint32_t
mplex_id
;
};
struct
mplex_element
{
struct
mplex_key
key
;
ABT_pool
pool
;
UT_hash_handle
hh
;
};
struct
margo_instance
{
/* provided by caller */
...
...
@@ -43,6 +57,9 @@ struct margo_instance
ABT_cond
finalize_cond
;
int
table_index
;
/* hash table to track multiplexed rpcs registered with margo */
struct
mplex_element
*
mplex_table
;
};
struct
margo_handler_mapping
...
...
@@ -787,5 +804,24 @@ static int margo_xstream_is_in_progress_pool(margo_instance_id mid)
int
margo_register_mplex
(
margo_instance_id
mid
,
hg_id_t
id
,
uint32_t
mplex_id
,
ABT_pool
pool
)
{
return
(
-
1
);
struct
mplex_key
key
;
struct
mplex_element
*
element
;
memset
(
&
key
,
0
,
sizeof
(
key
));
key
.
id
=
id
;
key
.
mplex_id
=
mplex_id
;
HASH_FIND
(
hh
,
mid
->
mplex_table
,
&
key
,
sizeof
(
key
),
element
);
if
(
element
)
return
(
0
);
element
=
malloc
(
sizeof
(
*
element
));
if
(
!
element
)
return
(
-
1
);
element
->
key
=
key
;
element
->
pool
=
pool
;
HASH_ADD
(
hh
,
mid
->
mplex_table
,
key
,
sizeof
(
key
),
element
);
return
(
0
);
}
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