浏览代码

Merge branch 'master' of git+ssh://scm.gforge.inria.fr/gitroot/starpu/starpu into ft_checkpoint

# Conflicts:
#	julia/Makefile.am
#	mpi/Makefile.am
#	mpi/tests/Makefile.am
#	src/common/utils.c
Romain LION 5 年之前
父节点
当前提交
8748acbb14

+ 3 - 0
ChangeLog

@@ -57,6 +57,9 @@ Small features:
   * Add field starpu_conf::precedence_over_environment_variables to ignore
     environment variables when parameters are set directly in starpu_conf
   * Add starpu_data_get_coordinates_array
+  * New STARPU_BACKOFF_MIN and STARPU_BACKOFF_MAX environment variables to the
+    exponential backoff limits of the number of cycles to pause while drivers
+    are spinning.
 
 StarPU 1.3.3 (git revision 11afc5b007fe1ab1c729b55b47a5a98ef7f3cfad)
 ====================================================================

+ 5 - 5
Makefile.am

@@ -27,7 +27,7 @@ SUBDIRS += src
 
 SUBDIRS += tools
 
-if BUILD_TESTS
+if STARPU_BUILD_TESTS
 SUBDIRS += tests
 endif
 
@@ -37,19 +37,19 @@ if STARPU_USE_MPI
 SUBDIRS += mpi
 endif
 
-if BUILD_EXAMPLES
+if STARPU_BUILD_EXAMPLES
 SUBDIRS += examples
 endif
 
-if BUILD_SOCL
+if STARPU_BUILD_SOCL
 SUBDIRS += socl
 endif
 
-if BUILD_STARPUFFT
+if STARPU_BUILD_STARPUFFT
 SUBDIRS += starpufft
 endif
 
-if BUILD_STARPURM
+if STARPU_BUILD_STARPURM
 SUBDIRS += starpurm
 endif
 

+ 16 - 17
configure.ac

@@ -552,7 +552,6 @@ AC_MSG_RESULT($build_mpi_lib)
 AC_MSG_CHECKING(whether the StarPU MPI nmad library should be generated)
 AC_MSG_RESULT($build_nmad_lib)
 
-AM_CONDITIONAL(USE_MPI, test x$build_mpi_lib = xyes -o x$build_nmad_lib = xyes)
 if test x$build_mpi_lib = xyes -o x$build_nmad_lib = xyes ; then
 	AC_DEFINE(STARPU_USE_MPI,[1],[whether the StarPU MPI library is available])
 	if test x$build_mpi_lib = xyes ; then
@@ -2731,7 +2730,7 @@ else
 fi
 
 AC_MSG_RESULT($build_socl)
-AM_CONDITIONAL([BUILD_SOCL], [test "x$build_socl" = "xyes"])
+AM_CONDITIONAL([STARPU_BUILD_SOCL], [test "x$build_socl" = "xyes"])
 AM_CONDITIONAL([STARPU_USE_SOCL], [test "x$build_socl" = "xyes"])
 
 if test "$build_socl" = "yes" ; then
@@ -2768,12 +2767,12 @@ AC_ARG_ENABLE(build-tests, [AS_HELP_STRING([--disable-build-tests],
 			[disable building of tests])],
 			enable_build_tests=$enableval, enable_build_tests=yes)
 # check stuff for tests (todo)
-AM_CONDITIONAL(BUILD_TESTS, [test x$enable_build_tests != xno])
+AM_CONDITIONAL(STARPU_BUILD_TESTS, [test x$enable_build_tests != xno])
 AC_ARG_ENABLE(build-examples, [AS_HELP_STRING([--disable-build-examples],
 			[disable building of examples])],
 			enable_build_examples=$enableval, enable_build_examples=yes)
 # check stuff for examples (todo)
-AM_CONDITIONAL(BUILD_EXAMPLES, [test x$enable_build_examples != xno])
+AM_CONDITIONAL(STARPU_BUILD_EXAMPLES, [test x$enable_build_examples != xno])
 AC_ARG_ENABLE(opengl-render, [AS_HELP_STRING([--enable-opengl-render],
 			[enable OpenGL rendering of some examples])],
 			enable_opengl_render=$enableval, enable_opengl_render=no)
@@ -2789,13 +2788,13 @@ fi
 AC_MSG_CHECKING(whether OpenGL rendering is enabled)
 AC_SUBST(STARPU_OPENGL_RENDER, $enable_opengl_render)
 AC_MSG_RESULT($enable_opengl_render)
-AM_CONDITIONAL([HAVE_OPENGL], [test "x$enable_opengl_render" = xyes])
+AM_CONDITIONAL([STARPU_HAVE_OPENGL], [test "x$enable_opengl_render" = xyes])
 
 AC_PATH_XTRA
 if test "x$no_x" != "xyes"; then
 	AC_DEFINE(STARPU_HAVE_X11, [1], [enable X11])
 fi
-AM_CONDITIONAL([HAVE_X11], [test "x$no_x" != "xyes"])
+AM_CONDITIONAL([STARPU_HAVE_X11], [test "x$no_x" != "xyes"])
 
 # In case there are BLAS kernels that are used by the example applications
 # we may specify which library to use. Note that this is not used for StarPU
@@ -2995,11 +2994,11 @@ if test x$have_cblas_h = xyes; then
     AC_DEFINE(STARPU_HAVE_CBLAS_H, [1], [The blas library has blas.h])
 fi
 
-AM_CONDITIONAL(ATLAS_BLAS_LIB, test x$blas_lib = xatlas)
-AM_CONDITIONAL(GOTO_BLAS_LIB, test x$blas_lib = xgoto)
-AM_CONDITIONAL(MKL_BLAS_LIB, test x$blas_lib = xmkl)
-AM_CONDITIONAL(SYSTEM_BLAS_LIB, test x$blas_lib = xsystem)
-AM_CONDITIONAL(NO_BLAS_LIB, test x$blas_lib = xnone -a x$enable_simgrid = xno)
+AM_CONDITIONAL(STARPU_ATLAS_BLAS_LIB, test x$blas_lib = xatlas)
+AM_CONDITIONAL(STARPU_GOTO_BLAS_LIB, test x$blas_lib = xgoto)
+AM_CONDITIONAL(STARPU_MKL_BLAS_LIB, test x$blas_lib = xmkl)
+AM_CONDITIONAL(STARPU_SYSTEM_BLAS_LIB, test x$blas_lib = xsystem)
+AM_CONDITIONAL(STARPU_NO_BLAS_LIB, test x$blas_lib = xnone -a x$enable_simgrid = xno)
 AC_SUBST(STARPU_BLAS_LDFLAGS)
 
 AC_MSG_CHECKING(which BLAS lib should be used)
@@ -3108,12 +3107,12 @@ AM_CONDITIONAL(STARPU_HAVE_FFTWL, [test x$have_fftwl = xyes])
 if test x$enable_starpufft = xyes -a \( \( x$enable_cpu = xyes -a x$have_fftw = xyes -a x$have_fftwf = xyes \) -o x$have_cufftdoublecomplex = xyes \); then
    fft_support=yes
 fi
