Commit beeb18fc authored by Philip Carns's avatar Philip Carns

shutdown rpc

parent b3ba3813
Pipeline #152 skipped
......@@ -2,3 +2,7 @@ src_libbake_bulk_a_SOURCES += \
src/bake-bulk.c
bin_PROGRAMS += src/bake-bulk-server
src_bake_bulk_server_SOURCES = \
src/bake-bulk-server.c \
src/bake-bulk-rpc.c
/*
* (C) 2015 The University of Chicago
*
* See COPYRIGHT in top-level directory.
*/
#include <assert.h>
#include "bake-bulk-rpc.h"
/* service a remote RPC that instructs the server daemon to shut down */
static void bake_bulk_shutdown_ult(void *_arg)
{
hg_handle_t *handle = _arg;
hg_return_t hret;
struct hg_info *hgi;
margo_instance_id mid;
printf("Got RPC request to shutdown\n");
hgi = HG_Get_info(*handle);
assert(hgi);
mid = margo_hg_class_to_instance(hgi->hg_class);
hret = margo_respond(mid, *handle, NULL);
assert(hret == HG_SUCCESS);
HG_Destroy(*handle);
/* NOTE: we assume that the server daemon is using
* margo_wait_for_finalize() to suspend until this RPC executes, so there
* is no need to send any extra signal to notify it.
*/
margo_finalize(mid);
return;
}
DEFINE_MARGO_RPC_HANDLER(bake_bulk_shutdown_ult)
/*
* (C) 2015 The University of Chicago
*
* See COPYRIGHT in top-level directory.
*/
#ifndef __BAKE_BULK
#define __BAKE_BULK
#include <margo.h>
DECLARE_MARGO_RPC_HANDLER(bake_bulk_shutdown_ult)
#endif /* __BAKE_BULK */
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