Commit 0f4acee2 authored by Philip Carns's avatar Philip Carns

get examples working

parent d3470b85
......@@ -42,6 +42,7 @@ int main(int argc, char **argv)
/* 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);
......@@ -49,11 +50,13 @@ int main(int argc, char **argv)
/* retrieve current pool to use for ULT creation */
ret = ABT_xstream_self(&xstream);
if(ret != 0)
{
fprintf(stderr, "Error: ABT_xstream_self()\n");
return(-1);
}
ret = ABT_xstream_get_main_pools(xstream, 1, &pool);
if(ret != 0)
{
fprintf(stderr, "Error: ABT_xstream_get_main_pools()\n");
return(-1);
......
......@@ -8,8 +8,9 @@
#include <assert.h>
#include <unistd.h>
#include <abt.h>
#include <abt-snoozer.h>
#include <margo.h>
#include "hgargo.h"
#include "my-rpc.h"
/* example server program. Starts HG engine, registers the example RPC type,
......@@ -21,12 +22,6 @@ int main(int argc, char **argv)
int ret;
ABT_eventual eventual;
int shutdown;
ABT_xstream xstream;
ABT_pool pool;
ABT_sched sched;
ABT_pool_def pool_def;
struct hgargo_sched_data *sched_data;
struct hgargo_pool_data *pool_data;
ret = ABT_init(argc, argv);
if(ret != 0)
......@@ -34,51 +29,16 @@ int main(int argc, char **argv)
fprintf(stderr, "Error: ABT_init()\n");
return(-1);
}
ret = ABT_xstream_self(&xstream);
if(ret != 0)
{
fprintf(stderr, "Error: ABT_xstream_self()\n");
return(-1);
}
ret = hgargo_pool_get_def(ABT_POOL_ACCESS_MPMC, &pool_def);
if(ret != 0)
{
fprintf(stderr, "Error: hgargo_pool_get_def()\n");
return(-1);
}
ret = ABT_pool_create(&pool_def, ABT_POOL_CONFIG_NULL, &pool);
if(ret != 0)
{
fprintf(stderr, "Error: ABT_pool_create()\n");
return(-1);
}
hgargo_create_scheds(1, &pool, &sched);
ABT_sched_get_data(sched, (void**)(&sched_data));
ABT_pool_get_data(pool, (void**)(&pool_data));
ret = hgargo_setup_ev(&sched_data->ev);
if(ret < 0)
{
fprintf(stderr, "Error: hgargo_setup_ev()\n");
return(-1);
}
pool_data->ev = sched_data->ev;
ABT_sched_set_data(sched, sched_data);
ABT_pool_set_data(pool, pool_data);
ret = ABT_xstream_set_main_sched(xstream, sched);
/* set primary ES to idle without polling */
ret = ABT_snoozer_xstream_self_set();
if(ret != 0)
{
fprintf(stderr, "Error: ABT_xstream_set_main_sched()\n");
fprintf(stderr, "Error: ABT_snoozer_xstream_self_set()\n");
return(-1);
}
hgargo_init(NA_TRUE, "tcp://localhost:1234");
margo_init(NA_TRUE, "tcp://localhost:1234");
/* register RPC */
my_rpc_register();
......@@ -93,7 +53,7 @@ int main(int argc, char **argv)
ABT_eventual_wait(eventual, (void**)&shutdown);
hgargo_finalize();
margo_finalize();
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