-AM_CONDITIONAL(BUILD_STARPUFFT, [test x$fft_support = xyes])
+AM_CONDITIONAL(STARPU_BUILD_STARPUFFT, [test x$fft_support = xyes])
 
 AC_ARG_ENABLE(starpufft-examples, [AS_HELP_STRING([--enable-starpufft-examples],
 			[enable build of StarPU FFT examples])],
 			enable_starpufft_examples=$enableval, enable_starpufft_examples=no)
-AM_CONDITIONAL(BUILD_STARPUFFT_EXAMPLES, [test x$enable_starpufft_examples = xyes])
+AM_CONDITIONAL(STARPU_BUILD_STARPUFFT_EXAMPLES, [test x$enable_starpufft_examples = xyes])
 
 ##########################################
 # hwloc                                  #
@@ -3399,12 +3398,12 @@ then
 	AC_SUBST(DLB_LIBS)
 fi
 AM_CONDITIONAL(STARPURM_HAVE_DLB, test x$starpurm_dlb_support == "xyes")
-AM_CONDITIONAL(BUILD_STARPURM, [test x$starpurm_support = xyes])
+AM_CONDITIONAL(STARPU_BUILD_STARPURM, [test x$starpurm_support = xyes])
 
 AC_ARG_ENABLE(starpurm-examples, [AS_HELP_STRING([--enable-starpurm-examples],
 			[enable build of StarPU Resource Manager examples])],
 			enable_starpurm_examples=$enableval, enable_starpurm_examples=no)
-AM_CONDITIONAL(BUILD_STARPURM_EXAMPLES, [test x$enable_starpurm_examples = xyes])
+AM_CONDITIONAL(STARPU_BUILD_STARPURM_EXAMPLES, [test x$enable_starpurm_examples = xyes])
 
 
 
@@ -3441,8 +3440,8 @@ AC_MSG_RESULT($enable_build_doc)
 AC_MSG_CHECKING(whether documentation is available)
 AC_MSG_RESULT($available_doc)
 
-AM_CONDITIONAL(BUILD_DOC, [test x$enable_build_doc != xno])
-AM_CONDITIONAL(AVAILABLE_DOC, [test x$available_doc != xno])
+AM_CONDITIONAL(STARPU_BUILD_DOC, [test x$enable_build_doc != xno])
+AM_CONDITIONAL(STARPU_AVAILABLE_DOC, [test x$available_doc != xno])
 
 ###############################################################################
 #                                                                             #

+ 3 - 3
doc/doxygen/Makefile.am

@@ -29,7 +29,7 @@ txtdir   = $(docdir)/manual
 
 EXTRA_DIST =
 
-if BUILD_DOC
+if STARPU_BUILD_DOC
 all: $(DOX_HTML_DIR) $(DOX_PDF)
 EXTRA_DIST += $(DOX_HTML_DIR) $(DOX_PDF)
 txt_DATA = $(DOX_PDF)
@@ -40,7 +40,7 @@ install-exec-hook:
 uninstall-hook:
 	rm -rf $(DESTDIR)$(docdir)/manual/html
 else
-if AVAILABLE_DOC
+if STARPU_AVAILABLE_DOC
 EXTRA_DIST += $(top_srcdir)/doc/doxygen/html $(top_srcdir)/doc/doxygen/starpu.pdf
 txt_DATA = $(top_srcdir)/doc/doxygen/starpu.pdf
 DOX_HTML_SRCDIR=$(top_srcdir)/doc/doxygen/html
@@ -136,7 +136,7 @@ images = 	\
 	chapters/images/tasks_size_overhead.png \
 	chapters/images/temanejo.png
 
-if BUILD_DOC
+if STARPU_BUILD_DOC
 starpu_config.h: $(top_srcdir)/include/starpu_config.h.in
 	@$(SED) 's/#undef \(.*\)/#define \1 1/' $< > $@
 

+ 14 - 0
doc/doxygen/chapters/501_environment_variables.doxy

@@ -406,6 +406,20 @@ and friends.  The default is Enabled.
 This permits to test the performance effect of memory pinning.
 </dd>
 
+<dt>STARPU_BACKOFF_MIN</dt>
+<dd>
+\anchor STARPU_BACKOFF_MIN
+\addindex __env__STARPU_BACKOFF_MIN
+Set minimum exponential backoff of number of cycles to pause when spinning. Default value is 1.
+</dd>
+
+<dt>STARPU_BACKOFF_MAX</dt>
+<dd>
+\anchor STARPU_BACKOFF_MAX
+\addindex __env__STARPU_BACKOFF_MAX
+Set maximum exponential backoff of number of cycles to pause when spinning. Default value is 32.
+</dd>
+
 <dt>STARPU_MIC_SINK_PROGRAM_NAME</dt>
 <dd>
 \anchor STARPU_MIC_SINK_PROGRAM_NAME

+ 7 - 0
doc/doxygen/chapters/510_configure_options.doxy

@@ -370,6 +370,13 @@ used by StarPU data structures.
 Disable the build of libstarpumpi. By default, it is enabled when MPI is found.
 </dd>
 
+<dt>--enable-mpi</dt>
+<dd>
+\anchor enable-mpi
+\addindex __configure__--enable-mpi
+Enable the build of libstarpumpi. This is necessary when using Simgrid+MPI.
+</dd>
+
 <dt>--with-mpicc=<c>path</c></dt>
 <dd>
 \anchor with-mpicc

+ 3 - 3
doc/doxygen_dev/Makefile.am

@@ -29,7 +29,7 @@ txtdir   = $(docdir)/manual
 
 EXTRA_DIST =
 
-if BUILD_DOC
+if STARPU_BUILD_DOC
 all: $(DOX_HTML_DIR) $(DOX_PDF)
 EXTRA_DIST += $(DOX_HTML_DIR) $(DOX_PDF)
 txt_DATA = $(DOX_PDF)
@@ -40,7 +40,7 @@ install-exec-hook:
 uninstall-hook:
 	rm -rf $(DESTDIR)$(docdir)/manual/html_dev
 else
-if AVAILABLE_DOC
+if STARPU_AVAILABLE_DOC
 EXTRA_DIST += $(top_srcdir)/doc/doxygen_dev/html_dev $(top_srcdir)/doc/doxygen_dev/starpu_dev.pdf
 txt_DATA = $(top_srcdir)/doc/doxygen_dev/starpu_dev.pdf
 DOX_HTML_SRCDIR=$(top_srcdir)/doc/doxygen_dev/html_dev
@@ -58,7 +58,7 @@ chapters =	\
 
 images =
 
-if BUILD_DOC
+if STARPU_BUILD_DOC
 config.h: $(top_srcdir)/src/common/config.h.in
 	@$(SED) 's/#undef \(.*\)/#define \1 1/' $< > $@
 	@$(SED) -i '1s/^/\/\*\* \@file \*\/\n/' $@

