Commit 052da3fb authored by Philip Carns's avatar Philip Carns

have server open pmem pool on startup

parent 8466b850
Pipeline #155 skipped
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <abt.h> #include <abt.h>
#include <abt-snoozer.h> #include <abt-snoozer.h>
#include <margo.h> #include <margo.h>
#include <libpmemobj.h>
#include "bake-bulk-rpc.h" #include "bake-bulk-rpc.h"
...@@ -21,11 +22,20 @@ int main(int argc, char **argv) ...@@ -21,11 +22,20 @@ int main(int argc, char **argv)
ABT_pool handler_pool; ABT_pool handler_pool;
hg_context_t *hg_context; hg_context_t *hg_context;
hg_class_t *hg_class; hg_class_t *hg_class;
PMEMobjpool *pmem_pool;
if(argc != 2) if(argc != 3)
{ {
fprintf(stderr, "Usage: bake-bulk-server <HG listening addr>\n"); fprintf(stderr, "Usage: bake-bulk-server <HG listening addr> <pmem pool>\n");
fprintf(stderr, " Example: ./bake-bulk-server tcp://localhost:1234\n"); fprintf(stderr, " Example: ./bake-bulk-server tcp://localhost:1234 /dev/shm/foo.dat\n");
return(-1);
}
/* open pmem pool */
pmem_pool = pmemobj_open(argv[2], NULL);
if(!pmem_pool)
{
fprintf(stderr, "pmemobj_open: %s\n", pmemobj_errormsg());
return(-1); return(-1);
} }
...@@ -110,6 +120,8 @@ int main(int argc, char **argv) ...@@ -110,6 +120,8 @@ int main(int argc, char **argv)
HG_Context_destroy(hg_context); HG_Context_destroy(hg_context);
HG_Finalize(hg_class); HG_Finalize(hg_class);
pmemobj_close(pmem_pool);
return(0); return(0);
} }
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