Browse Source

merge trunk

Corentin Salingue 12 years ago
parent
commit
8281604526
32 changed files with 491 additions and 209 deletions
  1. 4 0
      configure.ac
  2. 15 2
      doc/doxygen/Makefile.am
  3. 4 4
      doc/doxygen/chapters/api/codelet_and_tasks.doxy
  4. 2 2
      doc/doxygen/chapters/api/cuda_extensions.doxy
  5. 47 47
      doc/doxygen/chapters/api/data_interfaces.doxy
  6. 1 1
      doc/doxygen/chapters/api/data_management.doxy
  7. 4 0
      doc/doxygen/chapters/api/mic_extensions.doxy
  8. 4 4
      doc/doxygen/chapters/api/multiformat_data_interface.doxy
  9. 3 3
      doc/doxygen/chapters/api/opencl_extensions.doxy
  10. 4 0
      doc/doxygen/chapters/api/scc_extensions.doxy
  11. 11 0
      doc/doxygen/chapters/environment_variables.doxy
  12. 50 0
      doc/doxygen/chapters/files.doxy
  13. 1 0
      doc/doxygen/chapters/introduction.doxy
  14. 52 0
      doc/doxygen/chapters/socl_opencl_extensions.doxy
  15. 8 0
      doc/doxygen/dev/checkDoc.sh
  16. 7 7
      doc/doxygen/dev/starpu_check_undocumented.sh
  17. 3 1
      doc/doxygen/doxygen-config.cfg.in
  18. 4 3
      doc/doxygen/doxygen.cfg
  19. 46 0
      doc/doxygen/refman.tex
  20. 2 2
      include/starpu_data_interfaces.h
  21. 6 3
      sc_hypervisor/examples/Makefile.am
  22. 13 1
      sc_hypervisor/include/sc_hypervisor_policy.h
  23. 59 34
      sc_hypervisor/src/hypervisor_policies/feft_lp_policy.c
  24. 0 1
      sc_hypervisor/src/hypervisor_policies/ispeed_lp_policy.c
  25. 103 61
      sc_hypervisor/src/hypervisor_policies/teft_lp_policy.c
  26. 11 11
      sc_hypervisor/src/policies_utils/policy_tools.c
  27. 4 3
      sc_hypervisor/src/sc_hypervisor.c
  28. 1 4
      sc_hypervisor/src/sc_hypervisor_intern.h
  29. 3 0
      socl/Makefile.am
  30. 1 0
      socl/vendors/install/socl.icd.in
  31. 1 1
      src/core/combined_workers.c
  32. 17 14
      src/datawizard/memalloc.c

+ 4 - 0
configure.ac

