Commit 1dfa47cd authored by Shane Snyder's avatar Shane Snyder

rework testing to account for pmix

parent a658feb2
TESTS_ENVIRONMENT += \ TESTS_ENVIRONMENT += \
MKTEMP="$(MKTEMP)" MKTEMP="$(MKTEMP)"
check_PROGRAMS += \
tests/ssg-launch-group \
tests/ssg-join-leave-group
EXTRA_DIST += \ EXTRA_DIST += \
tests/test-util.sh tests/test-util.sh
if SSG_HAVE_MPI if SSG_HAVE_MPI
check_PROGRAMS += \ check_PROGRAMS += \
tests/ssg-launch-group \
tests/ssg-join-leave-group \
tests/perf-regression/margo-p2p-latency \ tests/perf-regression/margo-p2p-latency \
tests/perf-regression/margo-p2p-bw tests/perf-regression/margo-p2p-bw
TESTS += \ TESTS += \
tests/simple-group.sh \ tests/simple-group-mpi.sh \
tests/join-leave-group.sh tests/join-leave-group.sh
EXTRA_DIST += \ EXTRA_DIST += \
tests/simple-group.sh \ tests/simple-group-mpi.sh \
tests/join-leave-group.sh tests/join-leave-group.sh
endif endif
if SSG_HAVE_PMIX if SSG_HAVE_PMIX
check_PROGRAMS += \ TESTS += \
tests/ssg-pmix-test tests/simple-group-pmix.sh
EXTRA_DIST += \
tests/simple-group-pmix.sh
endif endif
...@@ -14,7 +14,7 @@ if [ $? -ne 0 ]; then ...@@ -14,7 +14,7 @@ if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
wait wait $!
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
......
#!/bin/bash -x
if [ -z $srcdir ]; then
echo srcdir variable not set.
exit 1
fi
source $srcdir/tests/test-util.sh
# launch a group and wait for termination
export SSG_GROUP_LAUNCH_DURATION=10
launch_ssg_group_pmix 4 na+sm &
if [ $? -ne 0 ]; then
wait
exit 1
fi
wait $!
if [ $? -ne 0 ]; then
exit 1
fi
exit 0
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
#ifdef SSG_HAVE_MPI #ifdef SSG_HAVE_MPI
#include <ssg-mpi.h> #include <ssg-mpi.h>
#endif #endif
#ifdef SSG_HAVE_PMIX
#include <ssg-pmix.h>
#endif
#define DIE_IF(cond_expr, err_fmt, ...) \ #define DIE_IF(cond_expr, err_fmt, ...) \
do { \ do { \
...@@ -32,7 +35,6 @@ struct group_launch_opts ...@@ -32,7 +35,6 @@ struct group_launch_opts
{ {
char *addr_str; char *addr_str;
char *group_mode; char *group_mode;
char *group_addr_conf_file;
int shutdown_time; int shutdown_time;
char *gid_file; char *gid_file;
char *group_name; char *group_name;
...@@ -43,8 +45,7 @@ static void usage() ...@@ -43,8 +45,7 @@ static void usage()
fprintf(stderr, fprintf(stderr,
"Usage: " "Usage: "
"ssg-launch-group [OPTIONS] <ADDR> <MODE> [CONFFILE]\n" "ssg-launch-group [OPTIONS] <ADDR> <MODE> [CONFFILE]\n"
"Create and launch group using given Mercury ADDR string and group create MODE (\"mpi\" or \"conf\").\n" "Create and launch group using given Mercury ADDR string and group create MODE (\"mpi\" or \"pmix\").\n"
"NOTE: A path to an address CONFFILE is required when using \"conf\" mode.\n"
"\n" "\n"
"OPTIONS:\n" "OPTIONS:\n"
"\t-s <TIME>\t\tTime duration (in seconds) to run the group before shutting down\n" "\t-s <TIME>\t\tTime duration (in seconds) to run the group before shutting down\n"
...@@ -90,27 +91,29 @@ static void parse_args(int argc, char *argv[], struct group_launch_opts *opts) ...@@ -90,27 +91,29 @@ static void parse_args(int argc, char *argv[], struct group_launch_opts *opts)
opts->addr_str = argv[optind++]; opts->addr_str = argv[optind++];
opts->group_mode = argv[optind++]; opts->group_mode = argv[optind++];
if (strcmp(opts->group_mode, "conf") == 0) if (strcmp(opts->group_mode, "mpi") == 0)
{ {
fprintf(stderr, "Error: configuration file mode not supported currently!\n"); #ifdef SSG_HAVE_MPI
exit(EXIT_FAILURE); if (optind != argc)
if ((argc - optind) != 1)
{ {
usage(); usage();
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
opts->group_addr_conf_file = argv[optind++]; #else
fprintf(stderr, "Error: MPI support not built in\n");
exit(EXIT_FAILURE);
#endif
} }
else if (strcmp(opts->group_mode, "mpi") == 0) else if (strcmp(opts->group_mode, "pmix") == 0)
{ {
#ifdef SSG_HAVE_MPI #ifdef SSG_HAVE_PMIX
if (optind != argc) if (optind != argc)
{ {
usage(); usage();
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#else #else
fprintf(stderr, "Error: MPI support not built in\n"); fprintf(stderr, "Error: PMIx support not built in\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
#endif #endif
} }
...@@ -149,6 +152,15 @@ int main(int argc, char *argv[]) ...@@ -149,6 +152,15 @@ int main(int argc, char *argv[])
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
} }
#endif #endif
#ifdef SSG_HAVE_PMIX
pmix_status_t ret;
pmix_proc_t proc;
if (strcmp(opts.group_mode, "pmix") == 0)
{
ret = PMIx_Init(&proc, NULL, 0);
DIE_IF(ret != PMIX_SUCCESS, "PMIx_Init");
}
#endif
/* init margo */ /* init margo */
/* use the main xstream to drive progress & run handlers */ /* use the main xstream to drive progress & run handlers */
...@@ -160,12 +172,13 @@ int main(int argc, char *argv[]) ...@@ -160,12 +172,13 @@ int main(int argc, char *argv[])
DIE_IF(sret != SSG_SUCCESS, "ssg_init"); DIE_IF(sret != SSG_SUCCESS, "ssg_init");
/* XXX do we want to use callback for testing anything about group??? */ /* XXX do we want to use callback for testing anything about group??? */
if(strcmp(opts.group_mode, "conf") == 0)
g_id = ssg_group_create_config(opts.group_name, opts.group_addr_conf_file,
NULL, NULL);
#ifdef SSG_HAVE_MPI #ifdef SSG_HAVE_MPI
else if(strcmp(opts.group_mode, "mpi") == 0) if(strcmp(opts.group_mode, "mpi") == 0)
g_id = ssg_group_create_mpi(opts.group_name, MPI_COMM_WORLD, NULL, NULL); g_id = ssg_group_create_mpi(opts.group_name, MPI_COMM_WORLD, NULL, NULL);
#endif
#ifdef SSG_HAVE_PMIX
if(strcmp(opts.group_mode, "pmix") == 0)
g_id = ssg_group_create_pmix(opts.group_name, proc, NULL, NULL);
#endif #endif
DIE_IF(g_id == SSG_GROUP_ID_NULL, "ssg_group_create"); DIE_IF(g_id == SSG_GROUP_ID_NULL, "ssg_group_create");
...@@ -194,6 +207,10 @@ int main(int argc, char *argv[]) ...@@ -194,6 +207,10 @@ int main(int argc, char *argv[])
if (strcmp(opts.group_mode, "mpi") == 0) if (strcmp(opts.group_mode, "mpi") == 0)
MPI_Finalize(); MPI_Finalize();
#endif #endif
#ifdef SSG_HAVE_PMIX
if (strcmp(opts.group_mode, "pmix") == 0)
PMIx_Finalize(NULL, 0);
#endif
return 0; return 0;
} }
...@@ -7,11 +7,9 @@ if [ -z "$MKTEMP" ]; then ...@@ -7,11 +7,9 @@ if [ -z "$MKTEMP" ]; then
exit 1 exit 1
fi fi
function launch_ssg_group_mpi () function parse_launch_args ()
{ {
nmembers=${1:-4} local options=""
hg_addr=${2:-"na+sm"}
options=""
# parse known cmdline options out of env # parse known cmdline options out of env
if [ ! -z $SSG_GROUP_LAUNCH_NAME ]; then if [ ! -z $SSG_GROUP_LAUNCH_NAME ]; then
...@@ -24,6 +22,15 @@ function launch_ssg_group_mpi () ...@@ -24,6 +22,15 @@ function launch_ssg_group_mpi ()
options="$options -f $SSG_GROUP_LAUNCH_GIDFILE" options="$options -f $SSG_GROUP_LAUNCH_GIDFILE"
fi fi
echo $options
}
function launch_ssg_group_mpi ()
{
nmembers=${1:-4}
hg_addr=${2:-"na+sm"}
options=$(parse_launch_args)
# launch SSG group given options # launch SSG group given options
mpirun -np $nmembers tests/ssg-launch-group $options $hg_addr mpi mpirun -np $nmembers tests/ssg-launch-group $options $hg_addr mpi
} }
...@@ -31,6 +38,8 @@ function launch_ssg_group_mpi () ...@@ -31,6 +38,8 @@ function launch_ssg_group_mpi ()
function launch_ssg_group_pmix () function launch_ssg_group_pmix ()
{ {
nmembers=${1:-4} nmembers=${1:-4}
hg_addr=${2:-"na+sm"}
options=$(parse_launch_args)
prun -n $nmembers tests/ssg-pmix-test prun -n $nmembers tests/ssg-launch-group $options $hg_addr pmix
} }
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