Commit d54d59f9 authored by Shane Snyder's avatar Shane Snyder

port bake-bulk to new margo api changes

parent 9da77dd1
This diff is collapsed.
......@@ -8,8 +8,6 @@
#include <assert.h>
#include <unistd.h>
#include <uuid/uuid.h>
#include <abt.h>
#include <abt-snoozer.h>
#include <margo.h>
#include <libpmemobj.h>
#include <bake-bulk-server.h>
......@@ -18,10 +16,6 @@ int main(int argc, char **argv)
{
int ret;
margo_instance_id mid;
ABT_xstream handler_xstream;
ABT_pool handler_pool;
hg_context_t *hg_context;
hg_class_t *hg_class;
char target_string[64];
PMEMoid root_oid;
PMEMobjpool *bb_pmem_pool = NULL;
......@@ -53,60 +47,9 @@ int main(int argc, char **argv)
uuid_unparse(bb_pmem_root->target_id.id, target_string);
fprintf(stderr, "BAKE target ID: %s\n", target_string);
/* boilerplate HG initialization steps */
/***************************************/
hg_class = HG_Init(argv[1], HG_TRUE);
if(!hg_class)
{
fprintf(stderr, "Error: HG_Init()\n");
return(-1);
}
hg_context = HG_Context_create(hg_class);
if(!hg_context)
{
fprintf(stderr, "Error: HG_Context_create()\n");
HG_Finalize(hg_class);
return(-1);
}
/* set up argobots */
/***************************************/
ret = ABT_init(argc, argv);
if(ret != 0)
{
fprintf(stderr, "Error: ABT_init()\n");
return(-1);
}
/* set primary ES to idle without polling */
ret = ABT_snoozer_xstream_self_set();
if(ret != 0)
{
fprintf(stderr, "Error: ABT_snoozer_xstream_self_set()\n");
return(-1);
}
/* Find primary pool to use for running rpc handlers */
ret = ABT_xstream_self(&handler_xstream);
if(ret != 0)
{
fprintf(stderr, "Error: ABT_xstream_self()\n");
return(-1);
}
ret = ABT_xstream_get_main_pools(handler_xstream, 1, &handler_pool);
if(ret != 0)
{
fprintf(stderr, "Error: ABT_xstream_get_main_pools()\n");
return(-1);
}
/* actually start margo */
/* provide argobots pools for driving communication progress and
* executing rpc handlers as well as class and context for Mercury
* communication.
*/
/***************************************/
mid = margo_init_pool(handler_pool, handler_pool, hg_context);
/* start margo */
/* use the main xstream for driving progress and executing rpc handlers */
mid = margo_init(argv[1], MARGO_SERVER_MODE, 0, -1);
assert(mid);
/* register the bake bulk server */
......@@ -128,11 +71,6 @@ int main(int argc, char **argv)
*/
margo_wait_for_finalize(mid);
ABT_finalize();
HG_Context_destroy(hg_context);
HG_Finalize(hg_class);
pmemobj_close(bb_pmem_pool);
return(0);
......
This diff is collapsed.
......@@ -13,8 +13,6 @@
#include <fcntl.h>
#include <sys/mman.h>
#include "abt.h"
#include "abt-snoozer.h"
#include "bake-bulk-client.h"
/* client program that will copy a bake bulk region out to a POSIX file */
......@@ -36,25 +34,9 @@ int main(int argc, char **argv)
return(-1);
}
/* set up Argobots */
ret = ABT_init(argc, argv);
if(ret != 0)
{
fprintf(stderr, "Error: ABT_init()\n");
return(-1);
}
ret = ABT_snoozer_xstream_self_set();
if(ret != 0)
{
ABT_finalize();
fprintf(stderr, "Error: ABT_snoozer_xstream_self_set()\n");
return(-1);
}
ret = bake_probe_instance(argv[1], &bti);
if(ret < 0)
{
ABT_finalize();
fprintf(stderr, "Error: bake_probe_instance()\n");
return(-1);
}
......@@ -64,7 +46,6 @@ int main(int argc, char **argv)
{
perror("open rid");
bake_release_instance(bti);
ABT_finalize();
return(-1);
}
......@@ -74,7 +55,6 @@ int main(int argc, char **argv)
perror("read");
close(region_fd);
bake_release_instance(bti);
ABT_finalize();
return(-1);
}
close(region_fd);
......@@ -84,7 +64,6 @@ int main(int argc, char **argv)
{
fprintf(stderr, "Error: bake_bulk_get_size()\n");
bake_release_instance(bti);
ABT_finalize();
return(-1);
}
......@@ -93,7 +72,6 @@ int main(int argc, char **argv)
{
perror("open output");
bake_release_instance(bti);
ABT_finalize();
return(-1);
}
......@@ -103,7 +81,6 @@ int main(int argc, char **argv)
perror("ftruncate");
close(fd);
bake_release_instance(bti);
ABT_finalize();
return(-1);
}
......@@ -113,7 +90,6 @@ int main(int argc, char **argv)
perror("mmap");
close(fd);
bake_release_instance(bti);
ABT_finalize();
return(-1);
}
......@@ -129,7 +105,6 @@ int main(int argc, char **argv)
munmap(local_region, check_size);
close(fd);
bake_release_instance(bti);
ABT_finalize();
fprintf(stderr, "Error: bake_bulk_read()\n");
return(-1);
}
......@@ -137,7 +112,6 @@ int main(int argc, char **argv)
munmap(local_region, check_size);
close(fd);
bake_release_instance(bti);
ABT_finalize();
return(0);
}
......
......@@ -13,8 +13,6 @@
#include <fcntl.h>
#include <sys/mman.h>
#include "abt.h"
#include "abt-snoozer.h"
#include "bake-bulk-client.h"
/* client program that will copy a POSIX file into a bake bulk region */
......@@ -60,29 +58,9 @@ int main(int argc, char **argv)
return(-1);
}
/* set up Argobots */
ret = ABT_init(argc, argv);
if(ret != 0)
{
munmap(local_region, statbuf.st_size);
close(fd);
fprintf(stderr, "Error: ABT_init()\n");
return(-1);
}
ret = ABT_snoozer_xstream_self_set();
if(ret != 0)
{
ABT_finalize();
munmap(local_region, statbuf.st_size);
close(fd);
fprintf(stderr, "Error: ABT_snoozer_xstream_self_set()\n");
return(-1);
}
ret = bake_probe_instance(argv[2], &bti);
if(ret < 0)
{
ABT_finalize();
munmap(local_region, statbuf.st_size);
close(fd);
fprintf(stderr, "Error: bake_probe_instance()\n");
......@@ -94,7 +72,6 @@ int main(int argc, char **argv)
if(ret != 0)
{
bake_release_instance(bti);
ABT_finalize();
munmap(local_region, statbuf.st_size);
close(fd);
fprintf(stderr, "Error: bake_bulk_create()\n");
......@@ -111,7 +88,6 @@ int main(int argc, char **argv)
if(ret != 0)
{
bake_release_instance(bti);
ABT_finalize();
munmap(local_region, statbuf.st_size);
close(fd);
fprintf(stderr, "Error: bake_bulk_write()\n");
......@@ -125,7 +101,6 @@ int main(int argc, char **argv)
if(ret != 0)
{
bake_release_instance(bti);
ABT_finalize();
fprintf(stderr, "Error: bake_bulk_persist()\n");
return(-1);
}
......@@ -135,7 +110,6 @@ int main(int argc, char **argv)
if(ret != 0)
{
bake_release_instance(bti);
ABT_finalize();
fprintf(stderr, "Error: bake_bulk_get_size()\n");
return(-1);
}
......@@ -144,7 +118,6 @@ int main(int argc, char **argv)
if(check_size != statbuf.st_size)
{
ABT_finalize();
fprintf(stderr, "Error: size mismatch!\n");
return(-1);
}
......@@ -169,8 +142,6 @@ int main(int argc, char **argv)
}
}
ABT_finalize();
return(0);
}
......@@ -13,8 +13,6 @@
#include <fcntl.h>
#include <sys/mman.h>
#include "abt.h"
#include "abt-snoozer.h"
#include "bake-bulk-client.h"
static void bench_routine_write(bake_target_id_t bti, int iterations, double* measurement_array, int size);
......@@ -51,25 +49,9 @@ int main(int argc, char **argv)
measurement_array = malloc(sizeof(*measurement_array)*iterations);
assert(measurement_array);
/* set up Argobots */
ret = ABT_init(argc, argv);
if(ret != 0)
{
fprintf(stderr, "Error: ABT_init()\n");
return(-1);
}
ret = ABT_snoozer_xstream_self_set();
if(ret != 0)
{
ABT_finalize();
fprintf(stderr, "Error: ABT_snoozer_xstream_self_set()\n");
return(-1);
}
ret = bake_probe_instance(argv[1], &bti);
if(ret < 0)
{
ABT_finalize();
fprintf(stderr, "Error: bake_probe_instance()\n");
return(-1);
}
......@@ -88,8 +70,6 @@ int main(int argc, char **argv)
bake_release_instance(bti);
ABT_finalize();
free(measurement_array);
return(0);
......
......@@ -8,8 +8,6 @@
#include <assert.h>
#include <unistd.h>
#include "abt.h"
#include "abt-snoozer.h"
#include "bake-bulk-client.h"
/* client program that will shut down a BAKE bulk server. */
......@@ -26,20 +24,6 @@ int main(int argc, char **argv)
return(-1);
}
/* set up Argobots */
ret = ABT_init(argc, argv);
if(ret != 0)
{
fprintf(stderr, "Error: ABT_init()\n");
return(-1);
}
ret = ABT_snoozer_xstream_self_set();
if(ret != 0)
{
fprintf(stderr, "Error: ABT_snoozer_xstream_self_set()\n");
return(-1);
}
ret = bake_probe_instance(argv[1], &bti);
if(ret < 0)
{
......@@ -52,8 +36,6 @@ int main(int argc, char **argv)
bake_release_instance(bti);
ABT_finalize();
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