Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
margo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
12
Issues
12
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
sds
margo
Commits
7294f419
Commit
7294f419
authored
Aug 24, 2017
by
Shane Snyder
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'margo-registered-data' into dev-wrap-hg-iface
parents
20ace816
81337644
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
4 deletions
+55
-4
margo.h
include/margo.h
+23
-0
margo.c
src/margo.c
+32
-4
No files found.
include/margo.h
View file @
7294f419
...
...
@@ -34,6 +34,8 @@ typedef struct margo_data* margo_data_ptr;
#define MARGO_SERVER_MODE 1
#define MARGO_DEFAULT_MPLEX_ID 0
#define MARGO_INFO_PROGRESS_TIMEOUT_UB 1
/**
* Initializes margo library.
* @param [in] addr_str Mercury host address with port number
...
...
@@ -688,6 +690,27 @@ void margo_diag_start(margo_instance_id mid);
*/
void
margo_diag_dump
(
margo_instance_id
mid
,
const
char
*
file
,
int
uniquify
);
/**
* Sets configurable parameters/hints
*
* @param [in] mid Margo instance
* @param [in] option numerical option number
* @param [out] inout_param used to pass in values
* @returns void
*/
void
margo_set_param
(
margo_instance_id
mid
,
int
option
,
const
void
*
param
);
/**
* Retrieves configurable parameters/hints
*
* @param [in] mid Margo instance
* @param [in] option numerical option number
* @param [out] param used to pass out values
* @returns void
*/
void
margo_get_param
(
margo_instance_id
mid
,
int
option
,
void
*
param
);
/**
* macro that registers a function as an RPC.
*/
...
...
src/margo.c
View file @
7294f419
...
...
@@ -18,7 +18,7 @@
#include "utlist.h"
#include "uthash.h"
#define MERCURY_PROGRESS_TIMEOUT_UB 100
/* 100 milliseconds */
#define
DEFAULT_
MERCURY_PROGRESS_TIMEOUT_UB 100
/* 100 milliseconds */
struct
mplex_key
{
...
...
@@ -65,6 +65,7 @@ struct margo_instance
int
owns_progress_pool
;
ABT_xstream
*
rpc_xstreams
;
int
num_handler_pool_threads
;
unsigned
int
hg_progress_timeout_ub
;
/* control logic for callers waiting on margo to be finalized */
int
finalize_flag
;
...
...
@@ -178,6 +179,7 @@ margo_instance_id margo_init(const char *addr_str, int mode,
mid
->
progress_xstream
=
progress_xstream
;
mid
->
num_handler_pool_threads
=
rpc_thread_count
<
0
?
0
:
rpc_thread_count
;
mid
->
rpc_xstreams
=
rpc_xstreams
;
return
mid
;
err:
...
...
@@ -227,6 +229,7 @@ margo_instance_id margo_init_pool(ABT_pool progress_pool, ABT_pool handler_pool,
mid
->
handler_pool
=
handler_pool
;
mid
->
hg_class
=
HG_Context_get_class
(
hg_context
);
mid
->
hg_context
=
hg_context
;
mid
->
hg_progress_timeout_ub
=
DEFAULT_MERCURY_PROGRESS_TIMEOUT_UB
;
mid
->
refcount
=
1
;
ret
=
margo_timer_instance_init
(
mid
);
...
...
@@ -988,7 +991,7 @@ static void hg_progress_fn(void* foo)
unsigned
int
actual_count
;
struct
margo_instance
*
mid
=
(
struct
margo_instance
*
)
foo
;
size_t
size
;
unsigned
int
hg_progress_timeout
=
MERCURY_PROGRESS_TIMEOUT_UB
;
unsigned
int
hg_progress_timeout
=
mid
->
hg_progress_timeout_ub
;
double
next_timer_exp
;
int
trigger_happened
;
double
tm1
,
tm2
;
...
...
@@ -1061,7 +1064,7 @@ static void hg_progress_fn(void* foo)
}
else
{
hg_progress_timeout
=
MERCURY_PROGRESS_TIMEOUT_UB
;
hg_progress_timeout
=
mid
->
hg_progress_timeout_ub
;
ret
=
margo_timer_get_next_expiration
(
mid
,
&
next_timer_exp
);
if
(
ret
==
0
)
{
...
...
@@ -1071,7 +1074,7 @@ static void hg_progress_fn(void* foo)
if
(
next_timer_exp
>=
0
.
0
)
{
next_timer_exp
*=
1000
;
/* convert to milliseconds */
if
(
next_timer_exp
<
MERCURY_PROGRESS_TIMEOUT_UB
)
if
(
next_timer_exp
<
mid
->
hg_progress_timeout_ub
)
hg_progress_timeout
=
(
unsigned
int
)
next_timer_exp
;
}
else
...
...
@@ -1188,3 +1191,28 @@ void margo_diag_dump(margo_instance_id mid, const char* file, int uniquify)
return
;
}
void
margo_set_param
(
margo_instance_id
mid
,
int
option
,
const
void
*
param
)
{
switch
(
option
)
{
case
MARGO_INFO_PROGRESS_TIMEOUT_UB
:
mid
->
hg_progress_timeout_ub
=
(
*
((
const
unsigned
int
*
)
param
));
break
;
}
return
;
}
void
margo_get_param
(
margo_instance_id
mid
,
int
option
,
void
*
param
)
{
switch
(
option
)
{
case
MARGO_INFO_PROGRESS_TIMEOUT_UB
:
(
*
((
unsigned
int
*
)
param
))
=
mid
->
hg_progress_timeout_ub
;
break
;
}
return
;
}
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