+ 13 - 13
examples/Makefile.am

@@ -153,7 +153,7 @@ SHELL_TESTS =
 if !STARPU_USE_MPI_MASTER_SLAVE
 SHELL_TESTS			+=	scheduler/schedulers.sh
 SHELL_TESTS			+=	scheduler/schedulers_context.sh
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 SHELL_TESTS			+=	mult/sgemm.sh
 endif
 endif
@@ -304,7 +304,7 @@ endif
 endif
 endif
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 STARPU_EXAMPLES +=				\
 	mult/sgemm 				\
 	mult/dgemm				\
@@ -344,7 +344,7 @@ endif
 
 if !STARPU_SIMGRID
 
-if MKL_BLAS_LIB
+if STARPU_MKL_BLAS_LIB
 STARPU_EXAMPLES +=				\
 	lu/lu_example_complex_float		\
 	lu/lu_example_complex_double		\
@@ -646,7 +646,7 @@ endif
 # AXPY example #
 ################
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 axpy_axpy_SOURCES =				\
 	axpy/axpy.c				\
 	common/blas.c
@@ -665,7 +665,7 @@ endif
 # Mult example #
 ################
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 
 mult_sgemm_SOURCES = 				\
 	mult/sgemm.c				\
@@ -687,7 +687,7 @@ endif
 # Cholesky example #
 ####################
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 
 cholesky_cholesky_tag_SOURCES =			\
 	cholesky/cholesky_tag.c			\
@@ -742,7 +742,7 @@ endif
 # LU example #
 ##############
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 
 lu_lu_example_float_SOURCES =			\
 	lu/lu_example_float.c			\
@@ -784,7 +784,7 @@ lu_lu_implicit_example_double_SOURCES =		\
 lu_lu_implicit_example_double_LDADD =		\
 	$(STARPU_BLAS_LDFLAGS)
 
-if MKL_BLAS_LIB
+if STARPU_MKL_BLAS_LIB
 lu_lu_example_complex_float_SOURCES =		\
 	lu/lu_example_complex_float.c		\
 	lu/clu.c				\
@@ -837,7 +837,7 @@ endif
 # Heat example #
 ################
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 
 heat_heat_SOURCES =				\
 	heat/heat.c				\
@@ -861,7 +861,7 @@ endif
 # CG example #
 ##############
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 
 cg_cg_SOURCES =					\
 	cg/cg.c					\
@@ -1013,7 +1013,7 @@ examplebin_PROGRAMS +=				\
 	mandelbrot/mandelbrot
 
 mandelbrot_mandelbrot_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
-if HAVE_X11
+if STARPU_HAVE_X11
 mandelbrot_mandelbrot_CPPFLAGS += $(X_CFLAGS)
 mandelbrot_mandelbrot_LDADD = $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS)
 endif
@@ -1062,7 +1062,7 @@ endif
 # OpenGL interoperability #
 ###########################
 
-if HAVE_OPENGL
+if STARPU_HAVE_OPENGL
 examplebin_PROGRAMS +=				\
 	gl_interop/gl_interop			\
 	gl_interop/gl_interop_idle
@@ -1084,7 +1084,7 @@ endif
 # pipeline example #
 ####################
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 pipeline_pipeline_SOURCES	=	\
 	pipeline/pipeline.c		\
 	common/blas.c

+ 2 - 2
examples/stencil/Makefile.am

@@ -20,7 +20,7 @@ LIBS = $(top_builddir)/src/@LIBSTARPU_LINK@ $(HWLOC_LIBS) @LIBS@ $(FXT_LIBS)
 AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/examples/ -I$(top_builddir)/include
 AM_LDFLAGS = @STARPU_EXPORT_DYNAMIC@ $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS) $(STARPU_COI_LDFLAGS) $(STARPU_SCIF_LDFLAGS)
 
-if USE_MPI
+if STARPU_USE_MPI
 LIBS += $(top_builddir)/mpi/src/libstarpumpi-@STARPU_EFFECTIVE_VERSION@.la
 AM_CPPFLAGS += -I$(top_srcdir)/mpi/include
 if STARPU_SIMGRID
@@ -63,7 +63,7 @@ check_PROGRAMS	=	$(LOADER) $(STARPU_EXAMPLES)
 endif
 
 if !STARPU_SIMGRID
-if USE_MPI
+if STARPU_USE_MPI
 if STARPU_MPI_CHECK
 TESTS		=	$(STARPU_EXAMPLES)
 endif

+ 10 - 0
include/starpu.h

@@ -430,6 +430,16 @@ struct starpu_conf
 	   performance counters after initialization
 	 */
 	unsigned start_perf_counter_collection;
