Commit 09dc6e31 authored by Philip Carns's avatar Philip Carns

noop rpc

parent 4ac0b187
...@@ -143,6 +143,15 @@ int bake_shutdown_service(bake_target_id_t bti); ...@@ -143,6 +143,15 @@ int bake_shutdown_service(bake_target_id_t bti);
* Commented out for now but leaving it in place for reference * Commented out for now but leaving it in place for reference
*/ */
/**
* Issue a no-op
*
* @param [in] bti BAKE target identifier
* @returns 0 on success, -1 on failure
*/
int bake_bulk_noop(
bake_target_id_t bti);
#if 0 #if 0
/// ==== Some high-level goals ==== /// ==== Some high-level goals ====
......
...@@ -243,6 +243,17 @@ static void bake_bulk_get_size_ult(hg_handle_t handle) ...@@ -243,6 +243,17 @@ static void bake_bulk_get_size_ult(hg_handle_t handle)
} }
DEFINE_MARGO_RPC_HANDLER(bake_bulk_get_size_ult) DEFINE_MARGO_RPC_HANDLER(bake_bulk_get_size_ult)
/* service a remote RPC for a no-op */
static void bake_bulk_noop_ult(hg_handle_t handle)
{
// printf("Got RPC request to noop bulk region.\n");
HG_Respond(handle, NULL, NULL, NULL);
HG_Destroy(handle);
return;
}
DEFINE_MARGO_RPC_HANDLER(bake_bulk_noop_ult)
/* TODO consolidate with write handler; read and write are nearly identical */ /* TODO consolidate with write handler; read and write are nearly identical */
/* service a remote RPC that reads to a bulk region */ /* service a remote RPC that reads to a bulk region */
static void bake_bulk_read_ult(hg_handle_t handle) static void bake_bulk_read_ult(hg_handle_t handle)
......
...@@ -69,6 +69,9 @@ MERCURY_GEN_PROC(bake_bulk_probe_out_t, ...@@ -69,6 +69,9 @@ MERCURY_GEN_PROC(bake_bulk_probe_out_t,
((bake_target_id_t)(bti))) ((bake_target_id_t)(bti)))
DECLARE_MARGO_RPC_HANDLER(bake_bulk_probe_ult) DECLARE_MARGO_RPC_HANDLER(bake_bulk_probe_ult)
/* noop */
DECLARE_MARGO_RPC_HANDLER(bake_bulk_noop_ult)
/* TODO: this should be somewhere else, just putting in this header for /* TODO: this should be somewhere else, just putting in this header for
* convenience right now. The type should only be visible to the server * convenience right now. The type should only be visible to the server
* daemon and the rpc handlers. * daemon and the rpc handlers.
......
...@@ -139,6 +139,9 @@ int main(int argc, char **argv) ...@@ -139,6 +139,9 @@ int main(int argc, char **argv)
MERCURY_REGISTER(hg_class, "bake_bulk_probe_rpc", void, MERCURY_REGISTER(hg_class, "bake_bulk_probe_rpc", void,
bake_bulk_probe_out_t, bake_bulk_probe_out_t,
bake_bulk_probe_ult_handler); bake_bulk_probe_ult_handler);
MERCURY_REGISTER(hg_class, "bake_bulk_noop_rpc", void,
void,
bake_bulk_noop_ult_handler);
/* NOTE: at this point this server ULT has two options. It can wait on /* NOTE: at this point this server ULT has two options. It can wait on
* whatever mechanism it wants to (however long the daemon should run and * whatever mechanism it wants to (however long the daemon should run and
......
...@@ -28,6 +28,7 @@ struct hg_instance ...@@ -28,6 +28,7 @@ struct hg_instance
hg_id_t bake_bulk_persist_id; hg_id_t bake_bulk_persist_id;
hg_id_t bake_bulk_get_size_id; hg_id_t bake_bulk_get_size_id;
hg_id_t bake_bulk_read_id; hg_id_t bake_bulk_read_id;
hg_id_t bake_bulk_noop_id;
}; };
/* Refers to an instance connected to a specific target */ /* Refers to an instance connected to a specific target */
...@@ -113,6 +114,12 @@ static int hg_instance_init(const char *mercury_dest) ...@@ -113,6 +114,12 @@ static int hg_instance_init(const char *mercury_dest)
bake_bulk_read_in_t, bake_bulk_read_in_t,
bake_bulk_read_out_t, bake_bulk_read_out_t,
NULL); NULL);
g_hginst.bake_bulk_noop_id =
MERCURY_REGISTER(g_hginst.hg_class,
"bake_bulk_noop_rpc",
void,
void,
NULL);
g_hginst.mid = margo_init(0, 0, g_hginst.hg_context); g_hginst.mid = margo_init(0, 0, g_hginst.hg_context);
if(!g_hginst.mid) if(!g_hginst.mid)
...@@ -472,6 +479,36 @@ int bake_bulk_get_size( ...@@ -472,6 +479,36 @@ int bake_bulk_get_size(
return(ret); return(ret);
} }
int bake_bulk_noop(
bake_target_id_t bti)
{
hg_return_t hret;
hg_handle_t handle;
struct bake_instance *instance = NULL;
HASH_FIND(hh, instance_hash, &bti, sizeof(bti), instance);
if(!instance)
return(-1);
/* create handle */
hret = HG_Create(g_hginst.hg_context, instance->dest,
g_hginst.bake_bulk_noop_id, &handle);
if(hret != HG_SUCCESS)
{
return(-1);
}
hret = margo_forward(g_hginst.mid, handle, NULL);
if(hret != HG_SUCCESS)
{
HG_Destroy(handle);
return(-1);
}
HG_Destroy(handle);
return(0);
}
int bake_bulk_read( int bake_bulk_read(
bake_target_id_t bti, bake_target_id_t bti,
bake_bulk_region_id_t rid, bake_bulk_region_id_t 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