Commit 82b163da authored by Jonathan Jenkins's avatar Jonathan Jenkins
Browse files

convert ssg examples to tests, add build opts

parent 5c6c69ff
......@@ -34,24 +34,24 @@ if HAVE_MARGO
include_HEADERS += include/ssg-margo.h
endif
noinst_HEADERS += \
ssg-config.h \
examples/rpc.h
noinst_HEADERS += ssg-config.h
lib_LTLIBRARIES += src/libssg.la
src_libssg_la_SOURCES = src/ssg.c
EXTRA_PROGRAMS += examples/ssg-example-margo examples/ssg-example-margo-dblgrp
examples_ssg_example_margo_SOURCES = examples/ssg-example-margo.c examples/rpc.c
examples_ssg_example_margo_LDADD = src/libssg.la
examples_ssg_example_margo_dblgrp_SOURCES = examples/ssg-example-margo-dblgrp.c examples/rpc.c
examples_ssg_example_margo_dblgrp_LDADD = src/libssg.la
#EXTRA_PROGRAMS += examples/ssg-example-margo examples/ssg-example-margo-dblgrp
#examples_ssg_example_margo_SOURCES = examples/ssg-example-margo.c examples/rpc.c
#examples_ssg_example_margo_LDADD = src/libssg.la
#examples_ssg_example_margo_dblgrp_SOURCES = examples/ssg-example-margo-dblgrp.c examples/rpc.c
#examples_ssg_example_margo_dblgrp_LDADD = src/libssg.la
noinst_PROGRAMS += examples/ssg-example $(MARGO_EXTRA_PROGS)
examples_ssg_example_SOURCES = examples/ssg-example.c examples/rpc.c
examples_ssg_example_LDADD = src/libssg.la
#noinst_PROGRAMS += examples/ssg-example $(MARGO_EXTRA_PROGS)
#examples_ssg_example_SOURCES = examples/ssg-example.c examples/rpc.c
#examples_ssg_example_LDADD = src/libssg.la
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = maint/ssg.pc
include Make.rules
include $(top_srcdir)/tests/Makefile.subdir
......@@ -71,9 +71,11 @@ AC_ARG_ENABLE([margo],
*) AC_MSG_ERROR([Invalid value ${enableval} for --enable-margo])
esac])
check_progs=
if test "x${check_margo}" = xauto -o "x${check_margo}" = xyes ; then
PKG_CHECK_MODULES([MARGO],[margo],
[AC_DEFINE([HAVE_MARGO], [1], [Define to 1 if compiled with Margo support])
check_progs="tests/ssg-test-margo tests/ssg-test-margo-dblgrp"
LIBS="$MARGO_LIBS $LIBS"
CPPFLAGS="$MARGO_CFLAGS $CPPFLAGS"
CFLAGS="$MARGO_CFLAGS $CFLAGS"
......@@ -84,13 +86,8 @@ if test "x${check_margo_status}" = xfail -a "x${check_margo}" = xyes; then
AC_MSG_ERROR([Margo requested but unable to be used. See config.log])
fi
MARGO_EXTRA_PROGS=
AC_SUBST([CHECK_PROGS], [${check_progs}])
AM_CONDITIONAL([HAVE_MARGO], [test "x${check_margo_status}" = xsuccess])
if test "x${check_margo_status}" = xsuccess ; then
MARGO_EXTRA_PROGS="examples/ssg-example-margo examples/ssg-example-margo-dblgrp"
fi
AC_SUBST([MARGO_EXTRA_PROGS])
# mercury check goes last - libs should be linked in before margo
PKG_CHECK_MODULES([MERCURY],[mercury],
......
#!/bin/bash
set -x
if [[ -z "$srcdir" ]] ; then
srcdir=..
fi
tdir="$srcdir"/tests
pids=()
# run me from the top-level build dir
examples/ssg-example -s 2 bmi+tcp://3344 conf ../examples/example.conf > example.0.out 2>&1 &
tests/ssg-test -s 2 bmi+tcp://3344 conf "$tdir"/test.conf > test.0.out 2>&1 &
pids[0]=$!
examples/ssg-example -s 2 bmi+tcp://3345 conf ../examples/example.conf > example.1.out 2>&1 &
tests/ssg-test -s 2 bmi+tcp://3345 conf "$tdir"/test.conf > test.1.out 2>&1 &
pids[1]=$!
examples/ssg-example -s 2 bmi+tcp://3346 conf ../examples/example.conf > example.2.out 2>&1 &
tests/ssg-test -s 2 bmi+tcp://3346 conf "$tdir"/test.conf > test.2.out 2>&1 &
pids[2]=$!
err=0
......@@ -22,6 +28,6 @@ for pid in ${pids[@]} ; do
fi
done
if [[ $err == 0 ]] ; then rm example.0.out example.1.out example.2.out ; fi
if [[ $err == 0 ]] ; then rm test.0.out test.1.out test.2.out ; fi
exit $err
#!/bin/bash
export LSAN_OPTIONS="exitcode=0"
if [[ -z "$srcdir" ]] ; then
srcdir=..
fi
tdir="$srcdir"/tests
timeout_cmd="timeout 30s"
# run me from the top-level build dir
pids=()
$timeout_cmd examples/ssg-example-margo -s 1 bmi+tcp://3344 conf ../examples/example.4.conf > example.0.out 2>&1 &
$timeout_cmd tests/ssg-test-margo -s 1 bmi+tcp://3344 conf "$tdir"/test.4.conf > test.0.out 2>&1 &
pids[0]=$!
$timeout_cmd examples/ssg-example-margo -s 1 bmi+tcp://3345 conf ../examples/example.4.conf > example.1.out 2>&1 &
$timeout_cmd tests/ssg-test-margo -s 1 bmi+tcp://3345 conf "$tdir"/test.4.conf > test.1.out 2>&1 &
pids[1]=$!
$timeout_cmd examples/ssg-example-margo -s 1 bmi+tcp://3346 conf ../examples/example.4.conf > example.2.out 2>&1 &
$timeout_cmd tests/ssg-test-margo -s 1 bmi+tcp://3346 conf "$tdir"/test.4.conf > test.2.out 2>&1 &
pids[2]=$!
$timeout_cmd examples/ssg-example-margo -s 1 bmi+tcp://3347 conf ../examples/example.4.conf > example.3.out 2>&1 &
$timeout_cmd tests/ssg-test-margo -s 1 bmi+tcp://3347 conf "$tdir"/test.4.conf > test.3.out 2>&1 &
pids[3]=$!
err=0
......@@ -27,4 +30,8 @@ for pid in ${pids[@]} ; do
fi
done
if [[ $err == 0 ]] ; then
rm test.0.out test.1.out test.2.out test.3.out
fi
exit $err
#!/bin/bash
export LSAN_OPTIONS="exitcode=0"
if [[ -z "$srcdir" ]] ; then
top_srcdir=../
fi
tdir="$srcdir"/tests
conf0=../examples/example.3.0.conf
conf1=../examples/example.3.1.conf
conf0="$tdir"/test.3.0.conf
conf1="$tdir"/test.3.1.conf
timeout_cmd="timeout 30s"
# run me from the top-level build dir
pids=()
$timeout_cmd examples/ssg-example-margo-dblgrp \
-s 1 0 bmi+tcp://3344 $conf0 $conf1 > example.3.0.out 2>&1 &
$timeout_cmd tests/ssg-test-margo-dblgrp \
-s 1 0 bmi+tcp://3344 $conf0 $conf1 > test.3.0.out 2>&1 &
pids[0]=$!
$timeout_cmd examples/ssg-example-margo-dblgrp \
-s 1 0 bmi+tcp://3345 $conf0 $conf1 > example.3.1.out 2>&1 &
$timeout_cmd tests/ssg-test-margo-dblgrp \
-s 1 0 bmi+tcp://3345 $conf0 $conf1 > test.3.1.out 2>&1 &
pids[1]=$!
$timeout_cmd examples/ssg-example-margo-dblgrp \
-s 1 0 bmi+tcp://3346 $conf0 $conf1 > example.3.2.out 2>&1 &
$timeout_cmd tests/ssg-test-margo-dblgrp \
-s 1 0 bmi+tcp://3346 $conf0 $conf1 > test.3.2.out 2>&1 &
pids[2]=$!
$timeout_cmd examples/ssg-example-margo-dblgrp \
-s 0 1 bmi+tcp://5344 $conf0 $conf1 > example.3.3.out 2>&1 &
$timeout_cmd tests/ssg-test-margo-dblgrp \
-s 0 1 bmi+tcp://5344 $conf0 $conf1 > test.3.3.out 2>&1 &
pids[3]=$!
$timeout_cmd examples/ssg-example-margo-dblgrp \
-s 0 1 bmi+tcp://5345 $conf0 $conf1 > example.3.4.out 2>&1 &
$timeout_cmd tests/ssg-test-margo-dblgrp \
-s 0 1 bmi+tcp://5345 $conf0 $conf1 > test.3.4.out 2>&1 &
pids[4]=$!
$timeout_cmd examples/ssg-example-margo-dblgrp \
-s 0 1 bmi+tcp://5346 $conf0 $conf1 > example.3.5.out 2>&1 &
$timeout_cmd tests/ssg-test-margo-dblgrp \
-s 0 1 bmi+tcp://5346 $conf0 $conf1 > test.3.5.out 2>&1 &
pids[5]=$!
err=0
......@@ -41,7 +44,7 @@ for pid in ${pids[@]} ; do
done
if [[ $err == 0 ]] ; then
rm example.3.0.out example.3.1.out example.3.2.out \
example.3.3.out example.3.4.out example.3.5.out
rm test.3.0.out test.3.1.out test.3.2.out \
test.3.3.out test.3.4.out test.3.5.out
fi
exit $err
#!/bin/bash
# run me from the top-level build dir
mpirun -np 3 examples/ssg-example -s 0 cci+sm mpi
mpirun -np 3 tests/ssg-test -s 0 cci+sm mpi
......@@ -37,7 +37,7 @@
static void usage()
{
fputs("Usage: "
"./ssg-example [-s <time>] <grp id> <addr> <config file 0> <config file 1>\n"
"./ssg-test-margo-dblgrp [-s <time>] <grp id> <addr> <config file 0> <config file 1>\n"
" -s <time> - time to sleep before doing lookup\n"
" <grp id> - 0 or 1\n"
" <addr> - process's listen addr\n"
......
......@@ -41,7 +41,7 @@
static void usage()
{
fputs("Usage: "
"./ssg-example [-s <time>] <addr> <config mode> [config file]\n"
"./ssg-test-margo [-s <time>] <addr> <config mode> [config file]\n"
" -s <time> - time to sleep before doing lookup\n"
" <config mode> - \"mpi\" (if supported) or \"conf\"\n"
" if conf is the mode, then [config file] is required\n",
......
......@@ -39,7 +39,7 @@
static void usage()
{
fputs("Usage: "
"./ssg-example [-s <time>] <addr> <config mode> [config file]\n"
"./ssg-test [-s <time>] <addr> <config mode> [config file]\n"
" -s <time> - time to sleep before doing lookup\n"
" <config mode> - \"mpi\" (if supported) or \"conf\"\n"
" if conf is the mode, then [config file] is required\n",
......@@ -56,7 +56,6 @@ static int progress(unsigned int timeout, void *arg)
}
static int trigger(unsigned int timeout, unsigned int *flag, void *arg)
{
(void)arg;
if (HG_Trigger((hg_context_t*)arg, timeout, 1, flag) != HG_SUCCESS) {
return HG_UTIL_FAIL;
}
......@@ -206,7 +205,10 @@ int main(int argc, char *argv[])
DIE_IF(hret != HG_SUCCESS && hret != HG_TIMEOUT, "HG_Progress");
DEBUG("%d: shutting down\n", rank);
// trigger remaining
// trigger/progress remaining
do {
hret = HG_Progress(hgctx, 0);
} while (hret == HG_SUCCESS);
do {
num_trigger = 0;
hret = HG_Trigger(hgctx, 0, 1, &num_trigger);
......
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