Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add performance testing framework #20

Merged
merged 5 commits into from
Nov 11, 2014
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions config/m4/mpi.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED.
#
# $COPYRIGHT$
# $HEADER$
#


#
# Enable compiling tests with MPI
#
AS_IF([test -n "$MPI_HOME"], [with_ompi="$MPI_HOME"])
AC_ARG_WITH([mpi],
[AS_HELP_STRING([--with-mpi@<:@=MPIHOME@:>@], [Compile MPI tests (default is NO).])],
[],
[with_mpi=no])

#
# Search for mpicc and mpirun in the given path.
#
mpirun_path=""
mpicc_path=""
AS_IF([test "x$with_mpi" != xno],
[AS_IF([test "x$with_mpi" == xyes],
[AC_PATH_PROGS([mpicc_path], [mpicc])
AC_PATH_PROGS([mpirun_path], [mpirun])],
[AC_PATH_PROGS([mpicc_path], [mpicc], [], [$with_mpi/bin])
AC_PATH_PROGS([mpirun_path], [mpirun], [], [$with_mpi/bin])])
AS_IF([! test -z $mpicc_path],
[AC_DEFINE(HAVE_MPI, [1], "MPI compilation support")
AC_SUBST([MPICC], [$mpicc_path])],
[AC_MSG_ERROR(MPI support requsted but mpicc was not found)])
AS_IF([! test -z $mpirun_path],
[AC_SUBST([MPIRUN], [$mpirun_path])],
[AC_MSG_ERROR(MPI support requsted but mpirun was not found)])
])

AM_CONDITIONAL([HAVE_MPI], [! test -z $mpicc_path])
AM_CONDITIONAL([HAVE_MPIRUN], [! test -z $mpirun_path])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you already support OOB over sockets, why do you want to create this MPI dependency in the high level API ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just for tests (separate binary), and with MPI i can launch multiple processes and test stuff like all2all

1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ AS_IF([test "x$enable_debug" == xyes],
m4_include([config/m4/sysdep.m4])
m4_include([config/m4/ucs.m4])
m4_include([config/m4/ib.m4])
m4_include([config/m4/mpi.m4])


#
Expand Down
13 changes: 9 additions & 4 deletions contrib/test_jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ if [ -z "$BUILD_NUMBER" ]; then
echo Running interactive
WORKSPACE=$PWD
BUILD_NUMBER=1
JOB_URL=$WORKSPACE
JOB_URL=file://$WORKSPACE
else
echo Running under jenkins
JOB_URL=$JOB_URL/ws
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JOB_URL is set by Jenkins
I dont think we should modify it, but add "ws" where needed

fi

rpm_topdir=$WORKSPACE/rpm-dist
Expand All @@ -20,11 +21,15 @@ echo Starting on host: $(hostname)
echo "Autogen"
./autogen.sh

echo "Making a directory for test build"
mkdir -p build-test
cd build-test

echo "Build release"
./contrib/configure-release && make $make_opt && make $make_opt distcheck
../contrib/configure-release && make $make_opt && make $make_opt distcheck

echo "Build gtest "
make clean && ./contrib/configure-devel && make $make_opt
make clean && ../contrib/configure-devel && make $make_opt

echo "Starting gtest"

Expand All @@ -46,7 +51,7 @@ nerrors=$(cov-analyze --dir $cov_build |grep "Defect occurrences found" | awk '{
cov-format-errors --dir $cov_build
rc=$(($rc+$nerrors))

cov_url="$JOB_URL/ws/$cov_build_id/c/output/errors/index.html"
cov_url="$JOB_URL/$cov_build_id/c/output/errors/index.html"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not good to modify r/o variable
JOB_URL/ws is a better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

rm -f jenkins_sidelinks.txt
echo 1..1 > coverity.tap
if [ $nerrors -gt 0 ]; then
Expand Down
1 change: 1 addition & 0 deletions src/ucs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ libucs_la_SOURCES = \
debug/log.c \
debug/memtrack.c \
stats/stats.c \
sys/init.c \
sys/math.c \
sys/sys.c \
time/time.c \
Expand Down
2 changes: 1 addition & 1 deletion src/ucs/config/global_opts.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ ucs_config_field_t ucs_global_opts_table[] = {
{NULL}
};

void UCS_F_CTOR ucs_global_opts_init()
void ucs_global_opts_init()
{
ucs_config_parser_fill_opts(&ucs_global_opts, ucs_global_opts_table, NULL);
}
2 changes: 2 additions & 0 deletions src/ucs/config/global_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,6 @@ typedef struct {
extern ucs_global_opts_t ucs_global_opts;
extern ucs_config_field_t ucs_global_opts_table[];

void ucs_global_opts_init();

#endif
33 changes: 33 additions & 0 deletions src/ucs/sys/init.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright (C) Mellanox Technologies Ltd. 2001-2014. ALL RIGHTS RESERVED.
*
* $COPYRIGHT$
* $HEADER$
*/

#include <ucs/sys/compiler.h>
#include <ucs/debug/debug.h>
#include <ucs/debug/instrument.h>
#include <ucs/debug/log.h>
#include <ucs/debug/memtrack.h>
#include <ucs/stats/stats.h>

static void UCS_F_CTOR ucs_init()
{
ucs_log_early_init(); /* Must be called before all others */
ucs_global_opts_init();
ucs_log_init();
ucs_stats_init();
ucs_memtrack_init();
ucs_debug_init();
ucs_instrument_init();
}

static void UCS_F_DTOR ucs_cleanup(void)
{
ucs_instrument_cleanup();
ucs_debug_cleanup();
ucs_memtrack_cleanup();
ucs_stats_cleanup();
ucs_log_cleanup();
}
2 changes: 1 addition & 1 deletion src/uct/tl/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ucs_status_t uct_iface_open(uct_context_h context, const char *tl_name,
}

/* Non-existing transport */
return UCS_ERR_NO_ELEM;
return UCS_ERR_NO_DEVICE;
}

ucs_status_t uct_rkey_unpack(uct_context_h context, void *rkey_buffer,
Expand Down
15 changes: 9 additions & 6 deletions test/gtest/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,26 @@ noinst_PROGRAMS = gtest

gtestdir = $(includedir)
gtest_LDADD = \
$(abs_top_builddir)/src/ucs/libucs.la \
$(abs_top_builddir)/src/uct/libuct.la \
$(abs_top_builddir)/src/ucs/libucstest.la \
$(top_builddir)/src/ucs/libucs.la \
$(top_builddir)/src/uct/libuct.la \
$(top_builddir)/src/ucs/libucstest.la \
$(top_builddir)/test/perf/libucxperf.la \
$(GTEST_LIBS) \
$(BOOST_THREAD_LIB)

gtest_CPPFLAGS = \
-I$(abs_top_srcdir)/src \
-I$(abs_top_builddir)/src \
-I$(abs_top_srcdir)/test/gtest \
-I$(top_srcdir)/src \
-I$(top_srcdir)/test \
-I$(top_builddir)/src \
-I$(top_srcdir)/test/gtest \
$(GTEST_CPPFLAGS)

gtest_LDFLAGS = $(GTEST_LDFLAGS) -no-install
gtest_CXXFLAGS = $(GTEST_CXXFLAGS) -g -O3

gtest_SOURCES = \
uct/test_uct_context.cc \
uct/test_uct_perf.cc \
ucs/test_component.cc \
ucs/test_config.cc \
ucs/test_datatype.cc \
Expand Down
Loading