Thibaud Lambert před 12 roky
rodič
revize
80fb75329a

+ 1 - 0
ChangeLog

@@ -204,6 +204,7 @@ Changes:
   * Tutorial is installed in ${docdir}/tutorial
   * Schedulers eager_central_policy, dm and dmda no longer erroneously respect
     priorities. dmdas has to be used to respect priorities.
+  * Documentation is now generated through doxygen.
 
 Small changes:
   * STARPU_NCPU should now be used instead of STARPU_NCPUS. STARPU_NCPUS is

+ 33 - 9
configure.ac

@@ -785,14 +785,40 @@ AC_DEFUN([STARPU_LOOK_FOR_OPENCL],
 ])
 
 if test x$enable_opencl = xyes -o x$enable_opencl = xmaybe; then
-	STARPU_LOOK_FOR_OPENCL()
-	# in case OpenCL was explicitely required, but is not available, this is an error
-	if test x$enable_opencl = xyes -a x$have_valid_opencl = xno; then
-	    AC_MSG_ERROR([cannot find OpenCL])
-	fi
+   case $target in
+        *-*-darwin*)
+          AC_MSG_CHECKING(whether OpenCL is available)
 
-	# now we enable OpenCL if and only if a proper setup is available
-	enable_opencl=$have_valid_opencl
+          SAVED_LIBS=$LIBS
+          LIBS="$LIBS -framework OpenCL"
+          AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM([[
+          #ifdef __APPLE_CC__
+          #include <OpenCL/opencl.h>
+          #else
+          #include <CL/cl.h>
+          #endif
+          ]],
+            [[return clSetKernelArg(0, 0, 0, 0); ]])],
+          [AC_MSG_RESULT(yes)
+            enable_opencl=yes
+            have_valid_opencl=yes
+            STARPU_OPENCL_CPPFLAGS=
+            STARPU_OPENCL_LDFLAGS="-framework OpenCL"],
+          [AC_MSG_RESULT(no)
+             enable_opencl=no])
+          LIBS=$SAVED_LIBS
+          ;;        
+        *)
+	  STARPU_LOOK_FOR_OPENCL()
+	  # in case OpenCL was explicitely required, but is not available, this is an error
+	  if test x$enable_opencl = xyes -a x$have_valid_opencl = xno; then
+	    AC_MSG_ERROR([cannot find OpenCL])
+	  fi
+	  # now we enable OpenCL if and only if a proper setup is available
+	  enable_opencl=$have_valid_opencl
+          ;;
+   esac
 fi
 
 AC_MSG_CHECKING(whether OpenCL should be used)
