Commit 33e78fd2 authored by Jonathan Jenkins's avatar Jonathan Jenkins
Browse files

add a "client" mode to ssg_init_config

parent 40f22c2a
......@@ -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);
......
......@@ -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
......
......@@ -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);
......
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