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
81337644
Commit
81337644
authored
Aug 24, 2017
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ability to set and query timeout upper bound
parent
c34e5501
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
5 deletions
+56
-5
include/margo.h
include/margo.h
+23
-0
src/margo.c
src/margo.c
+33
-5
No files found.
include/margo.h
View file @
81337644
...
...
@@ -32,6 +32,8 @@ typedef struct margo_data* margo_data_ptr;
#define MARGO_DEFAULT_MPLEX_ID 0
#define MARGO_RPC_ID_IGNORE ((hg_id_t*)NULL)
#define MARGO_INFO_PROGRESS_TIMEOUT_UB 1
/**
* Initializes margo library.
* @param [in] use_progress_thread Boolean flag to use a dedicated thread for
...
...
@@ -276,6 +278,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_info
(
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_info
(
margo_instance_id
mid
,
int
option
,
void
*
param
);
/**
* macro that registers a function as an RPC.
*/
...
...
src/margo.c
View file @
81337644
...
...
@@ -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
{
...
...
@@ -64,6 +64,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
;
...
...
@@ -163,6 +164,7 @@ margo_instance_id margo_init(int use_progress_thread, int rpc_thread_count,
mid
->
progress_xstream
=
progress_xstream
;
mid
->
num_handler_pool_threads
=
rpc_thread_count
<
0
?
0
:
rpc_thread_count
;
mid
->
rpc_xstreams
=
rpc_xstreams
;
mid
->
hg_progress_timeout_ub
=
DEFAULT_MERCURY_PROGRESS_TIMEOUT_UB
;
return
mid
;
err:
...
...
@@ -253,7 +255,6 @@ static void margo_cleanup(margo_instance_id mid)
void
margo_finalize
(
margo_instance_id
mid
)
{
int
i
;
int
do_cleanup
;
/* tell progress thread to wrap things up */
...
...
@@ -310,7 +311,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
;
...
...
@@ -383,7 +384,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
)
{
...
...
@@ -393,7 +394,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
...
...
@@ -954,3 +955,30 @@ void margo_diag_dump(margo_instance_id mid, const char* file, int uniquify)
return
;
}
void
margo_set_info
(
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_info
(
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