Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
margo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
sds
margo
Commits
0f4acee2
Commit
0f4acee2
authored
Nov 13, 2015
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get examples working
parent
d3470b85
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
47 deletions
+10
-47
examples/client.c
examples/client.c
+3
-0
examples/server.c
examples/server.c
+7
-47
No files found.
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_set_main_sched
()
\n
"
);
fprintf
(
stderr
,
"Error: ABT_
snoozer_xstream_self_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
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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