+
+	/**
+	   Minimum spinning backoff of drivers. Default value: \c 1
+	 */
+	unsigned driver_spinning_backoff_min;
+
+	/**
+	   Maximum spinning backoff of drivers. Default value: \c 32
+	 */
+	unsigned driver_spinning_backoff_max;
 };
 
 /**

+ 18 - 2
include/starpu_helper.h

@@ -50,6 +50,20 @@ extern int _starpu_silent;
 char *starpu_getenv(const char *str);
 
 /**
+   If the environment variable \c str is defined and its value is contained in the array \c strings, return the array position.
+   Raise an error if the environment variable \c str is defined with a value not in \c strings
+   Return \c defvalue if the environment variable \c str is not defined.
+ */
+int starpu_get_env_string_var_default(const char *str, const char *strings[], int defvalue);
+
+/**
+   If the environment variable \c str is defined with a well-defined size value, return the value as a size in bytes. Expected size qualifiers are b, B, k, K, m, M, g, G. The default qualifier is K.
+   If the environment variable \c str is not defined or is empty, return \c defval
+   Raise an error if the value of the environment variable \c str is not well-defined.
+ */
+int starpu_get_env_size_default(const char *str, int defval);
+
+/**
    Return the integer value of the environment variable named \p str.
    Return 0 otherwise (the variable does not exist or has a
    non-integer value).
@@ -66,7 +80,8 @@ static __starpu_inline int starpu_get_env_number(const char *str)
 		char *pcheck;
 
 		val = strtol(strval, &pcheck, 10);
-		if (*pcheck) {
+		if (*pcheck)
+		{
 			fprintf(stderr,"The %s environment variable must contain an integer\n", str);
 			STARPU_ABORT();
 		}
@@ -103,7 +118,8 @@ static __starpu_inline float starpu_get_env_float_default(const char *str, float
 		char *pcheck;
 
 		val = strtof(strval, &pcheck);
-		if (*pcheck) {
+		if (*pcheck)
+		{
 			fprintf(stderr,"The %s environment variable must contain a float\n", str);
 			STARPU_ABORT();
 		}

+ 31 - 0
julia/Makefile.am

@@ -0,0 +1,31 @@
+# StarPU --- Runtime system for heterogeneous multicore architectures.
+#
+# Copyright (C) 2020       Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
+#
+# StarPU is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# StarPU is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# See the GNU Lesser General Public License in COPYING.LGPL for more details.
+#
+include $(top_srcdir)/starpu.mk
+
+SUBDIRS = src
+
+if STARPU_BUILD_EXAMPLES
+SUBDIRS += examples
+endif
+
+EXTRA_DIST = README
+
+recheck:
+	RET=0 ; \
+	for i in $(SUBDIRS) ; do \
+		make -C $$i recheck || RET=1 ; \
+	done ; \
+	exit $$RET

+ 1 - 3
julia/examples/Makefile.am

@@ -104,11 +104,9 @@ check_PROGRAMS = $(LOADER) $(starpu_julia_EXAMPLES)
 SHELL_TESTS	=
 STARPU_JULIA_EXAMPLES	=
 
-if BUILD_EXAMPLES
 examplebin_PROGRAMS 	+=	$(STARPU_JULIA_EXAMPLES)
 
 TESTS			=	$(SHELL_TESTS) $(STARPU_JULIA_EXAMPLES)
-endif
 
 ######################
 #      Examples      #
@@ -139,7 +137,7 @@ SHELL_TESTS			+=	dependency/tag_dep.sh
 SHELL_TESTS			+=	dependency/task_dep.sh
 SHELL_TESTS			+=	dependency/end_dep.sh
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 SHELL_TESTS			+=	axpy/axpy.sh
 SHELL_TESTS			+=	cholesky/cholesky.sh
 SHELL_TESTS			+=	gemm/gemm.sh

+ 26 - 1
mpi/Makefile.am

@@ -16,7 +16,14 @@
 
 include $(top_srcdir)/starpu-subdirtests.mk
 
-SUBDIRS=src tests examples
+SUBDIRS=src tools
+
+if STARPU_BUILD_EXAMPLES
+SUBDIRS += examples
+endif
+if STARPU_BUILD_TESTS
+SUBDIRS += tests
+endif
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libstarpumpi.pc starpumpi-1.0.pc starpumpi-1.1.pc starpumpi-1.2.pc starpumpi-1.3.pc
@@ -26,3 +33,21 @@ versinclude_HEADERS = 					\
 	include/starpu_mpi.h				\
 	include/starpu_mpi_lb.h				\
 	include/fstarpu_mpi_mod.f90
+
+if !STARPU_SIMGRID
+check-recursive:
+	RET=0 ; \
+	NJOBS=`printf %s "$(MAKEFLAGS)" | sed -ne 's/.*-j \?\([0-9]\+\).*/\1/p'` ; \
+	JOBS="" ; \
+	if [ -n "$$NJOBS" ] ; then \
+		if [ "$$NJOBS" -ge 4 ] ; then \
+			JOBS="-j$$(($$NJOBS / 4))" ; \
+		else \
+			JOBS="-j1" ; \
+		fi ; \
+	fi ; \
+	for i in $(SUBDIRS) ; do \
+		$(MAKE) check -C $$i MAKEFLAGS="$(MAKEFLAGS) $$JOBS" || RET=1; \
+	done ; \
+	exit $$RET
+endif

+ 2 - 23
mpi/examples/Makefile.am

