Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chuck cranor
margo
Commits
0f4acee2
Commit
0f4acee2
authored
Nov 13, 2015
by
Philip Carns
Browse files
get examples working
parent
d3470b85
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/client.c
View file @
0f4acee2
...
...
@@ -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
);
...
...
examples/server.c
View file @
0f4acee2
...
...
@@ -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_se
t_main_sched
()
\n
"
);
fprintf
(
stderr
,
"Error: ABT_
snoozer_
xstream_se
lf_set
()
\n
"
);
return
(
-
1
);
}
hg
argo_init
(
NA_TRUE
,
"tcp://localhost:1234"
);
m
argo_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
);
hg
argo_finalize
();
m
argo_finalize
();
ABT_finalize
();
return
(
0
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment