Commit f1720209 authored by Matthieu Dorier's avatar Matthieu Dorier

margo now allow ABT_POOL_NULL for multiplexing, and allow to associate a new...

margo now allow ABT_POOL_NULL for multiplexing, and allow to associate a new pool even for multiplex id 0
parent 804effb2
...@@ -817,6 +817,8 @@ hg_return_t __name##_handler(hg_handle_t handle) { \ ...@@ -817,6 +817,8 @@ hg_return_t __name##_handler(hg_handle_t handle) { \
if(__ret != 0) { \ if(__ret != 0) { \
return(HG_INVALID_PARAM); \ return(HG_INVALID_PARAM); \
}\ }\
if(__pool == ABT_POOL_NULL) \
__pool = *margo_get_handler_pool(__mid); \
__ret = ABT_thread_create(__pool, (void (*)(void *))__name, handle, ABT_THREAD_ATTR_NULL, NULL); \ __ret = ABT_thread_create(__pool, (void (*)(void *))__name, handle, ABT_THREAD_ATTR_NULL, NULL); \
if(__ret != 0) { \ if(__ret != 0) { \
return(HG_NOMEM_ERROR); \ return(HG_NOMEM_ERROR); \
......
...@@ -981,8 +981,12 @@ int margo_lookup_mplex(margo_instance_id mid, hg_id_t id, uint32_t mplex_id, ABT ...@@ -981,8 +981,12 @@ int margo_lookup_mplex(margo_instance_id mid, hg_id_t id, uint32_t mplex_id, ABT
key.mplex_id = mplex_id; key.mplex_id = mplex_id;
HASH_FIND(hh, mid->mplex_table, &key, sizeof(key), element); HASH_FIND(hh, mid->mplex_table, &key, sizeof(key), element);
if(!element) if(!element) {
return(-1); if(mplex_id == 0) // element does not exist and mplex is 0, return default handler
*pool = mid->handler_pool;
else // otherwise it is an error
return(-1);
}
assert(element->key.id == id && element->key.mplex_id == mplex_id); assert(element->key.id == id && element->key.mplex_id == mplex_id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment