Commit e26018ba authored by Shane Snyder's avatar Shane Snyder

port tests to new changes

parent 6b6d744e
......@@ -3,7 +3,7 @@ TESTS_ENVIRONMENT += \
check_PROGRAMS += \
tests/ssg-launch-group \
tests/ssg-test-observe \
tests/ssg-observe-group \
tests/ssg-join-leave-group
EXTRA_DIST += \
......
......@@ -9,9 +9,16 @@
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#ifdef SSG_HAVE_MPI
#include <mpi.h>
#endif
#include <margo.h>
#include <ssg.h>
#ifdef SSG_HAVE_MPI
#include <ssg-mpi.h>
#endif
#define DIE_IF(cond_expr, err_fmt, ...) \
do { \
......@@ -123,24 +130,29 @@ int main(int argc, char *argv[])
/* parse cmdline arguments */
parse_args(argc, argv, &opts);
#ifdef SSG_HAVE_MPI
MPI_Init(&argc, &argv);
#endif
/* init margo */
/* use the main xstream to drive progress & run handlers */
mid = margo_init(opts.addr_str, MARGO_SERVER_MODE, 0, -1);
DIE_IF(mid == MARGO_INSTANCE_NULL, "margo_init");
/* initialize SSG */
sret = ssg_init(mid);
sret = ssg_init();
DIE_IF(sret != SSG_SUCCESS, "ssg_init");
/* load GID from file */
ssg_group_id_load(opts.gid_file, &g_id);
sret = ssg_group_id_load(opts.gid_file, &g_id);
DIE_IF(sret != SSG_SUCCESS, "ssg_group_id_load");
/* sleep until time to join */
if (opts.join_time > 0)
margo_thread_sleep(mid, opts.join_time * 1000.0);
/* XXX do we want to use callback for testing anything about group??? */
sret = ssg_group_join(g_id, NULL, NULL);
sret = ssg_group_join(mid, g_id, NULL, NULL);
DIE_IF(sret != SSG_SUCCESS, "ssg_group_join");
/* sleep for given duration to allow group time to run */
......@@ -167,5 +179,9 @@ int main(int argc, char *argv[])
ssg_finalize();
margo_finalize(mid);
#ifdef SSG_HAVE_MPI
MPI_Finalize();
#endif
return 0;
}
......@@ -15,7 +15,6 @@
#endif
#include <margo.h>
#include <mercury.h>
#include <ssg.h>
#ifdef SSG_HAVE_MPI
#include <ssg-mpi.h>
......@@ -37,7 +36,7 @@ static void usage()
{
fprintf(stderr,
"Usage: "
"ssg-test-observe [-s <time>] <addr> <GID>\n"
"ssg-observe-group [-s <time>] <addr> <GID>\n"
"Observe group given by GID using Mercury address ADDR.\n"
"\t-s <time> - time to sleep between SSG group operations\n");
}
......@@ -46,11 +45,6 @@ static void parse_args(int argc, char *argv[], int *sleep_time, const char **add
{
int ndx = 1;
#ifndef SSG_HAVE_MPI
fprintf(stderr, "Error: ssg-test-observe currently requries MPI support\n");
exit(1);
#endif
if (argc < 3)
{
usage();
......@@ -76,12 +70,6 @@ static void parse_args(int argc, char *argv[], int *sleep_time, const char **add
return;
}
struct group_id_forward_context
{
margo_instance_id mid;
ssg_group_id_t *g_id_p;
};
int main(int argc, char *argv[])
{
margo_instance_id mid = MARGO_INSTANCE_NULL;
......
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