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
sds
ssg
Commits
33e78fd2
Commit
33e78fd2
authored
Apr 08, 2016
by
Jonathan Jenkins
Browse files
add a "client" mode to ssg_init_config
parent
40f22c2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
examples/ssg-example.c
View file @
33e78fd2
...
...
@@ -138,7 +138,7 @@ int main(int argc, char *argv[])
if
(
!
argc
)
{
usage
();
return
1
;
}
conf
=
argv
[
0
];
argc
--
;
argv
++
;
c
.
s
=
ssg_init_config
(
conf
);
c
.
s
=
ssg_init_config
(
conf
,
1
);
}
else
{
fprintf
(
stderr
,
"Error: bad mode passed in %s
\n
"
,
mode
);
...
...
include/ssg.h
View file @
33e78fd2
...
...
@@ -31,9 +31,12 @@ typedef struct ssg *ssg_t;
/// participant initialization
// config file based -
all participants
load up the given config file
// config file based - load up the given config file
// containing a set of hostnames
ssg_t
ssg_init_config
(
const
char
*
fname
);
// is_member - nonzero if caller is expected to be in the group, zero otherwise
// - ssg_lookup fails if caller is unable to identify with one of the
// config entries
ssg_t
ssg_init_config
(
const
char
*
fname
,
int
is_member
);
// once the ssg has been initialized, wireup (a collection of HG_Addr_lookups)
// note that this is a simple blocking implementation - no margo/etc here
...
...
src/ssg.c
View file @
33e78fd2
...
...
@@ -25,7 +25,7 @@ static hg_return_t find_rank(hg_class_t *hgcl, ssg_t s);
static
char
**
setup_addr_str_list
(
int
num_addrs
,
char
*
buf
);
ssg_t
ssg_init_config
(
const
char
*
fname
)
ssg_t
ssg_init_config
(
const
char
*
fname
,
int
is_member
)
{
// file to read
int
fd
=
-
1
;
...
...
@@ -112,7 +112,7 @@ ssg_t ssg_init_config(const char * fname)
s
->
backing_buf
=
buf
;
buf
=
NULL
;
s
->
num_addrs
=
num_addrs
;
s
->
buf_size
=
addr_len
;
s
->
rank
=
SSG_RANK_UNKNOWN
;
s
->
rank
=
is_member
?
SSG_RANK_UNKNOWN
:
SSG_EXTERNAL_RANK
;
fini:
if
(
fd
!=
-
1
)
close
(
fd
);
...
...
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