@@ -2207,14 +2207,17 @@ AC_CONFIG_COMMANDS([executable-scripts], [
 
 # Create links to ICD files in build/socl/vendors directory. SOCL will use this
 # directory as the OCL_ICD_VENDORS directory
+SOCL_VENDORS="vendors/install/socl.icd"
 for icd in /etc/OpenCL/vendors/*.icd ; do
 	if test -f $icd ; then
 	        if test "$(basename $icd)" != "socl.icd" ; then
         		new_icd=$(basename $icd)
 			AC_CONFIG_LINKS([socl/vendors/$new_icd:$icd])
+			SOCL_VENDORS="$SOCL_VENDORS vendors/$new_icd"
 		fi
         fi
 done
+AC_SUBST(SOCL_VENDORS)
 
 AC_CONFIG_FILES(tests/regression/regression.sh tests/regression/profiles tests/regression/profiles.build.only)
 AC_CONFIG_HEADER(src/common/config.h include/starpu_config.h gcc-plugin/include/starpu-gcc/config.h starpu-top/config.h)
@@ -2230,6 +2233,7 @@ AC_OUTPUT([
 	socl/src/Makefile
 	socl/examples/Makefile
 	socl/vendors/socl.icd
+	socl/vendors/install/socl.icd
 	libstarpu.pc
 	starpu-1.0.pc
 	starpu-1.1.pc

+ 15 - 2
doc/doxygen/Makefile.am

@@ -42,6 +42,7 @@ chapters =	\
 	chapters/fdl-1.3.doxy \
 	chapters/scaling-vector-example.doxy \
 	chapters/mic_scc_support.doxy \
+	chapters/files.doxy \
 	chapters/code/hello_pragma2.c \
 	chapters/code/hello_pragma.c \
 	chapters/code/scal_pragma.cu \
@@ -90,6 +91,9 @@ chapters =	\
 	chapters/api/versioning.doxy \
 	chapters/api/workers.doxy
 
+starpu_config.h: $(top_srcdir)/include/starpu_config.h.in
+	sed 's/#undef \(.*\)/#define \1 1/' $< > $@
+
 chapters/version.sty: $(chapters)
 	@-for f in $(chapters) ; do \
                 if test -f $(top_srcdir)/doc/doxygen/$$f ; then stat --format=%Y $(top_srcdir)/doc/doxygen/$$f 2>/dev/null ; fi \
@@ -135,6 +139,7 @@ EXTRA_DIST	= 		\
 
 dox_inputs = $(DOX_CONFIG) 				\
 	$(chapters) 					\
+	starpu_config.h					\
 	chapters/version.sty				\
 	chapters/version.html				\
 	$(top_srcdir)/include/starpu.h			\
@@ -166,12 +171,19 @@ dox_inputs = $(DOX_CONFIG) 				\
 	$(top_srcdir)/include/starpu_driver.h		\
 	$(top_srcdir)/include/starpu_stdlib.h		\
 	$(top_srcdir)/include/starpu_thread.h		\
-	$(top_srcdir)/include/starpu_thread_util.h
+	$(top_srcdir)/include/starpu_thread_util.h	\
+	$(top_srcdir)/mpi/include/starpu_mpi.h 		\
+	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor.h 		\
+	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_config.h 	\
+	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_lp.h		\
+	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_monitoring.h	\
+	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_policy.h
 
 $(DOX_TAG): $(dox_inputs)
 	rm -fr $(DOX_HTML_DIR) $(DOX_LATEX_DIR)
 	$(DOXYGEN) $(DOX_CONFIG)
 	sed -i 's/ModuleDocumentation <\/li>/<a class="el" href="modules.html">Modules<\/a>/' html/index.html
+	sed -i 's/FileDocumentation <\/li>/<a class="el" href="files.html">Files<\/a>/' html/index.html
 
 dist_pdf_DATA = $(DOX_PDF)
 
@@ -182,6 +194,7 @@ $(DOX_PDF): $(DOX_TAG) refman.tex
 	sed -i -e 's/__env__/\\_Environment Variables!/' -e 's/\\-\\_\\-\\-\\_\\-env\\-\\_\\-\\-\\_\\-//' ExecutionConfigurationThroughEnvironmentVariables.tex ;\
 	sed -i -e 's/__configure__/\\_Configure Options!/' -e 's/\\-\\_\\-\\-\\_\\-configure\\-\\_\\-\\-\\_\\-//' CompilationConfiguration.tex ;\
 	sed -i s'/\\item Module\\-Documentation/\\item \\hyperlink{ModuleDocumentation}{Module Documentation}/' index.tex ;\
+	sed -i s'/\\item File\\-Documentation/\\item \\hyperlink{FileDocumentation}{File Documentation}/' index.tex ;\
 	$(PDFLATEX) refman.tex; \
 	$(MAKEINDEX) refman.idx;\
 	$(PDFLATEX) refman.tex; \
@@ -196,7 +209,7 @@ $(DOX_PDF): $(DOX_TAG) refman.tex
 	done; \
 	mv refman.pdf ../$(DOX_PDF)
 
-CLEANFILES = $(DOX_TAG) \
+CLEANFILES = $(DOX_TAG) starpu_config.h \
     -r \
     $(DOX_HTML_DIR) \
     $(DOX_LATEX_DIR) \

+ 4 - 4
doc/doxygen/chapters/api/codelet_and_tasks.doxy

@@ -534,7 +534,7 @@ It is possible to initialize statically allocated tasks with
 this value. This is equivalent to initializing a structure starpu_task
 with the function starpu_task_init() function.
 
-\def STARPU_TASK_GET_HANDLE(struct starpu_task *task, int i)
+\def STARPU_TASK_GET_HANDLE(task, i)
 \ingroup API_Codelet_And_Tasks
 Return the \p i th data handle of the given task. If the task
 is defined with a static or dynamic number of handles, will either
@@ -542,7 +542,7 @@ return the \p i th element of the field starpu_task::handles or the \p
 i th element of the field starpu_task::dyn_handles (see \ref
 SettingTheDataHandlesForATask)
 
-\def STARPU_TASK_SET_HANDLE(struct starpu_task *task, starpu_data_handle_t handle, int i)
+\def STARPU_TASK_SET_HANDLE(task, handle, i)
 \ingroup API_Codelet_And_Tasks
 Set the \p i th data handle of the given task with the given
 dat handle. If the task is defined with a static or dynamic number of
@@ -551,7 +551,7 @@ starpu_task::handles or the \p i th element of the field
 starpu_task::dyn_handles (see \ref
 SettingTheDataHandlesForATask)
 
-\def STARPU_CODELET_GET_MODE(struct starpu_codelet *codelet, int i)
+\def STARPU_CODELET_GET_MODE(codelet, i)
 \ingroup API_Codelet_And_Tasks
 Return the access mode of the \p i th data handle of the given
 codelet. If the codelet is defined with a static or dynamic number of
@@ -560,7 +560,7 @@ starpu_codelet::modes or the \p i th element of the field
 starpu_codelet::dyn_modes (see \ref
 SettingTheDataHandlesForATask)
 
-\def STARPU_CODELET_SET_MODE(struct starpu_codelet *codelet, enum starpu_data_access_mode mode, int i)
+\def STARPU_CODELET_SET_MODE(codelet, mode, i)
 \ingroup API_Codelet_And_Tasks
 Set the access mode of the \p i th data handle of the given
 codelet. If the codelet is defined with a static or dynamic number of

+ 2 - 2
doc/doxygen/chapters/api/cuda_extensions.doxy

@@ -35,7 +35,7 @@ This function returns a pointer to device properties for worker
 \ingroup API_CUDA_Extensions
 Report a CUDA error.
 
-\def STARPU_CUDA_REPORT_ERROR(cudaError_t status)
+\def STARPU_CUDA_REPORT_ERROR(status)
 \ingroup API_CUDA_Extensions
 Calls starpu_cuda_report_error(), passing the current function, file and line position.
 
@@ -72,7 +72,7 @@ every CUDA device.
 \ingroup API_CUDA_Extensions
 Report a cublas error.
 
-\def STARPU_CUBLAS_REPORT_ERROR(cublasStatus status)
+\def STARPU_CUBLAS_REPORT_ERROR(status)
 \ingroup API_CUDA_Extensions
 Calls starpu_cublas_report_error(), passing the current
 function, file and line position.

+ 47 - 47
doc/doxygen/chapters/api/data_interfaces.doxy

@@ -368,7 +368,7 @@ Return a device handle for the variable designated by
 \p interface, to be used on OpenCL. The offset documented below has to be
 used in addition to this.
 
-\def STARPU_VARIABLE_GET_OFFSET()
+\def STARPU_VARIABLE_GET_OFFSET(interface)
 \ingroup API_Data_Interfaces
 Return the offset in the variable designated by \p interface, to
 be used with the device handle.
@@ -404,29 +404,29 @@ Return the size of each element of the array designated by \p handle.
 \ingroup API_Data_Interfaces
 Return the local pointer associated with \p handle.
 
-\def STARPU_VECTOR_GET_PTR(void *interface)
+\def STARPU_VECTOR_GET_PTR(interface)
 \ingroup API_Data_Interfaces
 Return a pointer to the array designated by \p interface, valid on
 CPUs and CUDA only. For OpenCL, the device handle and offset need to
 be used instead.
 
-\def STARPU_VECTOR_GET_DEV_HANDLE(void *interface)
+\def STARPU_VECTOR_GET_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the array designated by \p interface,
 to be used on OpenCL. the offset documented below has to be used in
 addition to this.
 
-\def STARPU_VECTOR_GET_OFFSET(void *interface)
+\def STARPU_VECTOR_GET_OFFSET(interface)
 \ingroup API_Data_Interfaces
 Return the offset in the array designated by \p interface, to be
 used with the device handle.
 
-\def STARPU_VECTOR_GET_NX(void *interface)
+\def STARPU_VECTOR_GET_NX(interface)
 \ingroup API_Data_Interfaces
 Return the number of elements registered into the array
 designated by \p interface.
 
-\def STARPU_VECTOR_GET_ELEMSIZE(void *interface)
+\def STARPU_VECTOR_GET_ELEMSIZE(interface)
 \ingroup API_Data_Interfaces
 Return the size of each element of the array designated by
 \p interface.
@@ -479,39 +479,39 @@ Return the local pointer associated with \p handle.
 Return the size of the elements registered into the matrix
 designated by \p handle.
 
-\def STARPU_MATRIX_GET_PTR(void *interface)
+\def STARPU_MATRIX_GET_PTR(interface)
 \ingroup API_Data_Interfaces
 Return a pointer to the matrix designated by \p interface, valid
 on CPUs and CUDA devices only. For OpenCL devices, the device handle
 and offset need to be used instead.
 
-\def STARPU_MATRIX_GET_DEV_HANDLE(void *interface)
+\def STARPU_MATRIX_GET_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the matrix designated by \p interface,
 to be used on OpenCL. The offset documented below has to be used in
 addition to this.
 
-\def STARPU_MATRIX_GET_OFFSET(void *interface)
+\def STARPU_MATRIX_GET_OFFSET(interface)
 \ingroup API_Data_Interfaces
 Return the offset in the matrix designated by \p interface, to be
 used with the device handle.
 
-\def STARPU_MATRIX_GET_NX(void *interface)
+\def STARPU_MATRIX_GET_NX(interface)
 \ingroup API_Data_Interfaces
 Return the number of elements on the x-axis of the matrix
 designated by \p interface.
 
-\def STARPU_MATRIX_GET_NY(void *interface)
+\def STARPU_MATRIX_GET_NY(interface)
 \ingroup API_Data_Interfaces
 Return the number of elements on the y-axis of the matrix
 designated by \p interface.
 
-\def STARPU_MATRIX_GET_LD(void *interface)
+\def STARPU_MATRIX_GET_LD(interface)
 \ingroup API_Data_Interfaces
 Return the number of elements between each row of the matrix
 designated by \p interface. May be equal to nx when there is no padding.
 
-\def STARPU_MATRIX_GET_ELEMSIZE(void *interface)
+\def STARPU_MATRIX_GET_ELEMSIZE(interface)
 \ingroup API_Data_Interfaces
 Return the size of the elements registered into the matrix
 designated by \p interface.
@@ -522,7 +522,7 @@ designated by \p interface.
 \struct starpu_block_interface
 Block interface for 3D dense blocks
 \ingroup API_Data_Interfaces
-\struct starpu_block_interface::id
+\var starpu_block_interface::id
 identifier of the interface
 \var starpu_block_interface::ptr
 local pointer of the block
@@ -577,48 +577,48 @@ Return the local pointer associated with \p handle.
 Return the size of the elements of the block designated by
 \p handle.
 
-\def STARPU_BLOCK_GET_PTR(void *interface)
+\def STARPU_BLOCK_GET_PTR(interface)
 \ingroup API_Data_Interfaces
 Return a pointer to the block designated by \p interface.
 
-\def STARPU_BLOCK_GET_DEV_HANDLE(void *interface)
+\def STARPU_BLOCK_GET_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the block designated by \p interface,
 to be used on OpenCL. The offset document below has to be used in
 addition to this.
 
-\def STARPU_BLOCK_GET_OFFSET(void *interface)
+\def STARPU_BLOCK_GET_OFFSET(interface)
 \ingroup API_Data_Interfaces
 Return the offset in the block designated by \p interface, to be
 used with the device handle.
 
-\def STARPU_BLOCK_GET_NX(void *interface)
+\def STARPU_BLOCK_GET_NX(interface)
 \ingroup API_Data_Interfaces
 Return the number of elements on the x-axis of the block
 designated by \p interface.
 
-\def STARPU_BLOCK_GET_NY(void *interface)
+\def STARPU_BLOCK_GET_NY(interface)
 \ingroup API_Data_Interfaces
 Return the number of elements on the y-axis of the block
 designated by \p interface.
 
-\def STARPU_BLOCK_GET_NZ(void *interface)
+\def STARPU_BLOCK_GET_NZ(interface)
 \ingroup API_Data_Interfaces
 Return the number of elements on the z-axis of the block
 designated by \p interface.
 
-\def STARPU_BLOCK_GET_LDY(void *interface)
+\def STARPU_BLOCK_GET_LDY(interface)
 \ingroup API_Data_Interfaces
 Return the number of elements between each row of the block
 designated by \p interface. May be equal to nx when there is no padding.
 
-\def STARPU_BLOCK_GET_LDZ(void *interface)
+\def STARPU_BLOCK_GET_LDZ(interface)
 \ingroup API_Data_Interfaces
 Return the number of elements between each z plane of the block
 designated by \p interface. May be equal to nx*ny when there is no
 padding.
 
-\def STARPU_BLOCK_GET_ELEMSIZE(void *interface)
+\def STARPU_BLOCK_GET_ELEMSIZE(interface)
 \ingroup API_Data_Interfaces
 Return the size of the elements of the block designated by
 \p interface.
@@ -694,45 +694,45 @@ Return the numberof columns in a block.
 Return the size of the elements in the matrix designated by
 \p handle.
 
-\def STARPU_BCSR_GET_NNZ(void *interface)
+\def STARPU_BCSR_GET_NNZ(interface)
 \ingroup API_Data_Interfaces
 Return the number of non-zero values in the matrix designated
 by \p interface.
 
-\def STARPU_BCSR_GET_NZVAL(void *interface)
+\def STARPU_BCSR_GET_NZVAL(interface)
 \ingroup API_Data_Interfaces
 Return a pointer to the non-zero values of the matrix
 designated by \p interface.
 
-\def STARPU_BCSR_GET_NZVAL_DEV_HANDLE(void *interface)
+\def STARPU_BCSR_GET_NZVAL_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the array of non-zero values in the
 matrix designated by \p interface. The offset documented below has to be
 used in addition to this.
 
-\def STARPU_BCSR_GET_COLIND(void *interface)
+\def STARPU_BCSR_GET_COLIND(interface)
 \ingroup API_Data_Interfaces
 Return a pointer to the column index of the matrix designated
 by \p interface.
 
-\def STARPU_BCSR_GET_COLIND_DEV_HANDLE(void *interface)
+\def STARPU_BCSR_GET_COLIND_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the column index of the matrix
 designated by \p interface. The offset documented below has to be used in
 addition to this.
 
-\def STARPU_BCSR_GET_ROWPTR(void *interface)
+\def STARPU_BCSR_GET_ROWPTR(interface)
 \ingroup API_Data_Interfaces
 Return a pointer to the row pointer array of the matrix
 designated by \p interface.
 
-\def STARPU_CSR_GET_ROWPTR_DEV_HANDLE(void *interface)
+\def STARPU_CSR_GET_ROWPTR_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the row pointer array of the matrix
 designated by \p interface. The offset documented below has to be used in
 addition to this.
 
-\def STARPU_BCSR_GET_OFFSET(void *interface)
+\def STARPU_BCSR_GET_OFFSET
 \ingroup API_Data_Interfaces
 Return the offset in the arrays (coling, rowptr, nzval) of the
 matrix designated by \p interface, to be used with the device handles.
@@ -795,60 +795,60 @@ designated by \p handle.
 Return the size of the elements registered into the matrix
 designated by \p handle.
 
-\def STARPU_CSR_GET_NNZ(void *interface)
+\def STARPU_CSR_GET_NNZ(interface)
 \ingroup API_Data_Interfaces
 Return the number of non-zero values in the matrix designated
 by \p interface.
 
-\def STARPU_CSR_GET_NROW(void *interface)
+\def STARPU_CSR_GET_NROW(interface)
 \ingroup API_Data_Interfaces
 Return the size of the row pointer array of the matrix
 designated by \p interface.
 
-\def STARPU_CSR_GET_NZVAL(void *interface)
+\def STARPU_CSR_GET_NZVAL(interface)
 \ingroup API_Data_Interfaces
 Return a pointer to the non-zero values of the matrix
 designated by \p interface.
 
-\def STARPU_CSR_GET_NZVAL_DEV_HANDLE(void *interface)
+\def STARPU_CSR_GET_NZVAL_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the array of non-zero values in the
 matrix designated by \p interface. The offset documented below has to be
 used in addition to this.
 
-\def STARPU_CSR_GET_COLIND(void *interface)
+\def STARPU_CSR_GET_COLIND(interface)
 \ingroup API_Data_Interfaces
 Return a pointer to the column index of the matrix designated
 by \p interface.
 
-\def STARPU_CSR_GET_COLIND_DEV_HANDLE(void *interface)
+\def STARPU_CSR_GET_COLIND_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the column index of the matrix
 designated by \p interface. The offset documented below has to be used in
 addition to this.
 
-\def STARPU_CSR_GET_ROWPTR(void *interface)
+\def STARPU_CSR_GET_ROWPTR(interface)
 \ingroup API_Data_Interfaces
 Return a pointer to the row pointer array of the matrix
 designated by \p interface.
 
-\def STARPU_CSR_GET_ROWPTR_DEV_HANDLE(void *interface)
+\def STARPU_CSR_GET_ROWPTR_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the row pointer array of the matrix
 designated by \p interface. The offset documented below has to be used in
 addition to this.
 
-\def STARPU_CSR_GET_OFFSET(void *interface)
+\def STARPU_CSR_GET_OFFSET
 \ingroup API_Data_Interfaces
 Return the offset in the arrays (colind, rowptr, nzval) of the
 matrix designated by \p interface, to be used with the device handles.
 
-\def STARPU_CSR_GET_FIRSTENTRY(void *interface)
+\def STARPU_CSR_GET_FIRSTENTRY(interface)
 \ingroup API_Data_Interfaces
 Return the index at which all arrays (the column indexes, the
 row pointers...) of the \p interface start.
 
-\def STARPU_CSR_GET_ELEMSIZE(void *interface)
+\def STARPU_CSR_GET_ELEMSIZE(interface)
 \ingroup API_Data_Interfaces
 Return the size of the elements registered into the matrix
 designated by \p interface.
@@ -876,12 +876,12 @@ number of values registered in the matrix
 \var starpu_coo_interface::elemsize
 size of the elements of the matrix
 
-\def STARPU_COO_GET_COLUMNS(void *interface)
+\def STARPU_COO_GET_COLUMNS(interface)
 \ingroup API_Data_Interfaces
 Return a pointer to the column array of the matrix designated
 by \p interface.
 
-\def STARPU_COO_GET_COLUMNS_DEV_HANDLE(void *interface)
+\def STARPU_COO_GET_COLUMNS_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the column array of the matrix
 designated by \p interface, to be used on OpenCL. The offset documented
@@ -892,7 +892,7 @@ below has to be used in addition to this.
 Return a pointer to the rows array of the matrix designated by
 \p interface.
 
-\def STARPU_COO_GET_ROWS_DEV_HANDLE(void *interface)
+\def STARPU_COO_GET_ROWS_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the row array of the matrix
 designated by \p interface, to be used on OpenCL. The offset documented
@@ -903,13 +903,13 @@ below has to be used in addition to this.
 Return a pointer to the values array of the matrix designated
 by \p interface.
 
-\def STARPU_COO_GET_VALUES_DEV_HANDLE(void *interface)
+\def STARPU_COO_GET_VALUES_DEV_HANDLE(interface)
 \ingroup API_Data_Interfaces
 Return a device handle for the value array of the matrix
 designated by \p interface, to be used on OpenCL. The offset documented
 below has to be used in addition to this.
 
-\def STARPU_COO_GET_OFFSET(void *interface)
+\def STARPU_COO_GET_OFFSET
 \ingroup API_Data_Interfaces
 Return the offset in the arrays of the COO matrix designated by
 \p interface.

+ 1 - 1
doc/doxygen/chapters/api/data_management.doxy

@@ -237,7 +237,7 @@ This is the same as starpu_data_acquire_cb(), except that the
 data will be available on the given memory node instead of main
 memory.
 
-\def STARPU_DATA_ACQUIRE_CB(starpu_data_handle_t handle, enum starpu_data_access_mode mode, code)
+\def STARPU_DATA_ACQUIRE_CB(handle, mode, code)
 \ingroup API_Data_Management
 STARPU_DATA_ACQUIRE_CB() is the same as starpu_data_acquire_cb(),
 except that the code to be executed in a callback is directly provided

+ 4 - 0
doc/doxygen/chapters/api/mic_extensions.doxy

@@ -13,6 +13,10 @@
 This macro is defined when StarPU has been installed with MIC support.
 It should be used in your code to detect the availability of MIC.
 
+\typedef starpu_mic_func_symbol_t
+\ingroup API_MIC_Extensions
+Type for MIC function symbols
+
 \fn int starpu_mic_register_kernel(starpu_mic_func_symbol_t *symbol, const char *func_name)
 \ingroup API_MIC_Extensions
 Initiate a lookup on each MIC device to find the adress of the

+ 4 - 4
doc/doxygen/chapters/api/multiformat_data_interface.doxy

@@ -52,19 +52,19 @@ when working on a CPU, and a structure of arrays when working on a
 GPU. \p nobjects is the number of elements in the data. \p format_ops
 describes the format.
 
-\def STARPU_MULTIFORMAT_GET_CPU_PTR(void *interface)
+\def STARPU_MULTIFORMAT_GET_CPU_PTR(interface)
 \ingroup API_Multiformat_Data_Interface
 returns the local pointer to the data with CPU format.
 
-\def STARPU_MULTIFORMAT_GET_CUDA_PTR(void *interface)
+\def STARPU_MULTIFORMAT_GET_CUDA_PTR(interface)
 \ingroup API_Multiformat_Data_Interface
 returns the local pointer to the data with CUDA format.
 
-\def STARPU_MULTIFORMAT_GET_OPENCL_PTR(void *interface)
+\def STARPU_MULTIFORMAT_GET_OPENCL_PTR(interface)
 \ingroup API_Multiformat_Data_Interface
 returns the local pointer to the data with OpenCL format.
 
-\def STARPU_MULTIFORMAT_GET_NX (void *interface)
+\def STARPU_MULTIFORMAT_GET_NX(interface)
 \ingroup API_Multiformat_Data_Interface
 returns the number of elements in the data.
 

+ 3 - 3
doc/doxygen/chapters/api/opencl_extensions.doxy

@@ -169,7 +169,7 @@ Given a valid error status, prints the corresponding error message on
 stdout, along with the given function name \p func, the given filename
 \p file, the given line number \p line and the given message \p msg.
 
-\def STARPU_OPENCL_DISPLAY_ERROR(cl_int status)
+\def STARPU_OPENCL_DISPLAY_ERROR(status)
 \ingroup API_OpenCL_Extensions
 Call the function starpu_opencl_display_error() with the given error
 \p status, the current function name, current file and line number,
@@ -179,13 +179,13 @@ and a empty message.
 \ingroup API_OpenCL_Extensions
 Call the function starpu_opencl_display_error() and abort.
 
-\def STARPU_OPENCL_REPORT_ERROR (cl_int status)
+\def STARPU_OPENCL_REPORT_ERROR(status)
 \ingroup API_OpenCL_Extensions
 Call the function starpu_opencl_report_error() with the given error \p
 status, with the current function name, current file and line number,
 and a empty message.
 
-\def STARPU_OPENCL_REPORT_ERROR_WITH_MSG(const char *msg, cl_int status)
+\def STARPU_OPENCL_REPORT_ERROR_WITH_MSG(msg, status)
 \ingroup API_OpenCL_Extensions
 Call the function starpu_opencl_report_error() with the given \p msg
 and the given error \p status, with the current function name, current

+ 4 - 0
doc/doxygen/chapters/api/scc_extensions.doxy

@@ -13,6 +13,10 @@
 This macro is defined when StarPU has been installed with SCC support.
 It should be used in your code to detect the availability of SCC.
 
+\typedef starpu_scc_func_symbol_t
+\ingroup API_SCC_Extensions
+Type for SCC function symbols
+
 \fn int starpu_scc_register_kernel(starpu_scc_func_symbol_t *symbol, const char *func_name)
 \ingroup API_SCC_Extensions
 Initiate a lookup on each SCC device to find the adress of the

+ 11 - 0
doc/doxygen/chapters/environment_variables.doxy

@@ -326,6 +326,17 @@ SOCL_OCL_LIB_OPENCL is defined. It should contain the location
 of the file <c>libOpenCL.so</c> of the OCL ICD implementation.
 </dd>
 
+<dt>OCL_ICD_VENDORS</dt>
+<dd>
+\anchor OCL_ICD_VENDORS
+\addindex __env__OCL_ICD_VENDORS
+When using SOCL with OpenCL ICD
+(https://forge.imag.fr/projects/ocl-icd/), this variable may be used
+to point to the directory where ICD files are installed. The default
+directory is <c>/etc/OpenCL/vendors</c>. StarPU installs ICD
+files in the directory <c>$prefix/share/starpu/opencl/vendors</c>.
+</dd>
+
 <dt>STARPU_COMM_STATS</dt>
 <dd>
 \anchor STARPU_COMM_STATS

+ 50 - 0
doc/doxygen/chapters/files.doxy

@@ -0,0 +1,50 @@
+/*
+ * 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 Files Files
+
+\file starpu_deprecated_api.h
+\file starpu.h
+\file starpu_data_filters.h
+\file starpu_data_interfaces.h
+\file starpu_worker.h
+\file starpu_task.h
+\file starpu_task_bundle.h
+\file starpu_task_list.h
+\file starpu_task_util.h
+\file starpu_data.h
+\file starpu_perfmodel.h
+\file starpu_util.h
+\file starpu_fxt.h
+\file starpu_cuda.h
+\file starpu_opencl.h
+\file starpu_sink.h
+\file starpu_mic.h
+\file starpu_scc.h
+\file starpu_expert.h
+\file starpu_profiling.h
+\file starpu_bound.h
+\file starpu_scheduler.h
+\file starpu_sched_ctx.h
+\file starpu_top.h
+\file starpu_hash.h
+\file starpu_rand.h
+\file starpu_cublas.h
+\file starpu_driver.h
+\file starpu_stdlib.h
+\file starpu_thread.h
+\file starpu_thread_util.h
+\file starpu_mpi.h
+\file sc_hypervisor.h
+\file sc_hypervisor_config.h
+\file sc_hypervisor_lp.h
+\file sc_hypervisor_monitoring.h
+\file sc_hypervisor_policy.h
+\file starpu_config.h
+
+*/

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

@@ -227,6 +227,7 @@ The documentation chapters include
 <li> \ref ExecutionConfigurationThroughEnvironmentVariables
 <li> \ref CompilationConfiguration
 <li> \ref ModuleDocumentation
+<li> \ref FileDocumentation
 <li> \ref deprecated
 </ul>
 <li> Part: Appendix

+ 52 - 0
doc/doxygen/chapters/socl_opencl_extensions.doxy

@@ -18,4 +18,56 @@ the context to which the command queue is attached.
 
 Note: this is still an area under development and subject to change.
 
+When compiling StarPU, SOCL will be enabled if a valid OpenCL
+implementation is found on your system. To be able to run the SOCL
+test suite, the environment variable \ref SOCL_OCL_LIB_OPENCL needs to
+be defined to the location of the file <c>libOpenCL.so</c> of the OCL
+ICD implementation. You should for example add the following line in
+your file <c>.bashrc</c>
+
+\verbatim
+export SOCL_OCL_LIB_OPENCL=/usr/lib/x86_64-linux-gnu/libOpenCL.so
+\endverbatim
+
+You can then run the test suite in the directory <c>socl/examples</c>.
+
+\verbatim
+$ make check
+...
+PASS: basic/basic
+PASS: testmap/testmap
+PASS: clinfo/clinfo
+PASS: matmul/matmul
+PASS: mansched/mansched
+==================
+All 5 tests passed
+==================
+\endverbatim
+
+The environment variable \ref OCL_ICD_VENDORS has to point to the directory
+where the ICD files are installed. When compiling StarPU, the files
+are in the directory <c>socl/vendors</c>. With an installed version of
+StarPU, the files are installed in the directory
+<c>$prefix/share/starpu/opencl/vendors</c>.
+
+To run the tests by hand, you have to call for example,
+
+\verbatim
+$ LD_PRELOAD=$SOCL_OCL_LIB_OPENCL OCL_ICD_VENDORS=socl/vendors/ socl/examples/clinfo/clinfo
+Number of platforms:	2
+  Plaform Profile:	FULL_PROFILE
+  Plaform Version:	OpenCL 1.1 CUDA 4.2.1
+  Plaform Name:		NVIDIA CUDA
+  Plaform Vendor:	NVIDIA Corporation
+  Plaform Extensions:	cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll 
+
+  Plaform Profile:	FULL_PROFILE
+  Plaform Version:	OpenCL 1.0 SOCL Edition (0.1.0)
+  Plaform Name:		SOCL Platform
+  Plaform Vendor:	INRIA
+  Plaform Extensions:	cl_khr_icd
+....
+$
+\endverbatim
+
 */

+ 8 - 0
doc/doxygen/dev/checkDoc.sh

@@ -10,3 +10,11 @@ echo
 echo "Defined groups"
 grep ingroup chapters/api/*|awk -F':' '{print $2}'| awk 'NF == 2'|sort|uniq
 echo
+
+for f in ../../build/doc/doxygen/latex/*tex ; do
+    x=$(grep $(basename $f .tex) refman.tex)
+    if test -z "$x" ; then
+	echo Error. $f not included in refman.tex
+    fi
+done
+

+ 7 - 7
doc/doxygen/dev/starpu_check_undocumented.sh

@@ -22,13 +22,13 @@ stcolor=$(tput sgr0)
 redcolor=$(tput setaf 1)
 greencolor=$(tput setaf 2)
 
-H_FILES=$(find include mpi/include -name '*.h')
+H_FILES=$(find ../../include ../../mpi/include -name '*.h')
 
-functions=$(spatch -very_quiet -sp_file tools/dev/starpu_funcs.cocci $H_FILES)
+functions=$(spatch -very_quiet -sp_file ./dev/starpu_funcs.cocci $H_FILES)
 for func in $functions ; do
 	fname=$(echo $func|awk -F ',' '{print $1}')
 	location=$(echo $func|awk -F ',' '{print $2}')
-	x=$(grep "$fname(" doc/doxygen/chapters/api/*.doxy | grep "\\fn")
+	x=$(grep "$fname(" chapters/api/*.doxy | grep "\\fn")
 	if test "$x" == "" ; then
 		echo "function ${redcolor}${fname}${stcolor} at location ${redcolor}$location${stcolor} is not (or incorrectly) documented"
 #	else
@@ -40,7 +40,7 @@ echo
 
 structs=$(grep "struct starpu" $H_FILES | grep -v "[;|,|(|)]" | awk '{print $2}')
 for struct in $structs ; do
-    x=$(grep -F "\\struct $struct" doc/doxygen/chapters/api/*.doxy)
+    x=$(grep -F "\\struct $struct" chapters/api/*.doxy)
     if test "$x" == "" ; then
 	echo "struct ${redcolor}${struct}${stcolor} is not (or incorrectly) documented"
     fi
@@ -50,7 +50,7 @@ echo
 
 enums=$(grep "enum starpu" $H_FILES | grep -v "[;|,|(|)]" | awk '{print $2}')
 for enum in $enums ; do
-    x=$(grep -F "\\enum $enum" doc/doxygen/chapters/api/*.doxy)
+    x=$(grep -F "\\enum $enum" chapters/api/*.doxy)
     if test "$x" == "" ; then
 	echo "enum ${redcolor}${enum}${stcolor} is not (or incorrectly) documented"
     fi
@@ -60,7 +60,7 @@ echo
 
 macros=$(grep "define\b" $H_FILES |grep -v deprecated|grep "#" | grep -v "__" | sed 's/#[ ]*/#/g' | awk '{print $2}' | awk -F'(' '{print $1}' | sort|uniq)
 for macro in $macros ; do
-    x=$(grep -F "\\def $macro" doc/doxygen/chapters/api/*.doxy)
+    x=$(grep -F "\\def $macro" chapters/api/*.doxy)
     if test "$x" == "" ; then
 	echo "macro ${redcolor}${macro}${stcolor} is not (or incorrectly) documented"
     fi
@@ -70,7 +70,7 @@ echo
 
 variables=$(grep --exclude-dir=.svn -rs -E "(getenv|get_env)" src/| tr ' ' '\012'|grep -E "(getenv|get_env)" | grep "\"" | sed 's/.*("//' | sed 's/").*//'|sort|uniq)
 for variable in $variables ; do
-    x=$(grep "$variable" doc/doxygen/chapters/environment_variables.doxy | grep "\\anchor")
+    x=$(grep "$variable" chapters/environment_variables.doxy | grep "\\anchor")
     if test "$x" == "" ; then
 	echo "variable ${redcolor}${variable}${stcolor} is not (or incorrectly) documented"
     fi

+ 3 - 1
doc/doxygen/doxygen-config.cfg.in

@@ -18,7 +18,7 @@
 
 INPUT                  = @top_srcdir@/doc/doxygen/chapters \
 		       	 @top_srcdir@/doc/doxygen/chapters/api \
-                         @top_builddir@/include/starpu_config.h \
+                         @top_builddir@/doc/doxygen/starpu_config.h \
 			 @top_srcdir@/include/ \
 			 @top_srcdir@/mpi/include/ \
 			 @top_srcdir@/starpufft/starpufft.h \
@@ -31,3 +31,5 @@ EXAMPLE_PATH           = @top_srcdir@/doc/doxygen \
 INPUT_FILTER           = @top_builddir@/doc/doxygen/doxygen_filter.sh
 
 LATEX_HEADER           = @top_srcdir@/doc/doxygen/refman.tex
+
+EXCLUDE_PATTERNS       = @abs_top_builddir@/include/starpu_config.h

+ 4 - 3
doc/doxygen/doxygen.cfg

@@ -143,7 +143,7 @@ INLINE_INHERITED_MEMB  = NO
 # path before files name in the file list and in the header files. If set
 # to NO the shortest path that makes the file name unique will be used.
 
-FULL_PATH_NAMES        = YES
+FULL_PATH_NAMES        = NO
 
 # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
 # can be used to strip a user-defined part of the path. Stripping is
@@ -581,7 +581,7 @@ ENABLED_SECTIONS       =
 # documentation can be controlled using \showinitializer or \hideinitializer
 # command in the documentation regardless of this setting.
 
-MAX_INITIALIZER_LINES  = 30
+MAX_INITIALIZER_LINES  = 0
 
 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated
 # at the bottom of the documentation of classes and structs. If set to YES the
@@ -739,7 +739,8 @@ EXCLUDE_SYMLINKS       = NO
 # against the file with absolute path, so to exclude all test directories
 # for example use the pattern */test/*
 
-EXCLUDE_PATTERNS       =
+#defined in doxygen-config.cfg
+#EXCLUDE_PATTERNS       =
 
 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
 # (namespaces, classes, functions, etc.) that should be excluded from the

+ 46 - 0
doc/doxygen/refman.tex

@@ -216,6 +216,52 @@ Documentation License”.
 \input{group__API__Scheduling__Policy}
 \input{group__API__Scheduling__Context__Hypervisor}
 
+\chapter{File Index}
+\input{files}
+
+\chapter{File Documentation}
+\label{FileDocumentation}
+\hypertarget{FileDocumentation}{}
+
+\input{starpu_8h}
+\input{starpu__bound_8h}
+\input{starpu__config_8h}
+\input{starpu__cublas_8h}
+\input{starpu__cuda_8h}
+\input{starpu__data_8h}
+\input{starpu__data__filters_8h}
+\input{starpu__data__interfaces_8h}
+\input{starpu__deprecated__api_8h}
+\input{starpu__driver_8h}
+\input{starpu__expert_8h}
+\input{starpu__fxt_8h}
+\input{starpu__hash_8h}
+\input{starpu__mic_8h}
+\input{starpu__opencl_8h}
+\input{starpu__perfmodel_8h}
+\input{starpu__profiling_8h}
+\input{starpu__rand_8h}
+\input{starpu__scc_8h}
+\input{starpu__sched__ctx_8h}
+\input{starpu__scheduler_8h}
+\input{starpu__sink_8h}
+\input{starpu__stdlib_8h}
+\input{starpu__task_8h}
+\input{starpu__task__bundle_8h}
+\input{starpu__task__list_8h}
+\input{starpu__task__util_8h}
+\input{starpu__thread_8h}
+\input{starpu__thread__util_8h}
+\input{starpu__top_8h}
+\input{starpu__util_8h}
+\input{starpu__worker_8h}
+\input{starpu__mpi_8h}
+\input{sc__hypervisor_8h}
+\input{sc__hypervisor__config_8h}
+\input{sc__hypervisor__lp_8h}
+\input{sc__hypervisor__monitoring_8h}
+\input{sc__hypervisor__policy_8h}
+
 \chapter{Deprecated List}
 \label{deprecated}
 \hypertarget{deprecated}{}

+ 2 - 2
include/starpu_data_interfaces.h

@@ -304,13 +304,13 @@ size_t starpu_csr_get_elemsize(starpu_data_handle_t handle);
 #define STARPU_CSR_GET_NNZ(interface)	(((struct starpu_csr_interface *)(interface))->nnz)
 #define STARPU_CSR_GET_NROW(interface)	(((struct starpu_csr_interface *)(interface))->nrow)
 #define STARPU_CSR_GET_NZVAL(interface)	(((struct starpu_csr_interface *)(interface))->nzval)
-#define STARPU_CSR_GET_NZVAL_DEV_HANDLE \
+#define STARPU_CSR_GET_NZVAL_DEV_HANDLE(interface)		\
 	(((struct starpu_csr_interface *)(interface))->nnz)
 #define STARPU_CSR_GET_COLIND(interface)	(((struct starpu_csr_interface *)(interface))->colind)
 #define STARPU_CSR_GET_COLIND_DEV_HANDLE(interface) \
 	(((struct starpu_csr_interface *)(interface))->colind)
 #define STARPU_CSR_GET_ROWPTR(interface)	(((struct starpu_csr_interface *)(interface))->rowptr)
-#define STARPU_CSR_GET_ROWPTR_DEV_HANDLE \
+#define STARPU_CSR_GET_ROWPTR_DEV_HANDLE(interface)		\
 	(((struct starpu_csr_interface *)(interface))->rowptr)
 #define STARPU_CSR_GET_OFFSET 0
 #define STARPU_CSR_GET_FIRSTENTRY(interface)	(((struct starpu_csr_interface *)(interface))->firstentry)

+ 6 - 3
sc_hypervisor/examples/Makefile.am

@@ -18,12 +18,14 @@ LIBS = $(top_builddir)/src/@LIBSTARPU_LINK@ @LIBS@ $(top_builddir)/sc_hypervisor
 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/examples -I$(top_builddir)/include -I$(top_srcdir)/sc_hypervisor/include -I$(top_srcdir)/sc_hypervisor/examples
 AM_LDFLAGS = $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS) $(STARPU_GLPK_LDFLAGS)
 
-if !NO_BLAS_LIB
 noinst_PROGRAMS =				\
-	cholesky/cholesky_implicit  		\
 	app_driven_test/app_driven_test		\
 	lp_test/lp_test
 
+if !NO_BLAS_LIB
+noinst_PROGRAMS +=				\
+	cholesky/cholesky_implicit  		
+
 noinst_HEADERS = 				\
 	cholesky/cholesky.h			\
 	sched_ctx_utils/sched_ctx_utils.h
@@ -42,13 +44,14 @@ cholesky_cholesky_implicit_LDADD =		\
 	$(top_builddir)/sc_hypervisor/src/libsc_hypervisor.la \
 	$(STARPU_BLAS_LDFLAGS)
 
+endif
+
 app_driven_test_app_driven_test_SOURCES =		\
 	app_driven_test/app_driven_test.c
 
 app_driven_test_app_driven_test_LDADD =		\
 	$(top_builddir)/sc_hypervisor/src/libsc_hypervisor.la
 
-endif
 
 showcheck:
 	-cat $(TEST_LOGS) /dev/null

+ 13 - 1
sc_hypervisor/include/sc_hypervisor_policy.h

@@ -1,4 +1,4 @@
-/* StarPU --- Runtime system for heterogeneous multicore architectures.
+/* StarPUf --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2012  INRIA
  *
@@ -27,6 +27,9 @@ extern "C"
 
 #define HYPERVISOR_REDIM_SAMPLE 0.02
 #define HYPERVISOR_START_REDIM_SAMPLE 0.1
+#define SC_NOTHING 0
+#define SC_IDLE 1
+#define SC_VELOCITY 2
 
 struct sc_hypervisor_policy_task_pool
 {
@@ -94,6 +97,15 @@ void sc_hypervisor_group_workers_by_type(int *workers, int nworkers, int ntypes_
 /* check if we trigger resizing or not */
 unsigned sc_hypervisor_criteria_fulfilled(unsigned sched_ctx, int worker);
 
+/* check if worker was idle long enough */
+unsigned sc_hypervisor_check_idle(unsigned sched_ctx, int worker);
+
+/* check if there is a velocity gap btw ctxs */
+unsigned sc_hypervisor_check_velocity_gap_btw_ctxs(void);
+
+/* check what triggers resizing (idle, velocity, etc.)*/
+unsigned sc_hypervisor_get_resize_criteria();
+
 #ifdef __cplusplus
 }
 #endif

+ 59 - 34
sc_hypervisor/src/hypervisor_policies/feft_lp_policy.c

@@ -15,49 +15,61 @@
  */
 
 #include "sc_hypervisor_lp.h"
+#include "sc_hypervisor_policy.h"
 #include <starpu_config.h>
 #include <sys/time.h>
 
 #ifdef STARPU_HAVE_GLPK_H
-static void feft_lp_handle_poped_task(unsigned sched_ctx, int worker, struct starpu_task *task, uint32_t footprint)
+static void _try_resizing(void)
 {
-	if(sc_hypervisor_criteria_fulfilled(sched_ctx, worker))
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
+	
+	double nworkers[nsched_ctxs][2];
+	
+	int ret = starpu_pthread_mutex_trylock(&act_hypervisor_mutex);
+	if(ret != EBUSY)
 	{
-		int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
-
-		double nworkers[nsched_ctxs][2];
-
-		int ret = starpu_pthread_mutex_trylock(&act_hypervisor_mutex);
-		if(ret != EBUSY)
-		{
-			int nw = 1;
+		starpu_trace_user_event(2);
+		int nw = 1;
 #ifdef STARPU_USE_CUDA
-			int ncuda = starpu_worker_get_count_by_type(STARPU_CUDA_WORKER);
-			nw = ncuda != 0 ? 2 : 1;
+		int ncuda = starpu_worker_get_count_by_type(STARPU_CUDA_WORKER);
+		nw = ncuda != 0 ? 2 : 1;
 #endif
-			int total_nw[nw];
-			sc_hypervisor_group_workers_by_type(NULL, -1, nw, total_nw);
-
-
-			struct timeval start_time;
-			struct timeval end_time;
-			gettimeofday(&start_time, NULL);
-
-			double vmax = sc_hypervisor_lp_get_nworkers_per_ctx(nsched_ctxs, nw, nworkers, total_nw);
-			gettimeofday(&end_time, NULL);
+		int total_nw[nw];
+		sc_hypervisor_group_workers_by_type(NULL, -1, nw, total_nw);
+		
+		
+		struct timeval start_time;
+		struct timeval end_time;
+		gettimeofday(&start_time, NULL);
+		
+		double vmax = sc_hypervisor_lp_get_nworkers_per_ctx(nsched_ctxs, nw, nworkers, total_nw);
+		gettimeofday(&end_time, NULL);
+		
+		long diff_s = end_time.tv_sec  - start_time.tv_sec;
+		long diff_us = end_time.tv_usec  - start_time.tv_usec;
+		
+		float timing = (float)(diff_s*1000000 + diff_us)/1000;
 
-			long diff_s = end_time.tv_sec  - start_time.tv_sec;
-			long diff_us = end_time.tv_usec  - start_time.tv_usec;
-
-			float timing = (float)(diff_s*1000000 + diff_us)/1000;
+		if(vmax != 0.0)
+		{
+			int nworkers_rounded[nsched_ctxs][nw];
+			sc_hypervisor_lp_round_double_to_int(nsched_ctxs, nw, nworkers, nworkers_rounded);
+			sc_hypervisor_lp_redistribute_resources_in_ctxs(nsched_ctxs, nw, nworkers_rounded, nworkers);
+		}
+		starpu_pthread_mutex_unlock(&act_hypervisor_mutex);
+	}
+	
+}
+static void feft_lp_handle_poped_task(unsigned sched_ctx, int worker, struct starpu_task *task, uint32_t footprint)
+{
+	unsigned criteria = sc_hypervisor_get_resize_criteria();
+	if(criteria != SC_NOTHING && criteria == SC_VELOCITY)
+	{
 
-			if(vmax != 0.0)
-			{
-				int nworkers_rounded[nsched_ctxs][nw];
-				sc_hypervisor_lp_round_double_to_int(nsched_ctxs, nw, nworkers, nworkers_rounded);
-				sc_hypervisor_lp_redistribute_resources_in_ctxs(nsched_ctxs, nw, nworkers_rounded, nworkers);
-			}
-			starpu_pthread_mutex_unlock(&act_hypervisor_mutex);
+		if(sc_hypervisor_check_velocity_gap_btw_ctxs())
+		{
+			_try_resizing();
 		}
 	}
 }
@@ -122,11 +134,24 @@ static void feft_lp_size_ctxs(int *sched_ctxs, int ns, int *workers, int nworker
 	starpu_pthread_mutex_unlock(&act_hypervisor_mutex);
 }
 
+static feft_lp_handle_idle_cycle(unsigned sched_ctx, int worker)
+{
+	unsigned criteria = sc_hypervisor_get_resize_criteria();
+	if(criteria != SC_NOTHING && criteria == SC_IDLE)
+	{
+
+		if(sc_hypervisor_check_idle(sched_ctx, worker))
+		{
+			_try_resizing();
+		}
+	}
+}
+
 struct sc_hypervisor_policy feft_lp_policy = {
 	.size_ctxs = feft_lp_size_ctxs,
 	.handle_poped_task = feft_lp_handle_poped_task,
 	.handle_pushed_task = NULL,
-	.handle_idle_cycle = NULL,
+	.handle_idle_cycle = feft_lp_handle_idle_cycle, //NULL,
 	.handle_idle_end = NULL,
 	.handle_post_exec_hook = NULL,
 	.handle_submitted_job = NULL,

+ 0 - 1
sc_hypervisor/src/hypervisor_policies/ispeed_lp_policy.c

@@ -346,7 +346,6 @@ static void ispeed_lp_handle_poped_task(unsigned sched_ctx, int worker, struct s
 			for(i = 0; i < ns; i++)
 				flops_on_w[i] = (double*)malloc(nw*sizeof(double));
 
-			printf("ns = %d nw = %d\n", ns, nw);
 			unsigned found_sol = _compute_flops_distribution_over_ctxs(ns, nw,  w_in_s, flops_on_w, NULL, NULL);
 			/* if we did find at least one solution redistribute the resources */
 			if(found_sol)

+ 103 - 61
sc_hypervisor/src/hypervisor_policies/teft_lp_policy.c

@@ -135,12 +135,16 @@ static void size_if_required()
 		for(s = 0; s < nsched_ctxs; s++)
 		{
 			sc_w = sc_hypervisor_get_wrapper(sched_ctxs[s]);
-			if(sc_w->submitted_flops < sc_w->total_flops)
+//			if(sc_w->submitted_flops < sc_w->total_flops)
+			if((sc_w->submitted_flops + (0.1*sc_w->total_flops)) < sc_w->total_flops)
 				ready_to_size = 0;
 		}
 
 		if(ready_to_size)
+		{
 			_size_ctxs(sched_ctxs, nsched_ctxs, workers, nworkers);
+			sc_hypervisor_free_size_req();
+		}
 		starpu_pthread_mutex_unlock(&act_hypervisor_mutex);
 	}
 }
@@ -155,6 +159,69 @@ static void teft_lp_handle_submitted_job(struct starpu_codelet *cl, unsigned sch
 	size_if_required();
 }
 
+static void _try_resizing(void)
+{
+	starpu_trace_user_event(2);
+	int ns = sc_hypervisor_get_nsched_ctxs();
+	int nw = starpu_worker_get_count(); /* Number of different workers */
+	int nt = 0; /* Number of different kinds of tasks */
+	
+//			starpu_pthread_mutex_lock(&mutex);
+	
+	/* we don't take the mutex bc a correct value of the number of tasks is
+	   not required but we do a copy in order to be sure
+	   that the linear progr won't segfault if the list of 
+	   submitted task will change during the exec */
+	
+	struct sc_hypervisor_policy_task_pool *tp = NULL;
+	struct sc_hypervisor_policy_task_pool *tmp_task_pools = sc_hypervisor_policy_clone_task_pool(task_pools);
+	
+	for (tp = task_pools; tp; tp = tp->next)
+		nt++;
+	
+	
+	double w_in_s[ns][nw];
+//			double tasks_per_worker[nw][nt];
+	double **tasks_per_worker=(double**)malloc(nw*sizeof(double*));
+	int i;
+	for(i = 0; i < nw; i++)
+		tasks_per_worker[i] = (double*)malloc(nt*sizeof(double));
+	
+	struct teft_lp_data specific_data;
+	specific_data.nt = nt;
+	specific_data.tasks = tasks_per_worker;
+	specific_data.in_sched_ctxs = NULL;
+	specific_data.workers = NULL;
+	specific_data.tmp_task_pools = tmp_task_pools;
+	specific_data.size_ctxs = 0;
+
+			/* smallest possible tmax, difficult to obtain as we
+			   compute the nr of flops and not the tasks */
+	double possible_tmax = sc_hypervisor_lp_get_tmax(nw, NULL);
+	double smallest_tmax = possible_tmax / 3;
+	double tmax = possible_tmax * ns;
+	double tmin = smallest_tmax;
+	unsigned found_sol = sc_hypervisor_lp_execute_dichotomy(ns, nw, w_in_s, 1, (void*)&specific_data, 
+								tmin, tmax, smallest_tmax, _compute_workers_distrib);
+//			starpu_pthread_mutex_unlock(&mutex);
+	
+	/* if we did find at least one solution redistribute the resources */
+	if(found_sol)
+		sc_hypervisor_lp_place_resources_in_ctx(ns, nw, w_in_s, NULL, NULL, 0);
+	
+	struct sc_hypervisor_policy_task_pool *next = NULL;
+	struct sc_hypervisor_policy_task_pool *tmp_tp = tmp_task_pools;
+	while(tmp_task_pools)
+	{
+		next = tmp_tp->next;
+		free(tmp_tp);
+		tmp_tp = next;
+		tmp_task_pools = next;
+	}
+	for(i = 0; i < nw; i++)
+		free(tasks_per_worker[i]);
+	free(tasks_per_worker);
+}
 static void teft_lp_handle_poped_task(unsigned sched_ctx, int worker, struct starpu_task *task, uint32_t footprint)
 {
 	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
@@ -162,74 +229,22 @@ static void teft_lp_handle_poped_task(unsigned sched_ctx, int worker, struct sta
 	int ret = starpu_pthread_mutex_trylock(&act_hypervisor_mutex);
 	if(ret != EBUSY)
 	{
-		if(sc_w->submitted_flops < sc_w->total_flops)
+		if((sc_w->submitted_flops + (0.1*sc_w->total_flops)) < sc_w->total_flops)
 		{
 			starpu_pthread_mutex_unlock(&act_hypervisor_mutex);
 			return;
 		}
 
-		if(sc_hypervisor_criteria_fulfilled(sched_ctx, worker))
+		unsigned criteria = sc_hypervisor_get_resize_criteria();
+		if(criteria != SC_NOTHING && criteria == SC_VELOCITY)
 		{
-			int ns = sc_hypervisor_get_nsched_ctxs();
-			int nw = starpu_worker_get_count(); /* Number of different workers */
-			int nt = 0; /* Number of different kinds of tasks */
-
-//			starpu_pthread_mutex_lock(&mutex);
-
-			/* we don't take the mutex bc a correct value of the number of tasks is
-			   not required but we do a copy in order to be sure
-			   that the linear progr won't segfault if the list of 
-			   submitted task will change during the exec */
-
-			struct sc_hypervisor_policy_task_pool *tp = NULL;
-			struct sc_hypervisor_policy_task_pool *tmp_task_pools = sc_hypervisor_policy_clone_task_pool(task_pools);
-
-			for (tp = task_pools; tp; tp = tp->next)
-				nt++;
-
-
-			double w_in_s[ns][nw];
-//			double tasks_per_worker[nw][nt];
-			double **tasks_per_worker=(double**)malloc(nw*sizeof(double*));
-			int i;
-			for(i = 0; i < nw; i++)
-				tasks_per_worker[i] = (double*)malloc(nt*sizeof(double));
-
-			struct teft_lp_data specific_data;
-			specific_data.nt = nt;
-			specific_data.tasks = tasks_per_worker;
-			specific_data.in_sched_ctxs = NULL;
-			specific_data.workers = NULL;
-			specific_data.tmp_task_pools = tmp_task_pools;
-			specific_data.size_ctxs = 0;
-
-			/* smallest possible tmax, difficult to obtain as we
-			   compute the nr of flops and not the tasks */
-			double possible_tmax = sc_hypervisor_lp_get_tmax(nw, NULL);
-			double smallest_tmax = possible_tmax / 3;
-			double tmax = possible_tmax * ns;
-			double tmin = smallest_tmax;
-			unsigned found_sol = sc_hypervisor_lp_execute_dichotomy(ns, nw, w_in_s, 1, (void*)&specific_data, 
-								tmin, tmax, smallest_tmax, _compute_workers_distrib);
-//			starpu_pthread_mutex_unlock(&mutex);
-
-			/* if we did find at least one solution redistribute the resources */
-			if(found_sol)
-				sc_hypervisor_lp_place_resources_in_ctx(ns, nw, w_in_s, NULL, NULL, 0);
-
-			struct sc_hypervisor_policy_task_pool *next = NULL;
-			struct sc_hypervisor_policy_task_pool *tmp_tp = tmp_task_pools;
-			while(tmp_task_pools)
+			
+			if(sc_hypervisor_check_velocity_gap_btw_ctxs())
 			{
-				next = tmp_tp->next;
-				free(tmp_tp);
-				tmp_tp = next;
-				tmp_task_pools = next;
+				_try_resizing();
 			}
-			for(i = 0; i < nw; i++)
-				free(tasks_per_worker[i]);
-			free(tasks_per_worker);
 		}
+
 		starpu_pthread_mutex_unlock(&act_hypervisor_mutex);
 	}
 	/* too expensive to take this mutex and correct value of the number of tasks is not compulsory */
@@ -239,6 +254,33 @@ static void teft_lp_handle_poped_task(unsigned sched_ctx, int worker, struct sta
 
 }
 
+static int teft_lp_handle_idle_cycle(unsigned sched_ctx, int worker)
+{
+	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
+
+	int ret = starpu_pthread_mutex_trylock(&act_hypervisor_mutex);
+	if(ret != EBUSY)
+	{
+		if((sc_w->submitted_flops + (0.1*sc_w->total_flops)) < sc_w->total_flops)
+		{
+			starpu_pthread_mutex_unlock(&act_hypervisor_mutex);
+			return;
+		}
+
+
+		unsigned criteria = sc_hypervisor_get_resize_criteria();
+		if(criteria != SC_NOTHING && criteria == SC_IDLE)
+		{
+			
+			if(sc_hypervisor_check_idle(sched_ctx, worker))
+			{
+				_try_resizing();
+			}
+		}
+		starpu_pthread_mutex_unlock(&act_hypervisor_mutex);
+	}
+	return 0;
+}
 
 static void teft_lp_size_ctxs(int *sched_ctxs, int nsched_ctxs , int *workers, int nworkers)
 {
@@ -249,7 +291,7 @@ struct sc_hypervisor_policy teft_lp_policy = {
 	.size_ctxs = teft_lp_size_ctxs,
 	.handle_poped_task = teft_lp_handle_poped_task,
 	.handle_pushed_task = NULL,
-	.handle_idle_cycle = NULL,
+	.handle_idle_cycle = teft_lp_handle_idle_cycle,
 	.handle_idle_end = NULL,
 	.handle_post_exec_hook = NULL,
 	.handle_submitted_job = teft_lp_handle_submitted_job,

+ 11 - 11
sc_hypervisor/src/policies_utils/policy_tools.c

@@ -352,8 +352,9 @@ double sc_hypervisor_get_ctx_velocity(struct sc_hypervisor_wrapper* sc_w)
 {
 	struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sc_w->sched_ctx);
         double elapsed_flops = sc_hypervisor_get_elapsed_flops_per_sched_ctx(sc_w);
-	double sample = _get_ispeed_sample_for_sched_ctx(sc_w->sched_ctx);
-
+//	double sample = _get_ispeed_sample_for_sched_ctx(sc_w->sched_ctx);
+	double sample = config->ispeed_ctx_sample;
+	
 /* 	double total_elapsed_flops = sc_hypervisor_get_total_elapsed_flops_per_sched_ctx(sc_w); */
 /* 	double prc = config->ispeed_ctx_sample != 0.0 ? elapsed_flops : elapsed_flops/sc_w->total_flops; */
 /* 	double redim_sample = config->ispeed_ctx_sample != 0.0 ? config->ispeed_ctx_sample :  */
@@ -527,7 +528,7 @@ double sc_hypervisor_get_velocity_per_worker_type(struct sc_hypervisor_wrapper*
 
 
 /* check if there is a big velocity gap between the contexts */
-unsigned _check_velocity_gap_btw_ctxs()
+unsigned sc_hypervisor_check_velocity_gap_btw_ctxs(void)
 {
 	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
 	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
@@ -629,17 +630,16 @@ void sc_hypervisor_get_tasks_times(int nw, int nt, double times[nw][nt], int *wo
         }
 }
 
-static unsigned _check_idle(unsigned sched_ctx, int worker)
+unsigned sc_hypervisor_check_idle(unsigned sched_ctx, int worker)
 {
 	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
 	struct sc_hypervisor_policy_config *config = sc_w->config;
 	if(config != NULL)
 	{
-		int j;
-		for(j = 0; j < STARPU_NMAXWORKERS; j++)
+		if(sc_w->current_idle_time[worker] > config->max_idle[worker])
 		{
-			if(sc_w->current_idle_time[j] > config->max_idle[j])
-				return 1;
+			sc_w->current_idle_time[worker] = 0.0;
+			return 1;
 		}
 	}
 
@@ -648,13 +648,13 @@ static unsigned _check_idle(unsigned sched_ctx, int worker)
 
 unsigned sc_hypervisor_criteria_fulfilled(unsigned sched_ctx, int worker)
 {
-	unsigned criteria = _get_resize_criteria();
+	unsigned criteria = sc_hypervisor_get_resize_criteria();
 	if(criteria != SC_NOTHING)
 	{
 		if(criteria == SC_IDLE)
-			return _check_idle(sched_ctx, worker);
+			return sc_hypervisor_check_idle(sched_ctx, worker);
 		else
-			return _check_velocity_gap_btw_ctxs();
+			return sc_hypervisor_check_velocity_gap_btw_ctxs();
 	}
 	else
 		return 0;

+ 4 - 3
sc_hypervisor/src/sc_hypervisor.c

@@ -15,6 +15,7 @@
  */
 
 #include <sc_hypervisor_intern.h>
+#include <sc_hypervisor_policy.h>
 #include <common/uthash.h>
 #include <starpu_config.h>
 
@@ -136,7 +137,7 @@ struct starpu_sched_ctx_performance_counters* sc_hypervisor_init(struct sc_hyper
 	char* vel_gap = getenv("MAX_VELOCITY_GAP");
 	hypervisor.max_velocity_gap = vel_gap ? atof(vel_gap) : SC_VELOCITY_MAX_GAP_DEFAULT;
 	char* crit =  getenv("HYPERVISOR_TRIGGER_RESIZE");
-	hypervisor.resize_criteria = strcmp(crit,"idle") == 0 ? SC_IDLE : (strcmp(crit,"speed") == 0 ? SC_SPEED : SC_NOTHING);
+	hypervisor.resize_criteria = !crit ? SC_NOTHING : strcmp(crit,"idle") == 0 ? SC_IDLE : (strcmp(crit,"speed") == 0 ? SC_VELOCITY : SC_NOTHING);
 
 	starpu_pthread_mutex_init(&act_hypervisor_mutex, NULL);
 	hypervisor.start_executing_time = starpu_timing_now();
@@ -377,7 +378,7 @@ double _get_max_velocity_gap()
 	return hypervisor.max_velocity_gap;
 }
 
-unsigned _get_resize_criteria()
+unsigned sc_hypervisor_get_resize_criteria()
 {
 	return hypervisor.resize_criteria;
 }
@@ -534,7 +535,7 @@ void sc_hypervisor_move_workers(unsigned sender_sched_ctx, unsigned receiver_sch
 		for(j = 0; j < nworkers_to_move; j++)
 			printf(" %d", workers_to_move[j]);
 		printf("\n");
-
+		starpu_trace_user_event(1);
 		hypervisor.allow_remove[receiver_sched_ctx] = 0;
 		starpu_sched_ctx_add_workers(workers_to_move, nworkers_to_move, receiver_sched_ctx);
 

+ 1 - 4
sc_hypervisor/src/sc_hypervisor_intern.h

@@ -18,9 +18,7 @@
 #include <common/uthash.h>
 
 #define SC_VELOCITY_MAX_GAP_DEFAULT 50
-#define SC_NOTHING 0
-#define SC_IDLE 1
-#define SC_SPEED 2
+
 struct size_request
 {
 	int *workers;
@@ -102,4 +100,3 @@ void _remove_config(unsigned sched_ctx);
 
 double _get_max_velocity_gap();
 
-unsigned _get_resize_criteria();

+ 3 - 0
socl/Makefile.am

@@ -17,6 +17,9 @@ SUBDIRS = src examples
 
 EXTRA_DIST = README
 
+SOCL_vendorsdir = @datarootdir@/starpu/opencl/vendors
+dist_SOCL_vendors_DATA = @SOCL_VENDORS@
+
 showcheck:
 	for i in $(SUBDIRS) ; do \
 		make -C $$i showcheck ; \

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

@@ -0,0 +1 @@
+@prefix@/lib/libsocl-@STARPU_EFFECTIVE_VERSION@.so

+ 1 - 1
src/core/combined_workers.c

@@ -34,7 +34,7 @@ static int compar_int(const void *pa, const void *pb)
 	int a = *((int *)pa);
 	int b = *((int *)pb);
 
-	return a > b;
+	return a - b;
 }
 
 static void sort_workerid_array(int nworkers, int workerid_array[])

+ 17 - 14
src/datawizard/memalloc.c

@@ -357,11 +357,11 @@ static size_t try_to_free_mem_chunk(struct _starpu_mem_chunk *mc, unsigned node)
 
 		_starpu_spin_unlock(&handle->header_lock);
 	}
-	else
+	/* try to lock all the subtree */
+	else if (lock_all_subtree(handle))
 	{
-		/* try to lock all the subtree */
-		/* and check if they are all "free" */
-		if (lock_all_subtree(handle) && may_free_subtree(handle, node))
+		/* check if they are all "free" */
+		if (may_free_subtree(handle, node))
 		{
 			int target = -1;
 
@@ -390,10 +390,10 @@ static size_t try_to_free_mem_chunk(struct _starpu_mem_chunk *mc, unsigned node)
 				/* now the actual buffer may be freed */
 				freed = do_free_mem_chunk(mc, node);
 			}
-
-			/* unlock the tree */
-			unlock_all_subtree(handle);
 		}
+
+		/* unlock the tree */
+		unlock_all_subtree(handle);
 	}
 	return freed;
 }
@@ -449,16 +449,19 @@ static unsigned try_to_reuse_mem_chunk(struct _starpu_mem_chunk *mc, unsigned no
 
 	/* try to lock all the subtree */
 	/* and check if they are all "free" */
-	if (lock_all_subtree(old_data) && may_free_subtree(old_data, node))
+	if (lock_all_subtree(old_data))
 	{
-		success = 1;
+		if (may_free_subtree(old_data, node))
+		{
+			success = 1;
 
-		/* in case there was nobody using that buffer, throw it
-		 * away after writing it back to main memory */
-		transfer_subtree_to_node(old_data, node, 0);
+			/* in case there was nobody using that buffer, throw it
+			 * away after writing it back to main memory */
+			transfer_subtree_to_node(old_data, node, 0);
 
-		/* now replace the previous data */
-		reuse_mem_chunk(node, replicate, mc, is_already_in_mc_list);
+			/* now replace the previous data */
+			reuse_mem_chunk(node, replicate, mc, is_already_in_mc_list);
+		}
 
 		/* unlock the tree */
 		unlock_all_subtree(old_data);