@@ -108,7 +108,6 @@ AM_LDFLAGS = $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS) $(FXT_LDFLAGS) $(ST
 ###################
 # Stencil example #
 ###################
-if BUILD_EXAMPLES
 examplebin_PROGRAMS +=		\
 	stencil/stencil5
 starpu_mpi_EXAMPLES	+=	\
@@ -121,14 +120,11 @@ starpu_mpi_EXAMPLES	+=	\
 	stencil/stencil5_lb
 endif
 
-endif
-
 ##################
 # MPI LU example #
 ##################
 
-if BUILD_EXAMPLES
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 
 examplebin_PROGRAMS += 			\
 	mpi_lu/plu_example_float	\
@@ -210,14 +206,12 @@ mpi_lu_plu_outofcore_example_double_SOURCES =	\
 	mpi_lu/pdlu_implicit.c			\
 	../../examples/common/blas.c
 endif
-endif
 
 ########################
 # MPI Cholesky example #
 ########################
 
-if BUILD_EXAMPLES
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 examplebin_PROGRAMS +=		\
 	matrix_decomposition/mpi_cholesky			\
 	matrix_decomposition/mpi_cholesky_distributed
@@ -250,13 +244,11 @@ starpu_mpi_EXAMPLES +=				\
 	matrix_decomposition/mpi_cholesky			\
 	matrix_decomposition/mpi_cholesky_distributed
 endif
-endif
 
 ########################
 # MPI Matrix mult example #
 ########################
 
-if BUILD_EXAMPLES
 examplebin_PROGRAMS +=		\
 	matrix_mult/mm
 
@@ -270,14 +262,12 @@ if !STARPU_SIMGRID
 starpu_mpi_EXAMPLES +=				\
 	matrix_mult/mm
 endif
-endif
 
 ##########################################
 # Native Fortran MPI Matrix mult example #
 ##########################################
 
 if STARPU_HAVE_MPIFORT
-if BUILD_EXAMPLES
 if !STARPU_SANITIZE
 examplebin_PROGRAMS +=		\
 	native_fortran/nf_mm	\
@@ -318,13 +308,11 @@ starpu_mpi_EXAMPLES +=				\
 endif
 endif
 endif
-endif
 
 ###################
 # complex example #
 ###################
 
-if BUILD_EXAMPLES
 examplebin_PROGRAMS +=			\
 	complex/mpi_complex
 
@@ -334,13 +322,11 @@ complex_mpi_complex_SOURCES =		\
 
 starpu_mpi_EXAMPLES	+=			\
 	complex/mpi_complex
-endif
 
 #########################
 # user_datatype example #
 #########################
 
-if BUILD_EXAMPLES
 examplebin_PROGRAMS +=				\
 	user_datatype/user_datatype		\
 	user_datatype/user_datatype2
@@ -358,13 +344,11 @@ starpu_mpi_EXAMPLES	+=			\
 	user_datatype/user_datatype2		\
 	user_datatype/user_datatype
 endif
-endif
 
 ###################
 # comm example #
 ###################
 
-if BUILD_EXAMPLES
 examplebin_PROGRAMS +=			\
 	comm/comm			\
 	comm/mix_comm
@@ -374,13 +358,11 @@ starpu_mpi_EXAMPLES	+=			\
 	comm/comm				\
 	comm/mix_comm
 endif
-endif
 
 ##################
 # filter example #
 ##################
 
-if BUILD_EXAMPLES
 examplebin_PROGRAMS +=			\
 	filters/filter
 
@@ -388,7 +370,6 @@ if !STARPU_SIMGRID
 starpu_mpi_EXAMPLES	+=			\
 	filters/filter
 endif
-endif
 
 # Native Fortran example
 
@@ -401,7 +382,6 @@ native_fortran/fstarpu_mpi_mod.f90:
 	$(LN_S) $(abs_top_srcdir)/mpi/include/$(notdir $@) $@
 
 if STARPU_HAVE_MPIFORT
-if BUILD_EXAMPLES
 if !STARPU_SANITIZE
 # - express the creation of .mod along .o
 fstarpu_mod.mod: native_fortran/fstarpu_mod.o
@@ -416,4 +396,3 @@ native_fortran/nf_mm_task_build.o: nf_mm_cl.mod fstarpu_mpi_mod.mod fstarpu_mod.
 native_fortran/nf_basic_ring.o: fstarpu_mpi_mod.mod fstarpu_mod.mod
 endif
 endif
-endif

+ 35 - 14
mpi/tests/Makefile.am

@@ -19,6 +19,8 @@ include $(top_srcdir)/starpu.mk
 CC=$(MPICC)
 CCLD=$(MPICC)
 
+noinst_PROGRAMS		=
+
 if STARPU_HAVE_WINDOWS
 LOADER_BIN		=
 else
@@ -26,6 +28,7 @@ loader_CPPFLAGS 	= 	$(AM_CFLAGS) $(AM_CPPFLAGS) -I$(top_builddir)/src/
 if !STARPU_SIMGRID
 LOADER			=	loader
 LOADER_BIN		=	$(abs_top_builddir)/mpi/tests/$(LOADER)
+noinst_PROGRAMS		+=	loader
 endif
 loader_SOURCES		=	../../tests/loader.c
 endif
@@ -62,6 +65,8 @@ EXTRA_DIST = 				\
 	abstract_sendrecv_bench.h	\
 	bench_helper.h			\
 	helper.h			\
+	gemm_helper.h			\
+	burst_helper.h			\
 	user_defined_datatype_value.h
 
 examplebindir = $(libdir)/starpu/examples/mpi
@@ -91,8 +96,6 @@ AM_LDFLAGS = $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS) $(FXT_LDFLAGS) $(ST
 # Unit testcases       #
 ########################
 
-if BUILD_TESTS
-
 starpu_mpi_TESTS =
 
 starpu_mpi_TESTS +=				\
@@ -140,11 +143,17 @@ starpu_mpi_TESTS +=				\
 	user_defined_datatype			\
 	early_stuff				\
 	sendrecv_bench				\
+	burst
+
+if !STARPU_USE_MPI_MPI
+starpu_mpi_TESTS +=				\
 	sendrecv_parallel_tasks_bench
+endif
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 starpu_mpi_TESTS +=				\
-	sendrecv_gemm_bench
+	sendrecv_gemm_bench			\
+	burst_gemm
 endif
 
 if !STARPU_SIMGRID
@@ -174,7 +183,7 @@ starpu_mpi_TESTS +=				\
 	starpu_redefine
 endif
 
-noinst_PROGRAMS =				\
+noinst_PROGRAMS +=				\
 	datatypes				\
 	pingpong				\
 	mpi_test				\
@@ -235,18 +244,21 @@ noinst_PROGRAMS =				\
 	load_balancer				\
 	driver					\
 	sendrecv_bench				\
-	sendrecv_gemm_bench			\
-	sendrecv_parallel_tasks_bench
+	sendrecv_parallel_tasks_bench		\
+	burst					\
+	nothing
 
-if STARPU_USE_MPI_FT
-noinst_PROGRAMS +=  \
-	checkpoints
-endif STARPU_USE_MPI_FT
+if !STARPU_NO_BLAS_LIB
+noinst_PROGRAMS +=				\
+	sendrecv_gemm_bench			\
+	burst_gemm
+endif
 
 XFAIL_TESTS=					\
 	policy_register_toomany			\
 	policy_unregister			\
-	starpu_redefine
+	starpu_redefine				\
+	nothing
 
 ring_SOURCES = ring.c
 ring_sync_SOURCES = ring_sync.c
@@ -280,13 +292,22 @@ sendrecv_parallel_tasks_bench_SOURCES = sendrecv_parallel_tasks_bench.c
 sendrecv_parallel_tasks_bench_SOURCES += bench_helper.c
 sendrecv_parallel_tasks_bench_SOURCES += abstract_sendrecv_bench.c
 
-if !NO_BLAS_LIB
+burst_SOURCES = burst.c
+burst_SOURCES += burst_helper.c
+
+if !STARPU_NO_BLAS_LIB
 sendrecv_gemm_bench_SOURCES = sendrecv_gemm_bench.c
 sendrecv_gemm_bench_SOURCES += bench_helper.c
+sendrecv_gemm_bench_SOURCES += gemm_helper.c
 sendrecv_gemm_bench_SOURCES += abstract_sendrecv_bench.c
 sendrecv_gemm_bench_SOURCES += ../../examples/common/blas.c
 
 sendrecv_gemm_bench_LDADD = $(STARPU_BLAS_LDFLAGS)
-endif
 
+burst_gemm_SOURCES = burst_gemm.c
+burst_gemm_SOURCES += gemm_helper.c
+burst_gemm_SOURCES += burst_helper.c
+burst_gemm_SOURCES += ../../examples/common/blas.c
+
+burst_gemm_LDADD = $(STARPU_BLAS_LDFLAGS)
 endif

+ 1 - 1
mpi/tests/gemm_helper.c

@@ -288,7 +288,7 @@ int gemm_submit_tasks_with_tags(int with_tags)
  */
 void gemm_add_polling_dependencies()
 {
-	int nb_tasks = nslices * nslices;
+	starpu_tag_t nb_tasks = (starpu_tag_t) nslices * (starpu_tag_t) nslices;
 	unsigned nb_workers = starpu_worker_get_count();
 
 	for (starpu_tag_t synchro_tag = nb_workers+1; synchro_tag <= nb_tasks; synchro_tag += (nb_workers+1))

+ 2 - 2
sc_hypervisor/examples/Makefile.am

@@ -26,7 +26,7 @@ noinst_PROGRAMS =				\
 	lp_test/lp_resize_test			\
 	hierarchical_ctxs/resize_hierarchical_ctxs
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 noinst_PROGRAMS +=				\
 	cholesky/cholesky_implicit
 
@@ -35,7 +35,7 @@ noinst_HEADERS = 				\
 	sched_ctx_utils/sched_ctx_utils.h
 endif
 
-if !NO_BLAS_LIB
+if !STARPU_NO_BLAS_LIB
 
 cholesky_cholesky_implicit_SOURCES =		\
 	cholesky/cholesky_implicit.c		\

+ 1 - 1
socl/examples/Makefile.am

@@ -75,7 +75,7 @@ matmul_matmul_LDADD = -lm
 mansched_mansched_SOURCES = mansched/mansched.c
 
 #mandelbrot_mandelbrot_CPPFLAGS = $(AM_CPPFLAGS) $(AM_CFLAGS)
-#if HAVE_X11
+#if STARPU_HAVE_X11
 #mandelbrot_mandelbrot_CPPFLAGS += $(X_CFLAGS)
 #mandelbrot_mandelbrot_LDADD = $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS)
 #endif

+ 154 - 1
src/common/utils.c

@@ -24,6 +24,7 @@
 #include <unistd.h>
 #endif
 #include <fcntl.h>
+#include <ctype.h>
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #include <io.h>
@@ -517,10 +518,44 @@ char *_starpu_get_home_path(void)
 	return path;
 }
 
+#pragma weak starpu_mpi_world_rank
+extern int starpu_mpi_world_rank(void);
+
 void _starpu_gethostname(char *hostname, size_t size)
 {
+	char *force_mpi_hostnames = starpu_getenv("STARPU_MPI_HOSTNAMES");
 	char *forced_hostname = starpu_getenv("STARPU_HOSTNAME");
-	if (forced_hostname && forced_hostname[0])
+
+	if (force_mpi_hostnames && force_mpi_hostnames[0])
+	{
+		char *host, *srv_hosts;
+		srv_hosts = strdup(force_mpi_hostnames);
+		int rank;
+		if (starpu_mpi_world_rank)
+		{
+			rank = starpu_mpi_world_rank();
+		}
+		else
+		{
+			_STARPU_DISP("StarPU-MPI unavailable, the rank of this process is 0");
+			rank = 0;
+		}
+
+		if (force_mpi_hostnames != NULL)
+		{
+			host = strtok(srv_hosts, " ");
+			while (rank-->0 && (host = strtok(NULL, " ")));
+			if(rank>=0)
+			{
+				_STARPU_MSG("Missing hostnames in STARPU_MPI_HOSTNAMES\n");
+				STARPU_ABORT();
+			}
+		}
+		snprintf(hostname, size-1, "%s", host);
+		free(srv_hosts);
+		hostname[size-1] = 0;
+	}
+	else if (forced_hostname && forced_hostname[0])
 	{
 		snprintf(hostname, size-1, "%s", forced_hostname);
 		hostname[size-1] = 0;
@@ -587,3 +622,121 @@ char *starpu_getenv(const char *str)
 #endif
 	return getenv(str);
 }
+
+int _strings_ncmp(const char *strings[], const char *str)
+{
+	int pos = 0;
+	while (strings[pos])
+	{
+		if ((strlen(str) == strlen(strings[pos]) && strncasecmp(str, strings[pos], strlen(strings[pos])) == 0))
+			break;
+		pos++;
+	}
+	if (strings[pos] == NULL)
+		return -1;
+	return pos;
+}
+
+int starpu_get_env_string_var_default(const char *str, const char *strings[], int defvalue)
+{
+	int val;
+	char *strval;
+
+	strval = starpu_getenv(str);
+	if (!strval)
+	{
+		val = defvalue;
+	}
+	else
+	{
+		val = _strings_ncmp(strings, strval);
+		if (val < 0)
+		{
+			int i;
+			_STARPU_MSG("\n");
+			_STARPU_MSG("Invalid value '%s' for environment variable '%s'\n", strval, str);
+			_STARPU_MSG("Valid values are:\n");
+			for(i=0;strings[i]!=NULL;i++) _STARPU_MSG("\t%s\n",strings[i]);
+			_STARPU_MSG("\n");
+			STARPU_ABORT();
+		}
+	}
+	return val;
+}
+
+static void remove_spaces(char *str)
+{
+	int i = 0;
+	int j = 0;
+
+	while (str[j] != '\0')
+	{
+		if (isspace(str[j]))
+		{
+			j++;
+			continue;
+		}
+		if (j > i)
+		{
+			str[i] = str[j];
+		}
+		i++;
+		j++;
+	}
+	if (j > i)
+	{
+		str[i] = str[j];
+	}
+}
+
+int starpu_get_env_size_default(const char *str, int defval)
+{
+	int val;
+	char *strval;
+
+	strval = starpu_getenv(str);
+	if (!strval)
+	{
+		val = defval;
+	}
+	else
+	{
+		char *value = strdup(strval);
+		if (value == NULL)
+			_STARPU_ERROR("memory allocation failed\n");
+		remove_spaces(value);
+		if (value[0] == '\0')
+		{
+			free(value);
+			val = defval;
+		}
+		else
+		{
+			char *endptr = NULL;
+			int mult = 1024;
+			errno = 0;
+			int v = (int)strtol(value, &endptr, 10);
+			if (errno != 0)
+				_STARPU_ERROR("could not parse environment variable '%s' with value '%s', strtol failed with error %s\n", str, value, strerror(errno));
+			if (*endptr != '\0')
+			{
+				switch (*endptr)
+				{
+				case 'b':
+				case 'B': mult = 1; break;
+				case 'k':
+				case 'K': mult = 1024; break;
+				case 'm':
+				case 'M': mult = 1024*1024; break;
+				case 'g':
+				case 'G': mult = 1024*1024*1024; break;
+				default:
+					_STARPU_ERROR("could not parse environment variable '%s' with value '%s' size suffix invalid\n", str, value);
+				}
+			}
+			val = v*mult;
+			free(value);
+		}
+	}
+	return val;
+}

+ 0 - 1
src/core/topology.h

@@ -24,7 +24,6 @@
 #include <common/list.h>
 #include <common/fxt.h>
 
-/** TODO actually move this struct into this header */
 struct _starpu_machine_config;
 
 #ifndef STARPU_SIMGRID

+ 3 - 0
src/core/workers.c

@@ -1143,6 +1143,9 @@ int starpu_conf_init(struct starpu_conf *conf)
 	/* 64MiB by default */
 	conf->trace_buffer_size = ((uint64_t) starpu_get_env_number_default("STARPU_TRACE_BUFFER_SIZE", 64)) << 20;
 
+	conf->driver_spinning_backoff_min = (unsigned) starpu_get_env_number_default("STARPU_BACKOFF_MIN", 1);
+	conf->driver_spinning_backoff_max = (unsigned) starpu_get_env_number_default("STARPU_BACKOFF_MAX", 32);
+
 	/* Do not start performance counter collection by default */
 	conf->start_perf_counter_collection = 0;
 	return 0;

+ 3 - 5
src/drivers/driver_common/driver_common.c

@@ -28,8 +28,6 @@
 #include <core/debug.h>
 #include <core/task.h>
 
-#define BACKOFF_MAX 32  /* TODO : use parameter to define them */
-#define BACKOFF_MIN 1
 
 void _starpu_driver_start_job(struct _starpu_worker *worker, struct _starpu_job *j, struct starpu_perfmodel_arch* perf_arch, int rank, int profiling)
 {
@@ -374,7 +372,7 @@ static void _starpu_exponential_backoff(struct _starpu_worker *worker)
 {
 	int delay = worker->spinning_backoff;
 
-	if (worker->spinning_backoff < BACKOFF_MAX)
+	if (worker->spinning_backoff < worker->config->conf.driver_spinning_backoff_max)
 		worker->spinning_backoff<<=1;
 
 	while(delay--)
@@ -504,7 +502,7 @@ struct starpu_task *_starpu_get_worker_task(struct _starpu_worker *worker, int w
 	{
 		_starpu_worker_set_status_sleeping(workerid);
 	}
-	worker->spinning_backoff = BACKOFF_MIN;
+	worker->spinning_backoff = worker->config->conf.driver_spinning_backoff_min;
 
 	_starpu_worker_leave_sched_op(worker);
 	STARPU_PTHREAD_COND_BROADCAST(&worker->sched_cond);
@@ -703,7 +701,7 @@ int _starpu_get_multi_worker_task(struct _starpu_worker *workers, struct starpu_
 	}
 
 	_starpu_worker_set_status_wakeup(workerid);
-	worker->spinning_backoff = BACKOFF_MIN;
+	worker->spinning_backoff = worker->config->conf.driver_spinning_backoff_min;
 #endif /* !STARPU_SIMGRID */
 
 	_starpu_worker_leave_sched_op(&workers[0]);

+ 44 - 158
src/util/openmp_runtime_support_environment.c

@@ -50,7 +50,6 @@ static struct starpu_omp_initial_icv_values _initial_icv_values =
 
 struct starpu_omp_initial_icv_values *_starpu_omp_initial_icv_values = NULL;
 
-/* TODO: move to utils */
 static void remove_spaces(char *str)
 {
 	int i = 0;
@@ -75,21 +74,7 @@ static void remove_spaces(char *str)
 		str[i] = str[j];
 	}
 }
-/* TODO: move to utils */
-static int strings_cmp(const char *strings[], const char *str)
-{
-	int mode = 0;
-	while (strings[mode])
-	{
-		if (strncasecmp(str, strings[mode], strlen(strings[mode])) == 0)
-			break;
-		mode++;
-	}
-	if (strings[mode] == NULL)
-		return -1;
-	return mode;
-}
-/* TODO: move to utils */
+
 static int stringsn_cmp(const char *strings[], const char *str, size_t n)
 {
 	int mode = 0;
@@ -104,23 +89,6 @@ static int stringsn_cmp(const char *strings[], const char *str, size_t n)
 	return mode;
 }
 
-/* TODO: move to utils */
-static int read_string_var(const char *str, const char *strings[], int *dst)
-{
-	int val;
-
-	if (!str)
-		return 0;
-
-	val = strings_cmp(strings, str);
-	if (val < 0)
-		return 0;
-
-	*dst = val;
-	return 1;
-}
-
-/* TODO: move to utils */
 static int read_int_var(const char *str, int *dst)
 {
 	char *endptr;
@@ -150,45 +118,18 @@ static int read_int_var(const char *str, int *dst)
 	return 1;
 }
 
-static void read_size_var(const char *var, int *dest)
+int _strings_cmp(const char *strings[], const char *str)
 {
-	const char *env = starpu_getenv(var);
-	if (env)
+	int mode = 0;
+	while (strings[mode])
 	{
-		char *str = strdup(env);
-		if (str == NULL)
-			_STARPU_ERROR("memory allocation failed\n");
-		remove_spaces(str);
-		if (str[0] == '\0')
-		{
-			free(str);
-			return;
-		}
-		char *endptr = NULL;
-		int mult = 1024;
-		errno = 0;
-		int v = (int)strtol(str, &endptr, 10);
-		if (errno != 0)
-			_STARPU_ERROR("could not parse environment variable %s, strtol failed with error %s\n", var, strerror(errno));
-		if (*endptr != '\0')
-		{
-			switch (*endptr)
-			{
-				case 'b':
-				case 'B': mult = 1; break;
-				case 'k':
-				case 'K': mult = 1024; break;
-				case 'm':
-				case 'M': mult = 1024*1024; break;
-				case 'g':
-				case 'G': mult = 1024*1024*1024; break;
-			default:
-				_STARPU_ERROR("could not parse environment variable %s size suffix invalid\n", var);
-			}
-		}
-		*dest = v*mult;
-		free(str);
+		if (strncasecmp(str, strings[mode], strlen(strings[mode])) == 0)
+			break;
+		mode++;
 	}
+	if (strings[mode] == NULL)
+		return -1;
+	return mode;
 }
 
 static void read_sched_var(const char *var, int *dest, unsigned long long *dest_chunk)
@@ -206,7 +147,7 @@ static void read_sched_var(const char *var, int *dest, unsigned long long *dest_
 			return;
 		}
 		static const char *strings[] = { "undefined", "static", "dynamic", "guided", "auto", NULL };
-		int mode = strings_cmp(strings, str);
+		int mode = _strings_cmp(strings, str);
 		if (mode < 0)
 			_STARPU_ERROR("parse error in variable %s\n", var);
 		*dest = mode;
@@ -231,47 +172,6 @@ static void read_sched_var(const char *var, int *dest, unsigned long long *dest_
 	}
 }
 
-static void read_wait_policy_var()
-{
-	const char *strings[] = { "passive", "active", NULL };
-	int ret, value;
-	char *env;
-
-	env = starpu_getenv("OMP_WAIT_POLICY");
-	if (!env)
-		return;
-
-	ret = read_string_var(env, strings, &value);
-	if (!ret)
-	{
-		_STARPU_MSG("StarPU: Invalid value for environment variable OMP_WAIT_POLICY\n");
-		return;
-	}
-	_initial_icv_values.wait_policy_var = value;
-
-}
-
-static void read_display_env_var(int *dest)
-{
-	const char *strings[] = { "false", "true", "verbose", NULL };
-	int ret, value;
-	char *env;
-
-	env = starpu_getenv("OMP_DISPLAY_ENV");
-	if (!env)
-		return;
-
-	ret = read_string_var(env, strings, &value);
-	if (!ret)
-	{
-		_STARPU_MSG("StarPU: Invalid value for environment variable OMP_DISPLAY_ENV\n");
-		return;
-	}
-
-	*dest = value;
-
-}
-
 static int convert_place_name(const char *str, size_t n)
 {
 	static const char *strings[] = { "threads", "cores", "sockets", NULL };
@@ -547,6 +447,21 @@ static void free_places(struct starpu_omp_place *places)
 	}
 }
 
+static int _get_env_string_var(const char *str, const char *strings[], int *dst)
+{
+	int val;
+
+	if (!str)
+		return 0;
+
+	val = _strings_cmp(strings, str);
+	if (val < 0)
+		return 0;
+
+	*dst = val;
+	return 1;
+}
+
 static void read_proc_bind_var()
 {
 	const int max_levels = _initial_icv_values.max_active_levels_var + 1;
@@ -567,7 +482,7 @@ static void read_proc_bind_var()
 		{
 			int value;
 
-			if (!read_string_var(token, strings, &value))
+			if (!_get_env_string_var(token, strings, &value))
 			{
 				_STARPU_MSG("StarPU: Invalid value for environment variable OMP_PROC_BIND\n");
 				break;
@@ -611,55 +526,25 @@ static void read_num_threads_var()
 	_initial_icv_values.nthreads_var = num_threads_list;
 }
 
-static void read_omp_int_var(const char *name, int *icv)
+static void read_omp_environment(void)
 {
-	int ret, value;
-	char *env;
-
-	env = starpu_getenv(name);
-	if (!env)
-		return;
-
-	ret = read_int_var(env, &value);
-	if (!ret || value < 0)
-	{
-		_STARPU_MSG("StarPU: Invalid value for environment variable %s\n", name);
-		return;
-	}
-	*icv = value;
-}
+	const char *boolean_strings[] = { "false", "true", NULL };
 
-static void read_omp_boolean_var(const char *name, int *icv)
-{
-	const char *strings[] = { "false", "true", NULL };
-	int ret, value;
-	char *env;
+	_initial_icv_values.dyn_var = starpu_get_env_string_var_default("OMP_DYNAMIC", boolean_strings, _initial_icv_values.dyn_var);
+	_initial_icv_values.nest_var = starpu_get_env_string_var_default("OMP_NESTED", boolean_strings, _initial_icv_values.nest_var);
 
-	env = starpu_getenv(name);
-	if (!env)
-		return;
+	read_sched_var("OMP_SCHEDULE", &_initial_icv_values.run_sched_var, &_initial_icv_values.run_sched_chunk_var);
+	_initial_icv_values.stacksize_var = starpu_get_env_size_default("OMP_STACKSIZE", _initial_icv_values.stacksize_var);
 
-	ret = read_string_var(env, strings, &value);
-	if (!ret)
 	{
-		_STARPU_MSG("StarPU: Invalid value for environment variable %s\n", name);
-		return;
+		const char *strings[] = { "passive", "active", NULL };
+		_initial_icv_values.wait_policy_var = starpu_get_env_string_var_default("OMP_WAIT_POLICY", strings, _initial_icv_values.wait_policy_var);
 	}
-	*icv = value;
-}
-
-static void read_omp_environment(void)
-{
-	read_omp_boolean_var("OMP_DYNAMIC", &_initial_icv_values.dyn_var);
-	read_omp_boolean_var("OMP_NESTED", &_initial_icv_values.nest_var);
-	read_sched_var("OMP_SCHEDULE", &_initial_icv_values.run_sched_var, &_initial_icv_values.run_sched_chunk_var);
-	read_size_var("OMP_STACKSIZE", &_initial_icv_values.stacksize_var);
-	read_wait_policy_var();
-	read_omp_int_var("OMP_THREAD_LIMIT", &_initial_icv_values.thread_limit_var);
-	read_omp_int_var("OMP_MAX_ACTIVE_LEVELS", &_initial_icv_values.max_active_levels_var);
-	read_omp_boolean_var("OMP_CANCELLATION", &_initial_icv_values.cancel_var);
-	read_omp_int_var("OMP_DEFAULT_DEVICE", &_initial_icv_values.default_device_var);
-	read_omp_int_var("OMP_MAX_TASK_PRIORITY", &_initial_icv_values.max_task_priority_var);
+	_initial_icv_values.thread_limit_var = starpu_get_env_number_default("OMP_THREAD_LIMIT", _initial_icv_values.thread_limit_var);
+	_initial_icv_values.max_active_levels_var = starpu_get_env_number_default("OMP_MAX_ACTIVE_LEVELS", _initial_icv_values.max_active_levels_var);
+	_initial_icv_values.cancel_var = starpu_get_env_string_var_default("OMP_CANCELLATION", boolean_strings, _initial_icv_values.cancel_var);
+	_initial_icv_values.default_device_var = starpu_get_env_number_default("OMP_DEFAULT_DEVICE", _initial_icv_values.default_device_var);
+	_initial_icv_values.max_task_priority_var = starpu_get_env_number_default("OMP_MAX_TASK_PRIORITY", _initial_icv_values.max_task_priority_var);
 
 	/* Avoid overflow e.g. in num_threads_list allocation */
 	STARPU_ASSERT_MSG(_initial_icv_values.max_active_levels_var > 0 && _initial_icv_values.max_active_levels_var < 1000000, "OMP_MAX_ACTIVE_LEVELS should have a reasonable value");
@@ -738,7 +623,7 @@ static void display_omp_environment(int verbosity_level)
 				break;
 		}
 		printf("'\n");
-				
+
 		printf("  [host] OMP_STACKSIZE = '%d'\n", _starpu_omp_initial_icv_values->stacksize_var);
 		printf("  [host] OMP_WAIT_POLICY = '%s'\n", _starpu_omp_initial_icv_values->wait_policy_var?"ACTIVE":"PASSIVE");
 		printf("  [host] OMP_MAX_ACTIVE_LEVELS = '%d'\n", _starpu_omp_initial_icv_values->max_active_levels_var);
@@ -873,8 +758,9 @@ static void display_omp_environment(int verbosity_level)
 void _starpu_omp_environment_init(void)
 {
 	read_omp_environment();
-	int display_env = 0;
-	read_display_env_var(&display_env);
+
+	const char *strings[] = { "false", "true", "verbose", NULL };
+	int display_env = starpu_get_env_string_var_default("OMP_DISPLAY_ENV", strings, 0);
 	if (display_env > 0)
 	{
 		display_omp_environment(display_env);

+ 3 - 1
starpufft/Makefile.am

@@ -17,9 +17,11 @@ include $(top_srcdir)/starpu.mk
 
 SUBDIRS=src
 
-if BUILD_STARPUFFT_EXAMPLES
+if STARPU_BUILD_STARPUFFT_EXAMPLES
+if STARPU_BUILD_TESTS
 SUBDIRS += tests
 endif
+endif
 
 versincludedir = $(includedir)/starpu/$(STARPU_EFFECTIVE_VERSION)
 versinclude_HEADERS = 				\

+ 0 - 2
starpufft/tests/Makefile.am

@@ -53,11 +53,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_builddir)/include -I$(top_srcdir)
 AM_LDFLAGS = $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS) $(FXT_LDFLAGS) $(STARPU_COI_LDFLAGS) $(STARPU_SCIF_LDFLAGS)
 
 examplebin_PROGRAMS =
-if BUILD_EXAMPLES
 examplebin_PROGRAMS +=	\
 	testf 		\
 	test
-endif
 STARPU_FFT_EXAMPLES = testf
 testf_LDADD = ../src/libstarpufft-@STARPU_EFFECTIVE_VERSION@.la $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la $(FFTWF_LIBS)
 

+ 1 - 1
starpurm/Makefile.am

@@ -18,7 +18,7 @@ include $(top_srcdir)/starpu-subdirtests.mk
 
 SUBDIRS=src
 
-if BUILD_STARPURM_EXAMPLES
+if STARPU_BUILD_STARPURM_EXAMPLES
 SUBDIRS += examples
 endif