@@ -2193,8 +2219,6 @@ AC_OUTPUT([
 	socl/Makefile
 	socl/src/Makefile
 	socl/examples/Makefile
-        socl/socl-1.0.pc
-	socl/socl-1.1.pc
 	socl/vendors/socl.icd
 	libstarpu.pc
 	starpu-1.0.pc

+ 3 - 2
doc/doxygen/Makefile.am

@@ -41,6 +41,7 @@ chapters =	\
 	chapters/configure_options.doxy \
 	chapters/fdl-1.3.doxy \
 	chapters/scaling-vector-example.doxy \
+	chapters/mic_scc_support.doxy \
 	chapters/code/hello_pragma2.c \
 	chapters/code/hello_pragma.c \
 	chapters/code/matmul_pragma.c \
@@ -174,7 +175,7 @@ $(DOX_TAG): $(dox_inputs)
 dist_pdf_DATA = $(DOX_PDF)
 
 $(DOX_PDF): $(DOX_TAG) refman.tex
-	cp $(top_srcdir)/doc/doxygen/chapters/version.sty $(DOX_DIR)
+	cp $(top_srcdir)/doc/doxygen/chapters/version.sty $(DOX_LATEX_DIR)
 	cd $(DOX_LATEX_DIR); \
 	rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
 	sed -i -e 's/__env__/\\_Environment Variables!/' -e 's/\\-\\_\\-\\-\\_\\-env\\-\\_\\-\\-\\_\\-//' ExecutionConfigurationThroughEnvironmentVariables.tex ;\
@@ -194,7 +195,7 @@ $(DOX_PDF): $(DOX_TAG) refman.tex
 	done; \
 	mv refman.pdf ../$(DOX_PDF)
 
-MAINTAINERCLEANFILES = $(DOX_TAG) \
+CLEANFILES = $(DOX_TAG) \
     -r \
     $(DOX_HTML_DIR) \
     $(DOX_LATEX_DIR) \

+ 1 - 1
doc/doxygen/chapters/building.doxy

@@ -79,7 +79,7 @@ Running <c>autogen.sh</c> is not necessary when using the tarball
 releases of StarPU.  If you are using the source code from the svn
 repository, you first need to generate the configure scripts and the
 Makefiles. This requires the availability of <c>autoconf</c>,
-<c>automake</c> >= 2.60, and <c>makeinfo</c>.
+<c>automake</c> >= 2.60.
 
 \verbatim
 $ ./autogen.sh

+ 18 - 1
doc/doxygen/chapters/configure_options.doxy

@@ -99,7 +99,8 @@ Specify <c>hwloc</c> should not be used by StarPU.
 \anchor disable-build-doc
 \addindex __configure__--disable-build-doc
 Disable the creation of the documentation. This should be done on a
-machine which does not have the tools <c>makeinfo</c> and <c>tex</c>.
+machine which does not have the tools <c>doxygen</c> and <c>latex</c>
+(plus the packages <c>latex-xcolor</c> and <c>texlive-latex-extra</c>).
 </dd>
 </dl>
 
@@ -328,6 +329,22 @@ Use the compiler <c>mpicc</c> at <c>path</c>, for StarPU-MPI.
 Enable the activity polling method for StarPU-MPI.
 </dd>
 
+<dt>--with-coi-dir</dt>
+<dd>
+\anchor with-coi-dir
+\addindex __configure__--with-coi-dir
+Specify the directory to the COI library for MIC support.
+The default value is <c>/opt/intel/mic/coi</c>
+</dd>
+
+<dt>--mic-host</dt>
+<dd>
+\anchor mic-host
+\addindex __configure__--mic-host
+Specify the precise MIC architecture host identifier.
+The default value is <c>x86_64-k1om-linux</c>
+</dd>
+
 \section AdvancedConfiguration Advanced Configuration
 
 <dl>

+ 1 - 0
doc/doxygen/chapters/introduction.doxy

@@ -215,6 +215,7 @@ The documentation chapters include
 <li> \ref TipsAndTricksToKnowAbout
 <li> \ref MPISupport
 <li> \ref FFTSupport
+<li> \ref MICSCCSupport
 <li> \ref cExtensions
 <li> \ref SOCLOpenclExtensions
 <li> \ref SchedulingContexts

+ 56 - 0
doc/doxygen/chapters/mic_scc_support.doxy

@@ -0,0 +1,56 @@
+/*
+ * This file is part of the StarPU Handbook.
+ * Copyright (C) 2009--2011  Universit@'e de Bordeaux 1
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012 Institut National de Recherche en Informatique et Automatique
+ * See the file version.doxy for copying conditions.
+ */
+
+/*! \page MICSCCSupport MIC/SCC Support
+
+\section Compilation Compilation
+
+SCC support just needs the presence of the RCCE library.
+
+MIC support actually needs two compilations of StarPU, one for the host and one for
+the device. The PATH environment variable has to include the path to the
+cross-compilation toolchain, for instance <c>/usr/linux-k1om-4.7/bin</c>
+The script <c>mic-configure</c> can then be used to achieve the two compilations: it basically
+calls <c>configure</c> as appropriate from two new directories: <c>build_mic</c> and
+<c>build_host</c>. <c>make</c> and <c>make install</c> can then be used as usual and will
+recurse into both directories.
+
+\section PortingApplicationsToMICSCC Porting Applications To MIC/SCC
+
+The simplest way to port an application to MIC/SCC is to set the field
+starpu_codelet::cpu_funcs_name, to provide StarPU with the function
+name of the CPU implementation. StarPU will thus simply use the
+existing CPU implementation (cross-rebuilt in the MIC case). The
+functions have to be globally-visible (i.e. not <c>static</c>) for
+StarPU to be able to look them up.
+
+For SCC execution, the function starpu_initialize() also has to be
+used instead of starpu_init(), so as to pass <c>argc</c> and
+<c>argv</c>.
+
+\section LaunchingPrograms Launching Programs
+
+SCC programs are started through RCCE.
+
+MIC programs are started from the host. StarPU automatically
+starts the same program on MIC devices. It however needs to get
+the MIC-cross-built binary. It will look for the file given by the
+environment variable \ref STARPU_MIC_SINK_PROGRAM_NAME or in the
+directory given by the environment variable \ref
+STARPU_MIC_SINK_PROGRAM_PATH, or in the field
+starpu_conf::mic_sink_program_path. It will also look in the current
+directory for the same binary name plus the suffix <c>-mic</c> or
+<c>_mic</c>.
+
+The testsuite can be started by simply running <c>make check</c> from the
+top directory. It will recurse into both <c>build_host</c> to run tests with only
+the host, and into <c>build_mic</c> to run tests with both the host and the MIC
+devices. Single tests with the host and the MIC can be run by starting
+<c>./loader-cross.sh ./the_test</c> from <c>build_mic/tests</c>.
+
+*/

+ 7 - 2
doc/doxygen/refman.tex

@@ -12,7 +12,7 @@
 \usepackage{textcomp}
 \usepackage{alltt}
 \usepackage{ifpdf}
-\usepackage{../version}
+\usepackage{./version}
 \ifpdf
 \usepackage[pdftex,
             pagebackref=true,
@@ -114,7 +114,7 @@ Documentation License”.
 \hypertarget{AdvancedExamples}{}
 \input{AdvancedExamples}
 
-\chapter{How to optimize performance with StarPU}
+\chapter{How To Optimize Performance With StarPU}
 \label{HowToOptimizePerformanceWithStarPU}
 \hypertarget{HowToOptimizePerformanceWithStarPU}{}
 \input{HowToOptimizePerformanceWithStarPU}
@@ -139,6 +139,11 @@ Documentation License”.
 \hypertarget{FFTSupport}{}
 \input{FFTSupport}
 
+\chapter{MIC/SCC Support}
+\label{MICSCCSupport}
+\hypertarget{MICSCCSupport}{}
+\input{MICSCCSupport}
+
 \chapter{C Extensions}
 \label{cExtensions}
 \hypertarget{cExtensions}{}

+ 3 - 3
doc/texinfo/chapters/mic-scc-support.texi

@@ -19,14 +19,14 @@ recurse into both directories.
 It can be parameterized with the following environment variables:
 
 @table @asis
-@item @code{MIC_HOST}
+@item @code{STARPU_MIC_HOST}
 Defines the value of the @code{--host} parameter passed to @code{configure} for the
 cross-compilation. The current default is @code{x86_64-k1om-linux}.
 
-@item @code{MIC_CC_PATH}
+@item @code{STARPU_MIC_CC_PATH}
 Defines the path to the MIC cross-compiler. The current default is @code{/usr/linux-k1om-4.7/bin/}.
 
-@item @code{COI_DIR}
+@item @code{STARPU_COI_DIR}
 Defines the path to the COI library. The current default is @code{/opt/intel/mic/coi}
 @end table
 

+ 2 - 2
examples/spmv/matrix_market/mmio.c

@@ -277,8 +277,8 @@ int mm_write_mtx_array_size(FILE *f, int M, int N)
 /* use when I[], J[], and val[]J, and val[] are already allocated */
 /******************************************************************/
 
-int mm_read_mtx_crd_data(FILE *f, int M 
-				 int N, int nz, int I[], int J[],
+int mm_read_mtx_crd_data(FILE *f, int M,
+			 int N, int nz, int I[], int J[],
         double val[], MM_typecode matcode)
 {
     int i;

+ 5 - 1
examples/stencil/life_opencl.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011  Université de Bordeaux 1
+ * Copyright (C) 2010-2011, 2013  Université de Bordeaux 1
  *
  * 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
@@ -19,7 +19,11 @@
 /* #define _externC extern "C" */
 
 #include <stencil.h>
+#ifdef __APPLE__
+#include <OpenCL/cl.h>
+#else
 #include <CL/cl.h>
+#endif
 #include <starpu.h>
 
 #define str(x) #x

+ 27 - 33
mic-configure

@@ -1,12 +1,6 @@
 #!/bin/bash
 
 ROOT_DIR=$PWD
-[ -n "$MIC_HOST" ] || MIC_HOST=x86_64-k1om-linux
-[ -n "$MIC_CC_PATH" ] || MIC_CC_PATH=/usr/linux-k1om-4.7/bin/
-[ -n "$COI_DIR" ] || COI_DIR=/opt/intel/mic/coi
-DEFAULT_PREFIX=/usr/local
-
-export PATH=${MIC_CC_PATH}${PATH:+:${PATH}}
 
 cat > ./mic-config.log << EOF
 This file was created by StarPU mic-configure
@@ -14,38 +8,38 @@ This file was created by StarPU mic-configure
  $ $0 $*
 EOF
 
-for arch in mic host
+prefix="/usr/local"
+coi_dir="/opt/intel/mic/coi"
+mic_host="x86_64-k1om-linux"
+
+for arg in $*
 do
+	case $arg in 
+		--prefix=*)
+			prefix="${arg#--prefix=}"
+			;;
+		--with-coi-dir=*)
+			coi_dir="${arg#--with-coi-dir=}"
+			;;
+		--mic-host=*)
+			mic_host="${arg#--mic-host=}"
+			;;
+	esac
+
+done
 
+for arch in mic host
+do
 	# We call the configure script from a build directory further in the
 	# arborescence
-	command="${ROOT_DIR}/configure --enable-mic --with-coi-dir=$COI_DIR"
-	prefix_found=no
+
+	command="${ROOT_DIR}/configure"
+	params="--enable-mic --with-coi-dir=$coi_dir --prefix=$prefix/$arch"
 
 	if test x$arch = xmic ; then
-		command="$command --without-hwloc --with-coi-lib-dir=$COI_DIR/device-linux-release/lib --host=$MIC_HOST"
+		params="$params --without-hwloc --with-coi-lib-dir=$coi_dir/device-linux-release/lib --host=$mic_host"
 	else
-		command="$command --with-coi-lib-dir=$COI_DIR/host-linux-release/lib"
-	fi
-
-	for arg in $*
-	do
-		if [ ${arg:0:9} = '--prefix=' ]
-		then
-			prefix_found=yes
-			prefix="${arg:9}"
-			command="$command ${arg}/${arch}"
-		else
-			command="$command $arg"
-		fi
-
-	done
-
-	# If the user didn't specify a directory where to install the library
-	# we apply the default one
-	if test x$prefix_found = xno ; then
-		command="$command --prefix=${DEFAULT_PREFIX}/$arch"
-		prefix=${DEFAULT_PREFIX}
+		params="$params --with-coi-lib-dir=$coi_dir/host-linux-release/lib"
 	fi
 
 	# If the build directory doesn't exist yet, create it
@@ -56,9 +50,9 @@ do
 	cd "build_${arch}"
 
 	if test x$arch = xmic ; then
-		LDFLAGS=-export-dynamic $command
+		LDFLAGS=-export-dynamic $command $* $params
 	else
-		$command
+		$command $* $params
 	fi
 	if [ "$?" != 0 ]
 	then

+ 2 - 2
mpi/starpumpi-1.1.pc.in

@@ -1,6 +1,6 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2009-2011  Université de Bordeaux 1
+# Copyright (C) 2009-2011, 2013  Université de Bordeaux 1
 # Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -25,5 +25,5 @@ Version: @PACKAGE_VERSION@
 Cflags: -I${includedir}/starpu/@STARPU_EFFECTIVE_VERSION@
 Libs: -L${libdir} -lstarpumpi-@STARPU_EFFECTIVE_VERSION@
 Libs.private: @LDFLAGS@ @LIBS@
-Requires: starpu-1.0
+Requires: starpu-1.1
 Requires.private:

+ 2 - 2
mpi/starpumpi-1.2.pc.in

@@ -1,6 +1,6 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2009-2011  Université de Bordeaux 1
+# Copyright (C) 2009-2011, 2013  Université de Bordeaux 1
 # Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
 #
 # StarPU is free software; you can redistribute it and/or modify
@@ -25,5 +25,5 @@ Version: @PACKAGE_VERSION@
 Cflags: -I${includedir}/starpu/@STARPU_EFFECTIVE_VERSION@
 Libs: -L${libdir} -lstarpumpi-@STARPU_EFFECTIVE_VERSION@
 Libs.private: @LDFLAGS@ @LIBS@
-Requires: starpu-1.0
+Requires: starpu-1.2
 Requires.private:

+ 2 - 1
sc_hypervisor/src/policies_utils/policy_tools.c

@@ -14,9 +14,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-
 #include "sc_hypervisor_policy.h"
 #include "sc_hypervisor_intern.h"
+#include <math.h>
+
 static int _compute_priority(unsigned sched_ctx)
 {
 	struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sched_ctx);

+ 0 - 5
socl/Makefile.am

@@ -17,11 +17,6 @@ SUBDIRS = src examples
 
 EXTRA_DIST = README
 
-libsocl_la_includedir=$(includedir)/starpu/$(STARPU_EFFECTIVE_VERSION)/socl/CL
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = socl-1.0.pc socl-1.1.pc
-
 showcheck:
 	for i in $(SUBDIRS) ; do \
 		make -C $$i showcheck ; \

+ 0 - 2
socl/README

@@ -3,5 +3,3 @@ StarPU's OpenCL interface
 
 This directory contains an OpenCL implementation that can
 be used as a replacement of the classic StarPU's API.
-
-OpenCL applications need to be compiled using provided headers.

+ 0 - 29
socl/socl-1.0.pc.in

@@ -1,29 +0,0 @@
-# StarPU --- Runtime system for heterogeneous multicore architectures.
-#
-# Copyright (C) 2009-2011  Université de Bordeaux 1
-# Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
-#
-# 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.
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: socl
-Description: offers OpenCL implementation on top of StarPU
-Version: @PACKAGE_VERSION@
-Cflags: -I${includedir}/starpu/@STARPU_EFFECTIVE_VERSION@/socl
-Libs: -L${libdir} -lsocl-@STARPU_EFFECTIVE_VERSION@
-Libs.private: @LDFLAGS@ @LIBS@
-Requires: starpu-1.0
-Requires.private:

+ 0 - 29
socl/socl-1.1.pc.in

@@ -1,29 +0,0 @@
-# StarPU --- Runtime system for heterogeneous multicore architectures.
-#
-# Copyright (C) 2009-2011  Université de Bordeaux 1
-# Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
-#
-# 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.
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: socl
-Description: offers OpenCL implementation on top of StarPU
-Version: @PACKAGE_VERSION@
-Cflags: -I${includedir}/starpu/@STARPU_EFFECTIVE_VERSION@/socl
-Libs: -L${libdir} -lsocl-@STARPU_EFFECTIVE_VERSION@
-Libs.private: @LDFLAGS@ @LIBS@
-Requires: starpu-1.0
-Requires.private:

+ 0 - 29
socl/socl-1.2.pc.in

@@ -1,29 +0,0 @@
-# StarPU --- Runtime system for heterogeneous multicore architectures.
-#
-# Copyright (C) 2009-2011  Université de Bordeaux 1
-# Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
-#
-# 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.
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: socl
-Description: offers OpenCL implementation on top of StarPU
-Version: @PACKAGE_VERSION@
-Cflags: -I${includedir}/starpu/@STARPU_EFFECTIVE_VERSION@/socl
-Libs: -L${libdir} -lsocl-@STARPU_EFFECTIVE_VERSION@
-Libs.private: @LDFLAGS@ @LIBS@
-Requires: starpu-1.0
-Requires.private:

+ 0 - 1
socl/vendors/socl.icd.in

@@ -1,2 +1 @@
 @STARPU_BUILD_DIR@/socl/src/.libs/libsocl-@STARPU_EFFECTIVE_VERSION@.so
-

+ 19 - 11
src/datawizard/memalloc.c

@@ -585,7 +585,7 @@ static size_t free_potentially_in_use_mc(unsigned node, unsigned force, size_t r
 {
 	size_t freed = 0;
 
-	struct _starpu_mem_chunk *mc, *next_mc = NULL;
+	struct _starpu_mem_chunk *mc, *next_mc = (void*) -1;
 
 	/*
 	 * We have to unlock mc_rwlock before locking header_lock, so we have
@@ -598,23 +598,31 @@ static size_t free_potentially_in_use_mc(unsigned node, unsigned force, size_t r
 	while (1)
 	{
 		STARPU_PTHREAD_RWLOCK_WRLOCK(&mc_rwlock[node]);
-		/* A priori, start from the beginning */
-		mc = _starpu_mem_chunk_list_begin(mc_list[node]);
-		if (next_mc)
-			/* Unless we might restart from where we were */
+
+		if (_starpu_mem_chunk_list_empty(mc_list[node]) || !next_mc)
+		{
+			STARPU_PTHREAD_RWLOCK_UNLOCK(&mc_rwlock[node]);
+			/* We reached the end of the list :/ */
+			break;
+		}
+
+		if (next_mc == (void*) -1) {
+			/* First iteration ever, start from beginning */
+			mc = _starpu_mem_chunk_list_begin(mc_list[node]);
+		} else {
+			/* Try to restart from where we were */
 			for (mc = _starpu_mem_chunk_list_begin(mc_list[node]);
 			     mc != _starpu_mem_chunk_list_end(mc_list[node]);
 			     mc = _starpu_mem_chunk_list_next(mc))
 				if (mc == next_mc)
-					/* Yes, restart from there.  */
+					/* Found it, restart from there.  */
 					break;
 
-		if (mc == _starpu_mem_chunk_list_end(mc_list[node]))
-		{
-			/* But it was the last one of the list :/ */
-			STARPU_PTHREAD_RWLOCK_UNLOCK(&mc_rwlock[node]);
-			break;
+			if (mc == _starpu_mem_chunk_list_end(mc_list[node]))
+				/* Couldn't find next_mc, restart from the beginning :/ */
+				mc = _starpu_mem_chunk_list_begin(mc_list[node]);
 		}
+
 		/* Remember where to try next */
 		next_mc = _starpu_mem_chunk_list_next(mc);
 		STARPU_PTHREAD_RWLOCK_UNLOCK(&mc_rwlock[node]);

+ 2 - 1
src/sched_policies/parallel_eager.c

@@ -179,7 +179,8 @@ static int push_task_peager_policy(struct starpu_task *task)
 		worker = workers->get_next(workers, &it);
 		int master = data->master_id[worker];
 		/* If this is not a CPU, then the worker simply grabs tasks from the fifo */
-		if (starpu_worker_get_type(worker) != STARPU_CPU_WORKER  || master == worker)
+		if (!starpu_worker_is_combined_worker(worker) &&
+				starpu_worker_get_type(worker) != STARPU_CPU_WORKER  || master == worker)
 		{
 			starpu_pthread_mutex_t *sched_mutex;
 			starpu_pthread_cond_t *sched_cond;