Commit 4a0c8736 authored by Matthieu Dorier's avatar Matthieu Dorier

added the possibility to change eager limit at run time

parent a066d036
...@@ -71,6 +71,28 @@ int bake_provider_handle_create( ...@@ -71,6 +71,28 @@ int bake_provider_handle_create(
*/ */
int bake_provider_handle_ref_incr(bake_provider_handle_t handle); int bake_provider_handle_ref_incr(bake_provider_handle_t handle);
/**
* Get the limit (in bytes) bellow which this provider handle will use
* eager mode (i.e. packing data into the RPC instead of using RDMA).
*
* @param[in] handle provider handle
* @param[out] limit limit
*
* @return 0 on success, -1 on failure
*/
int bake_provider_handle_get_eager_limit(bake_provider_handle_t handle, uint64_t* limit);
/**
* Set the limit (in bytes) bellow which this provider handle will use
* eager mode (i.e. packing data into the RPC instead of using RDMA).
*
* @param[in] handle provider handle
* @param[in] limit limit
*
* @return 0 on success, -1 on failure
*/
int bake_provider_handle_set_eager_limit(bake_provider_handle_t handle, uint64_t limit);
/** /**
* Decrement the reference counter of the provider handle, * Decrement the reference counter of the provider handle,
* effectively freeing the provider handle when the reference count * effectively freeing the provider handle when the reference count
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "uthash.h" #include "uthash.h"
#include "bake-rpc.h" #include "bake-rpc.h"
#define BAKE_EAGER_LIMIT 2048 #define BAKE_DEFAULT_EAGER_LIMIT 2048
/* Refers to a single Margo initialization, for now this is shared by /* Refers to a single Margo initialization, for now this is shared by
* all remote BAKE targets. In the future we probably need to support * all remote BAKE targets. In the future we probably need to support
...@@ -41,6 +41,7 @@ struct bake_provider_handle { ...@@ -41,6 +41,7 @@ struct bake_provider_handle {
hg_addr_t addr; hg_addr_t addr;
uint8_t mplex_id; uint8_t mplex_id;
uint64_t refcount; uint64_t refcount;
uint64_t eager_limit;
}; };
static int bake_client_register(bake_client_t client, margo_instance_id mid) static int bake_client_register(bake_client_t client, margo_instance_id mid)
...@@ -212,6 +213,7 @@ int bake_provider_handle_create( ...@@ -212,6 +213,7 @@ int bake_provider_handle_create(
provider->client = client; provider->client = client;
provider->mplex_id = mplex_id; provider->mplex_id = mplex_id;
provider->refcount = 1; provider->refcount = 1;
provider->eager_limit = BAKE_DEFAULT_EAGER_LIMIT;
client->num_provider_handles += 1; client->num_provider_handles += 1;
...@@ -219,6 +221,20 @@ int bake_provider_handle_create( ...@@ -219,6 +221,20 @@ int bake_provider_handle_create(
return 0; return 0;
} }
int bake_provider_handle_get_eager_limit(bake_provider_handle_t handle, uint64_t* limit)
{
if(handle == BAKE_PROVIDER_HANDLE_NULL) return -1;
*limit = handle->eager_limit;
return 0;
}
int bake_provider_handle_set_eager_limit(bake_provider_handle_t handle, uint64_t limit)
{
if(handle == BAKE_PROVIDER_HANDLE_NULL) return -1;
handle->eager_limit = limit;
return 0;
}
int bake_provider_handle_ref_incr(bake_provider_handle_t handle) int bake_provider_handle_ref_incr(bake_provider_handle_t handle)
{ {
if(handle == BAKE_PROVIDER_HANDLE_NULL) return -1; if(handle == BAKE_PROVIDER_HANDLE_NULL) return -1;
...@@ -303,7 +319,7 @@ int bake_write( ...@@ -303,7 +319,7 @@ int bake_write(
bake_write_out_t out; bake_write_out_t out;
int ret; int ret;
if(buf_size <= BAKE_EAGER_LIMIT) if(buf_size <= provider->eager_limit)
return(bake_eager_write(provider, rid, region_offset, buf, buf_size)); return(bake_eager_write(provider, rid, region_offset, buf, buf_size));
in.rid = rid; in.rid = rid;
...@@ -735,7 +751,7 @@ int bake_read( ...@@ -735,7 +751,7 @@ int bake_read(
bake_read_out_t out; bake_read_out_t out;
int ret; int ret;
if(buf_size <= BAKE_EAGER_LIMIT) if(buf_size <= provider->eager_limit)
return(bake_eager_read(provider, rid, region_offset, buf, buf_size)); return(bake_eager_read(provider, rid, region_offset, buf, buf_size));
in.rid = rid; in.rid = rid;
......
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