Browse Source

Merge branch 'master' into fpga

Nathalie Furmento 4 years ago
parent
commit
dfaad236ad
69 changed files with 552 additions and 195 deletions
  1. 6 0
      ChangeLog
  2. 3 2
      configure.ac
  3. 9 3
      doc/doxygen/chapters/380_offline_performance_tools.doxy
  4. 25 2
      doc/doxygen/chapters/501_environment_variables.doxy
  5. 65 0
      doc/doxygen_dev/dev/starpu_check_missing.sh
  6. 26 1
      doc/doxygen_dev/doxygen-config.cfg.in
  7. 2 0
      doc/doxygen_dev/doxygen.cfg
  8. 30 1
      doc/doxygen_dev/refman.tex
  9. 2 0
      include/starpu_fxt.h
  10. 3 3
      julia/examples/old_examples/mult/mult.c
  11. 6 4
      mpi/src/load_balancer/policy/data_movements_interface.h
  12. 4 2
      mpi/src/load_balancer/policy/load_balancer_policy.h
  13. 11 9
      mpi/src/load_balancer/policy/load_data_interface.h
  14. 2 0
      mpi/src/mpi/starpu_mpi_comm.h
  15. 2 0
      mpi/src/mpi/starpu_mpi_driver.h
  16. 2 0
      mpi/src/mpi/starpu_mpi_early_data.h
  17. 2 0
      mpi/src/mpi/starpu_mpi_early_request.h
  18. 6 0
      mpi/src/mpi/starpu_mpi_mpi.c
  19. 2 0
      mpi/src/mpi/starpu_mpi_mpi.h
  20. 3 1
      mpi/src/mpi/starpu_mpi_mpi_backend.h
  21. 2 0
      mpi/src/mpi/starpu_mpi_sync_data.h
  22. 2 0
      mpi/src/mpi/starpu_mpi_tag.h
  23. 2 0
      mpi/src/nmad/starpu_mpi_nmad.h
  24. 3 1
      mpi/src/nmad/starpu_mpi_nmad_backend.h
  25. 2 0
      mpi/src/nmad/starpu_mpi_nmad_unknown_datatype.h
  26. 2 0
      mpi/src/starpu_mpi_cache.h
  27. 2 0
      mpi/src/starpu_mpi_cache_stats.h
  28. 1 1
      mpi/src/starpu_mpi_datatype.c
  29. 2 0
      mpi/src/starpu_mpi_datatype.h
  30. 2 0
      mpi/src/starpu_mpi_fxt.h
  31. 2 0
      mpi/src/starpu_mpi_init.h
  32. 2 0
      mpi/src/starpu_mpi_private.c
  33. 8 3
      mpi/src/starpu_mpi_private.h
  34. 2 0
      mpi/src/starpu_mpi_select_node.h
  35. 2 0
      mpi/src/starpu_mpi_stats.h
  36. 2 0
      mpi/src/starpu_mpi_task_insert.h
  37. 1 1
      socl/src/cl_createbuffer.c
  38. 34 29
      src/common/fxt.c
  39. 1 1
      src/common/fxt.h
  40. 29 14
      src/common/graph.h
  41. 4 6
      src/common/knobs.h
  42. 2 0
      src/common/list.h
  43. 4 5
      src/common/timing.h
  44. 2 0
      src/common/uthash.h
  45. 1 1
      src/common/utils.c
  46. 1 1
      src/common/utils.h
  47. 5 5
      src/core/debug.h
  48. 14 9
      src/core/dependencies/cg.h
  49. 14 12
      src/core/dependencies/tags.h
  50. 4 2
      src/core/perfmodel/perfmodel.h
  51. 1 1
      src/core/simgrid.h
  52. 6 3
      src/core/topology.h
  53. 6 6
      src/core/workers.h
  54. 8 4
      src/datawizard/copy_driver.h
  55. 2 1
      src/datawizard/data_request.h
  56. 2 2
      src/datawizard/memalloc.h
  57. 3 3
      src/datawizard/memory_nodes.h
  58. 1 1
      src/datawizard/memstats.h
  59. 97 10
      src/debug/traces/starpu_fxt.c
  60. 1 1
      src/drivers/mic/driver_mic_source.h
  61. 2 2
      src/drivers/mp_common/mp_common.h
  62. 1 1
      src/sched_policies/helper_mct.h
  63. 1 1
      src/sched_policies/prio_deque.h
  64. 1 1
      src/sched_policies/sched_component.h
  65. 5 5
      src/util/starpu_clusters_create.h
  66. 29 26
      starpurm/src/starpurm_private.h
  67. 1 2
      tests/errorcheck/workers_cpuid.c
  68. 8 5
      tools/gdbinit
  69. 12 1
      tools/starpu_fxt_tool.c

+ 6 - 0
ChangeLog

@@ -50,6 +50,12 @@ Small changes:
 StarPU 1.3.5 (git revision xxx)
 ====================================================================
 
+Small features:
+  * New environment variable STARPU_FXT_SUFFIX to set the filename in
+    which to save the fxt trace
+  * New option -d for starpu_fxt_tool to specify in which directory to
+    generate files
+
 Small changes:
   * Move MPI cache functions into the public API
   * Add STARPU_MPI_NOBIND environment variable.

+ 3 - 2
configure.ac

@@ -2179,8 +2179,9 @@ if test x$use_fxt = xyes; then
 	LIBS="$LIBS $FXT_LIBS"
 	save_LDFLAGS="$LDFLAGS"
 	LDFLAGS="$LDFLAGS $FXT_LDFLAGS"
-   	AC_CHECK_FUNCS([enable_fut_flush])
-   	AC_CHECK_FUNCS([fut_set_filename])
+	AC_CHECK_FUNCS([fxt_close])
+	AC_CHECK_FUNCS([enable_fut_flush])
+	AC_CHECK_FUNCS([fut_set_filename])
 	AC_CHECK_FUNCS([fut_setup_flush_callback])
 	LDFLAGS="$save_LDFLAGS"
 	LIBS="$save_LIBS"

+ 9 - 3
doc/doxygen/chapters/380_offline_performance_tools.doxy

@@ -84,7 +84,11 @@ Or you can simply point the <c>PKG_CONFIG_PATH</c> to
 When FxT is enabled, a trace is generated when StarPU is terminated by calling
 starpu_shutdown(). The trace is a binary file whose name has the form
 <c>prof_file_XXX_YYY</c> where <c>XXX</c> is the user name, and
-<c>YYY</c> is the pid of the process that used StarPU. This file is saved in the
+<c>YYY</c> is the MPI id of the process that used StarPU (or 0 when running a sequential program).
+One can change
+the name of the file by setting the environnement variable \ref
+STARPU_FXT_SUFFIX, its contents will be used instead of <c>prof_file_XXX</c>.
+This file is saved in the
 <c>/tmp/</c> directory by default, or by the directory specified by
 the environment variable \ref STARPU_FXT_PREFIX.
 
@@ -104,8 +108,10 @@ $ starpu_fxt_tool -i /tmp/prof_file_something
 \endverbatim
 
 Or alternatively, setting the environment variable \ref STARPU_GENERATE_TRACE
-to <c>1</c> before application execution will make StarPU do it automatically at
-application shutdown.
+to <c>1</c> before application execution will make StarPU
+automatically generate all traces at application shutdown. Note that
+if the environment variable \ref STARPU_FXT_PREFIX is set, files will
+be generated in the given directory.
 
 One can also set the environment variable \ref
 STARPU_GENERATE_TRACE_OPTIONS to specify options, see

+ 25 - 2
doc/doxygen/chapters/501_environment_variables.doxy

@@ -924,6 +924,22 @@ has been configured with the option \ref enable-verbose "--enable-verbose". Also
 disable the display of StarPU information and warning messages.
 </dd>
 
+<dt>STARPU_MPI_DEBUG_LEVEL_MIN</dt>
+<dd>
+\anchor STARPU_MPI_DEBUG_LEVEL_MIN
+\addindex __env__STARPU_MPI_DEBUG_LEVEL_MIN
+Set the minimum level of debug when StarPU
+has been configured with the option \ref enable-mpi-verbose "--enable-mpi-verbose".
+</dd>
+
+<dt>STARPU_MPI_DEBUG_LEVEL_MAX</dt>
+<dd>
+\anchor STARPU_MPI_DEBUG_LEVEL_MAX
+\addindex __env__STARPU_MPI_DEBUG_LEVEL_MAX
+Set the maximum level of debug when StarPU
+has been configured with the option \ref enable-mpi-verbose "--enable-mpi-verbose".
+</dd>
+
 <dt>STARPU_LOGFILENAME</dt>
 <dd>
 \anchor STARPU_LOGFILENAME
@@ -935,14 +951,21 @@ Specify in which file the debugging output should be saved to.
 <dd>
 \anchor STARPU_FXT_PREFIX
 \addindex __env__STARPU_FXT_PREFIX
-Specify in which directory to save the trace generated if FxT is enabled. It needs to have a trailing '/' character.
+Specify in which directory to save the generated trace if FxT is enabled.
+</dd>
+
+<dt>STARPU_FXT_SUFFIX</dt>
+<dd>
+\anchor STARPU_FXT_SUFFIX
+\addindex __env__STARPU_FXT_SUFFIX
+Specify in which file to save the generated trace if FxT is enabled.
 </dd>
 
 <dt>STARPU_FXT_TRACE</dt>
 <dd>
 \anchor STARPU_FXT_TRACE
 \addindex __env__STARPU_FXT_TRACE
-Specify whether to generate (1) or not (0) the FxT trace in /tmp/prof_file_XXX_YYY . The default is 1 (generate it)
+Specify whether to generate (1) or not (0) the FxT trace in /tmp/prof_file_XXX_YYY (the directory and file name can be changed with \ref STARPU_FXT_PREFIX and \ref STARPU_FXT_SUFFIX). The default is 1 (generate it)
 </dd>
 
 <dt>STARPU_LIMIT_CUDA_devid_MEM</dt>

+ 65 - 0
doc/doxygen_dev/dev/starpu_check_missing.sh

@@ -0,0 +1,65 @@
+#!/bin/bash
+# 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.
+#
+
+stcolor=$(tput sgr0)
+redcolor=$(tput setaf 1)
+greencolor=$(tput setaf 2)
+
+dirname=$(realpath $(dirname $0))
+
+ok()
+{
+    type=$1
+    name=$2
+    echo "$type ${greencolor}${name}${stcolor} is in doxygen-config.cfg.in"
+}
+
+ko()
+{
+    type=$1
+    name=$2
+    #echo "$type ${redcolor}${name}${stcolor} is missing from doxygen-config.cfg.in"
+    echo $name
+}
+
+for d in src mpi/src starpurm/src
+do
+    cd $dirname/../../../$d
+    for f in $(find -name "*.h")
+    do
+	ff=$(echo $f | cut -b3-)
+	x=$(grep -c $ff $dirname/../doxygen-config.cfg.in)
+	if test "$x" == "0"
+	then
+	    ko file $d/$ff
+	#else
+	#    ok file $d/$ff
+	fi
+    done
+done
+
+cd $dirname/../../../build/doc/doxygen_dev/latex
+for f in $(find -name "*8h.tex")
+do
+    ff=$(basename $(echo $f | cut -b3-) ".tex")
+    x=$(grep -c $ff refman.tex)
+    if test "$x" == "0"
+    then
+	ko file $ff
+    fi
+done
+

+ 26 - 1
doc/doxygen_dev/doxygen-config.cfg.in

@@ -99,7 +99,32 @@ INPUT                  = @top_srcdir@/doc/doxygen_dev/chapters         \
 			 @top_srcdir@/src/core/errorcheck.h \
 			 @top_srcdir@/src/core/progress_hook.h \
 			 @top_srcdir@/src/core/drivers.h \
-			 @top_srcdir@/src/core/workers.h
+			 @top_srcdir@/src/core/workers.h \
+			 @top_srcdir@/mpi/src/starpu_mpi_init.h \
+			 @top_srcdir@/mpi/src/starpu_mpi_datatype.h \
+			 @top_srcdir@/mpi/src/starpu_mpi_task_insert.h \
+			 @top_srcdir@/mpi/src/starpu_mpi_select_node.h \
+			 @top_srcdir@/mpi/src/starpu_mpi_fxt.h \
+			 @top_srcdir@/mpi/src/starpu_mpi_cache.h \
+			 @top_srcdir@/mpi/src/mpi/starpu_mpi_mpi_backend.h \
+			 @top_srcdir@/mpi/src/mpi/starpu_mpi_driver.h \
+			 @top_srcdir@/mpi/src/mpi/starpu_mpi_early_data.h \
+			 @top_srcdir@/mpi/src/mpi/starpu_mpi_comm.h \
+			 @top_srcdir@/mpi/src/mpi/starpu_mpi_tag.h \
+			 @top_srcdir@/mpi/src/mpi/starpu_mpi_mpi.h \
+			 @top_srcdir@/mpi/src/mpi/starpu_mpi_early_request.h \
+			 @top_srcdir@/mpi/src/mpi/starpu_mpi_sync_data.h \
+			 @top_srcdir@/mpi/src/load_balancer/policy/load_data_interface.h \
+			 @top_srcdir@/mpi/src/load_balancer/policy/load_balancer_policy.h \
+			 @top_srcdir@/mpi/src/load_balancer/policy/data_movements_interface.h \
+			 @top_srcdir@/mpi/src/nmad/starpu_mpi_nmad_unknown_datatype.h \
+			 @top_srcdir@/mpi/src/nmad/starpu_mpi_nmad_backend.h \
+			 @top_srcdir@/mpi/src/nmad/starpu_mpi_nmad.h \
+			 @top_srcdir@/mpi/src/starpu_mpi_stats.h \
+			 @top_srcdir@/mpi/src/starpu_mpi_private.h \
+			 @top_srcdir@/mpi/src/starpu_mpi_cache_stats.h \
+			 @top_srcdir@/starpurm/src/starpurm_private.h
+
 
 EXAMPLE_PATH           = @top_srcdir@/doc/doxygen_dev \
 		       	 @top_srcdir@/doc/doxygen/chapters

+ 2 - 0
doc/doxygen_dev/doxygen.cfg

@@ -1621,6 +1621,8 @@ PREDEFINED             = STARPU_USE_OPENCL=1 \
 			 STARPU_USE_SC_HYPERVISOR=1 \
 			 STARPU_SIMGRID=1 \
 			 STARPU_OPENMP=1 \
+			 STARPU_USE_MPI_MPI=1 \
+			 STARPU_USE_MPI_NMAD=1 \
                          __GCC__
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then

+ 30 - 1
doc/doxygen_dev/refman.tex

@@ -76,7 +76,7 @@ Documentation License”.
 \chapter{File Index}
 \input{files}
 
-\chapter{File Documentation}
+\chapter{StarPU File Documentation}
 \input{barrier_8h}
 \input{barrier__counter_8h}
 \input{bound_8h}
@@ -158,6 +158,35 @@ Documentation License”.
 \input{timing_8h}
 \input{topology_8h}
 \input{utils_8h}
+\input{uthash_8h}
 \input{write__back_8h}
 
+\chapter{StarPU MPI File Documentation}
+\input{starpu__mpi__cache_8h}
+\input{starpu__mpi__driver_8h}
+\input{starpu__mpi__init_8h}
+\input{starpu__mpi__nmad__backend_8h}
+\input{starpu__mpi__stats_8h}
+\input{starpu__mpi__cache__stats_8h}
+\input{starpu__mpi__early__data_8h}
+\input{starpu__mpi__mpi_8h}
+\input{starpu__mpi__nmad__unknown__datatype_8h}
+\input{starpu__mpi__sync__data_8h}
+\input{starpu__mpi__comm_8h}
+\input{starpu__mpi__early__request_8h}
+\input{starpu__mpi__mpi__backend_8h}
+\input{starpu__mpi__private_8h}
+\input{starpu__mpi__tag_8h}
+\input{starpu__mpi__datatype_8h}
+\input{starpu__mpi__fxt_8h}
+\input{starpu__mpi__nmad_8h}
+\input{starpu__mpi__select__node_8h}
+\input{starpu__mpi__task__insert_8h}
+\input{load__balancer__policy_8h}
+\input{load__data__interface_8h}
+\input{data__movements__interface_8h}
+
+\chapter{StarPU Resource Manager File Documentation}
+\input{starpurm__private_8h}
+
 \end{document}

+ 2 - 0
include/starpu_fxt.h

@@ -69,6 +69,7 @@ struct starpu_fxt_options
 	char *number_events_path;
 	char *anim_path;
 	char *states_path;
+	char *dir;
 	char worker_names[STARPU_NMAXWORKERS][256];
 	int nworkers;
 	struct starpu_perfmodel_arch worker_archtypes[STARPU_NMAXWORKERS];
@@ -104,6 +105,7 @@ struct starpu_fxt_options
 };
 
 void starpu_fxt_options_init(struct starpu_fxt_options *options);
+void starpu_fxt_options_shutdown(struct starpu_fxt_options *options);
 void starpu_fxt_generate_trace(struct starpu_fxt_options *options);
 
 /**

+ 3 - 3
julia/examples/old_examples/mult/mult.c

@@ -204,9 +204,9 @@ double median_time(unsigned nb_test, unsigned xdim, unsigned ydim, unsigned zdim
 {
 	unsigned i;
 
-	float * A = (float *) valloc(zdim*ydim*sizeof(float));
-	float * B = (float *) valloc(xdim*zdim*sizeof(float));
-	float * C = (float *) valloc(xdim*ydim*sizeof(float));
+	float * A = (float *) malloc(zdim*ydim*sizeof(float));
+	float * B = (float *) malloc(xdim*zdim*sizeof(float));
+	float * C = (float *) malloc(xdim*ydim*sizeof(float));
 
 	double exec_times[nb_test];
 

+ 6 - 4
mpi/src/load_balancer/policy/data_movements_interface.h

@@ -16,17 +16,19 @@
 
 #include <starpu.h>
 
+/** @file */
+
 #ifndef __DATA_MOVEMENTS_INTERFACE_H
 #define __DATA_MOVEMENTS_INTERFACE_H
 
-/* interface for data_movements */
+/** interface for data_movements */
 struct data_movements_interface
 {
-	/* Data tags table */
+	/** Data tags table */
 	int *tags;
-	/* Ranks table (where to move the corresponding data) */
+	/** Ranks table (where to move the corresponding data) */
 	int *ranks;
-	/* Size of the tables */
+	/** Size of the tables */
 	int size;
 };
 

+ 4 - 2
mpi/src/load_balancer/policy/load_balancer_policy.h

@@ -19,12 +19,14 @@
 
 #include <starpu_mpi_lb.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
-/* A load balancer consists in a collection of operations on a data
+/** A load balancer consists in a collection of operations on a data
  * representing the load of the application (in terms of computation, memory,
  * whatever). StarPU allows several entry points for the user. The load
  * balancer allows the user to give its load balancing methods to be used on
@@ -36,7 +38,7 @@ struct load_balancer_policy
 	void (*submitted_task_entry_point)();
 	void (*finished_task_entry_point)();
 
-	/* Name of the load balancing policy. The selection of the load balancer is
+	/** Name of the load balancing policy. The selection of the load balancer is
 	 * performed through the use of the STARPU_MPI_LB=name environment
 	 * variable.
 	 */

+ 11 - 9
mpi/src/load_balancer/policy/load_data_interface.h

@@ -16,29 +16,31 @@
 
 #include <starpu.h>
 
+/** @file */
+
 #ifndef __LOAD_DATA_INTERFACE_H
 #define __LOAD_DATA_INTERFACE_H
 
-/* interface for load_data */
+/** interface for load_data */
 struct load_data_interface
 {
-	/* Starting time of the execution */
+	/** Starting time of the execution */
 	double start;
-	/* Elapsed time until the start time and the time when event "launch a load
+	/** Elapsed time until the start time and the time when event "launch a load
 	 * balancing phase" is triggered */
 	double elapsed_time;
-	/* Current submission phase, i.e how many balanced steps have already
+	/** Current submission phase, i.e how many balanced steps have already
 	 * happened so far. */
 	int phase;
-	/* Number of currently submitted tasks */
+	/** Number of currently submitted tasks */
 	int nsubmitted_tasks;
-	/* Number of currently finished tasks */
+	/** Number of currently finished tasks */
 	int nfinished_tasks;
-	/* Task threshold to sleep the submission thread */
+	/** Task threshold to sleep the submission thread */
 	int sleep_task_threshold;
-	/* Task threshold to wake-up the submission thread */
+	/** Task threshold to wake-up the submission thread */
 	int wakeup_task_threshold;
-	/* Ratio of submitted tasks to wait for completion before waking up the
+	/** Ratio of submitted tasks to wait for completion before waking up the
 	 * submission thread */
 	double wakeup_ratio;
 };

+ 2 - 0
mpi/src/mpi/starpu_mpi_comm.h

@@ -25,6 +25,8 @@
 
 #include <mpi/starpu_mpi_mpi_backend.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {

+ 2 - 0
mpi/src/mpi/starpu_mpi_driver.h

@@ -19,6 +19,8 @@
 
 #include <starpu.h>
 
+/** @file */
+
 #ifdef STARPU_USE_MPI_MPI
 
 #ifdef __cplusplus

+ 2 - 0
mpi/src/mpi/starpu_mpi_early_data.h

@@ -25,6 +25,8 @@
 #include <common/uthash.h>
 #include <starpu_mpi_private.h>
 
+/** @file */
+
 #ifdef STARPU_USE_MPI_MPI
 
 #ifdef __cplusplus

+ 2 - 0
mpi/src/mpi/starpu_mpi_early_request.h

@@ -23,6 +23,8 @@
 #include <common/config.h>
 #include <common/list.h>
 
+/** @file */
+
 #ifdef STARPU_USE_MPI_MPI
 
 #ifdef __cplusplus

+ 6 - 0
mpi/src/mpi/starpu_mpi_mpi.c

@@ -760,6 +760,12 @@ static void _starpu_mpi_barrier_func(struct _starpu_mpi_req *barrier_req)
 {
 	_STARPU_MPI_LOG_IN();
 
+	/* FIXME: rather use MPI_Ibarrier and make it a detached request.
+	 * We'd then be able to introduce starpu_mpi_ibarrier, and make
+	 * starpu_mpi_barrier just call starpu_mpi_ibarrier(); starpu_mpi_wait();
+	 * That'll solve locking issue when intermixing starpu_mpi_barrier with
+	 * other communications.
+	 */
 	barrier_req->ret = MPI_Barrier(barrier_req->node_tag.node.comm);
 	STARPU_MPI_ASSERT_MSG(barrier_req->ret == MPI_SUCCESS, "MPI_Barrier returning %s", _starpu_mpi_get_mpi_error_code(barrier_req->ret));
 

+ 2 - 0
mpi/src/mpi/starpu_mpi_mpi.h

@@ -23,6 +23,8 @@
 #include <common/config.h>
 #include <common/list.h>
 
+/** @file */
+
 #ifdef STARPU_USE_MPI_MPI
 
 #ifdef __cplusplus

+ 3 - 1
mpi/src/mpi/starpu_mpi_mpi_backend.h

@@ -20,6 +20,8 @@
 #include <common/config.h>
 #include <common/uthash.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {
@@ -54,7 +56,7 @@ struct _starpu_mpi_req_backend
 	starpu_pthread_cond_t req_cond;
 	starpu_pthread_mutex_t posted_mutex;
 	starpu_pthread_cond_t posted_cond;
-	/* In the case of a Wait/Test request, we are going to post a request
+	/** In the case of a Wait/Test request, we are going to post a request
 	 * to test the completion of another request */
 	struct _starpu_mpi_req *other_request;
 

+ 2 - 0
mpi/src/mpi/starpu_mpi_sync_data.h

@@ -23,6 +23,8 @@
 #include <common/config.h>
 #include <common/list.h>
 
+/** @file */
+
 #ifdef STARPU_USE_MPI_MPI
 
 #ifdef __cplusplus

+ 2 - 0
mpi/src/mpi/starpu_mpi_tag.h

@@ -21,6 +21,8 @@
 #include <stdlib.h>
 #include <mpi.h>
 
+/** @file */
+
 #ifdef STARPU_USE_MPI_MPI
 
 #ifdef __cplusplus

+ 2 - 0
mpi/src/nmad/starpu_mpi_nmad.h

@@ -23,6 +23,8 @@
 #include <common/config.h>
 #include <common/list.h>
 
+/** @file */
+
 #ifdef STARPU_USE_MPI_NMAD
 
 #ifdef __cplusplus

+ 3 - 1
mpi/src/nmad/starpu_mpi_nmad_backend.h

@@ -19,6 +19,8 @@
 
 #include <common/config.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {
@@ -38,7 +40,7 @@ struct _starpu_mpi_req_backend
 	piom_cond_t req_cond;
 	nm_sr_request_t size_req;
 
-	// When datatype is unknown:
+	/** When datatype is unknown */
 	struct nm_data_s unknown_datatype_body;
 	struct nm_data_s unknown_datatype_data;
 	struct nm_data_s unknown_datatype_size;

+ 2 - 0
mpi/src/nmad/starpu_mpi_nmad_unknown_datatype.h

@@ -19,6 +19,8 @@
 
 #include <common/config.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {

+ 2 - 0
mpi/src/starpu_mpi_cache.h

@@ -21,6 +21,8 @@
 #include <stdlib.h>
 #include <mpi.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {

+ 2 - 0
mpi/src/starpu_mpi_cache_stats.h

@@ -21,6 +21,8 @@
 #include <stdlib.h>
 #include <mpi.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {

+ 1 - 1
mpi/src/starpu_mpi_datatype.c

@@ -106,7 +106,7 @@ static int handle_to_datatype_tensor(starpu_data_handle_t data_handle, MPI_Datat
 	unsigned ldy = starpu_tensor_get_local_ldy(data_handle);
 	unsigned ldz = starpu_tensor_get_local_ldz(data_handle);
 	unsigned ldt = starpu_tensor_get_local_ldt(data_handle);
-	size_t elemsize = starpu_block_get_elemsize(data_handle);
+	size_t elemsize = starpu_tensor_get_elemsize(data_handle);
 
 	MPI_Datatype datatype_3dlayer;
 	ret = MPI_Type_vector(ny, nx*elemsize, ldy*elemsize, MPI_BYTE, &datatype_3dlayer);

+ 2 - 0
mpi/src/starpu_mpi_datatype.h

@@ -20,6 +20,8 @@
 #include <starpu_mpi.h>
 #include <starpu_mpi_private.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {

+ 2 - 0
mpi/src/starpu_mpi_fxt.h

@@ -22,6 +22,8 @@
 #include <common/config.h>
 #include <common/fxt.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {

+ 2 - 0
mpi/src/starpu_mpi_init.h

@@ -20,6 +20,8 @@
 #include <starpu.h>
 #include <starpu_mpi.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {

+ 2 - 0
mpi/src/starpu_mpi_private.c

@@ -68,4 +68,6 @@ void _starpu_mpi_env_init(void)
 	_starpu_mpi_use_prio = starpu_get_env_number_default("STARPU_MPI_PRIORITIES", 1);
 	_starpu_mpi_use_coop_sends = starpu_get_env_number_default("STARPU_MPI_COOP_SENDS", 1);
 	_starpu_mpi_mem_throttle = starpu_get_env_number_default("STARPU_MPI_MEM_THROTTLE", 0);
+	_starpu_debug_level_min = starpu_get_env_number_default("STARPU_MPI_DEBUG_LEVEL_MIN", 0);
+	_starpu_debug_level_max = starpu_get_env_number_default("STARPU_MPI_DEBUG_LEVEL_MAX", 0);
 }

+ 8 - 3
mpi/src/starpu_mpi_private.h

@@ -27,6 +27,8 @@
 #include <common/starpu_spinlock.h>
 #include <core/simgrid.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {
@@ -246,7 +248,8 @@ LIST_TYPE(_starpu_mpi_req,
 
 	int ret;
 
-	enum _starpu_mpi_request_type request_type; /* 0 send, 1 recv */
+	/** 0 send, 1 recv */
+	enum _starpu_mpi_request_type request_type;
 
 	unsigned submitted;
 	unsigned completed;
@@ -315,8 +318,10 @@ struct _starpu_mpi_argc_argv
 	int *argc;
 	char ***argv;
 	MPI_Comm comm;
-	int fargc;	// Fortran argc
-	char **fargv;	// Fortran argv
+	/** Fortran argc */
+	int fargc;
+	/** Fortran argv */
+	char **fargv;
 	int rank;
 	int world_size;
 };

+ 2 - 0
mpi/src/starpu_mpi_select_node.h

@@ -19,6 +19,8 @@
 
 #include <mpi.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {

+ 2 - 0
mpi/src/starpu_mpi_stats.h

@@ -21,6 +21,8 @@
 #include <stdlib.h>
 #include <mpi.h>
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {

+ 2 - 0
mpi/src/starpu_mpi_task_insert.h

@@ -17,6 +17,8 @@
 #ifndef __STARPU_MPI_TASK_INSERT_H__
 #define __STARPU_MPI_TASK_INSERT_H__
 
+/** @file */
+
 #ifdef __cplusplus
 extern "C"
 {

+ 1 - 1
socl/src/cl_createbuffer.c

@@ -115,7 +115,7 @@ soclCreateBuffer(cl_context   context,
 	// If not MEM_USE_HOST_PTR, we need to alloc the buffer ourselves
 	if (!(flags & CL_MEM_USE_HOST_PTR))
 	{
-		mem->ptr = valloc(size);
+		mem->ptr = malloc(size);
 		if (mem->ptr == NULL)
 		{
 			if (errcode_ret != NULL)

+ 34 - 29
src/common/fxt.c

@@ -39,7 +39,7 @@ unsigned long _starpu_job_cnt = 0;
 #include <sys/thr.h>       /* for thr_self() */
 #endif
 
-static char _STARPU_PROF_FILE_USER[128];
+static char _starpu_prof_file_user[128];
 int _starpu_fxt_started = 0;
 int _starpu_fxt_willstart = 1;
 starpu_pthread_mutex_t _starpu_fxt_started_mutex = STARPU_PTHREAD_MUTEX_INITIALIZER;
@@ -95,26 +95,25 @@ static void _starpu_profile_set_tracefile(void)
 
 	char *fxt_prefix = starpu_getenv("STARPU_FXT_PREFIX");
 	if (!fxt_prefix)
-	     fxt_prefix = "/tmp/";
+		fxt_prefix = "/tmp";
 	else
+		_starpu_mkpath_and_check(fxt_prefix, S_IRWXU);
+
+	char suffix[127];
+	char *fxt_suffix = starpu_getenv("STARPU_FXT_SUFFIX");
+	if (!fxt_suffix)
 	{
-		// Check if the given folder really exists:
-		struct stat folder_stat;
-		if (stat(fxt_prefix, &folder_stat) < 0 || !S_ISDIR(folder_stat.st_mode))
-		{
-			_STARPU_MSG("%s is not a valid directory.\n", fxt_prefix);
-			_starpu_abort();
-		}
+		user = starpu_getenv("USER");
+		if (!user)
+			user = "";
+		snprintf(suffix, sizeof(suffix), "prof_file_%s_%d", user, _starpu_id);
+	}
+	else
+	{
+		snprintf(suffix, sizeof(suffix), "%s_%d", fxt_suffix, _starpu_id);
 	}
 
-	user = starpu_getenv("USER");
-	if (!user)
-		user = "";
-
-	char suffix[128];
-	snprintf(suffix, sizeof(suffix), "prof_file_%s_%d", user, _starpu_id);
-
-	snprintf(_STARPU_PROF_FILE_USER, sizeof(_STARPU_PROF_FILE_USER), "%s%s", fxt_prefix, suffix);
+	snprintf(_starpu_prof_file_user, sizeof(_starpu_prof_file_user), "%s/%s", fxt_prefix, suffix);
 }
 
 void starpu_profiling_set_id(int new_id)
@@ -124,7 +123,7 @@ void starpu_profiling_set_id(int new_id)
 	_starpu_profile_set_tracefile();
 
 #ifdef HAVE_FUT_SET_FILENAME
-	fut_set_filename(_STARPU_PROF_FILE_USER);
+	fut_set_filename(_starpu_prof_file_user);
 #endif
 }
 
@@ -184,7 +183,7 @@ void _starpu_fxt_init_profiling(uint64_t trace_buffer_size)
 	_starpu_profile_set_tracefile();
 
 #ifdef HAVE_FUT_SET_FILENAME
-	fut_set_filename(_STARPU_PROF_FILE_USER);
+	fut_set_filename(_starpu_prof_file_user);
 #endif
 #ifdef HAVE_ENABLE_FUT_FLUSH
 	// when the event buffer is full, fxt stops recording events.
@@ -261,7 +260,7 @@ static void _starpu_generate_paje_trace_read_option(const char *option, struct s
 	}
 }
 
-static void _starpu_generate_paje_trace(char *input_fxt_filename, char *output_paje_filename)
+static void _starpu_generate_paje_trace(char *input_fxt_filename, char *output_paje_filename, char *dirname)
 {
 	/* We take default options */
 	struct starpu_fxt_options options;
@@ -283,6 +282,7 @@ static void _starpu_generate_paje_trace(char *input_fxt_filename, char *output_p
 	options.out_paje_path = output_paje_filename;
 	options.file_prefix = "";
 	options.file_rank = -1;
+	options.dir = dirname;
 
 	starpu_fxt_generate_trace(&options);
 }
@@ -291,10 +291,17 @@ void _starpu_fxt_dump_file(void)
 {
 	if (!_starpu_fxt_started)
 		return;
+
+	char hostname[128];
+	gethostname(hostname, 128);
+
+	int ret = fut_endup(_starpu_prof_file_user);
+	if (ret < 0)
+		_STARPU_MSG("Problem when writing FxT traces into file %s:%s\n", hostname, _starpu_prof_file_user);
 #ifdef STARPU_VERBOSE
-	_STARPU_MSG("Writing FxT traces into file %s\n", _STARPU_PROF_FILE_USER);
+	else
+		_STARPU_MSG("Writing FxT traces into file %s:%s\n", hostname, _starpu_prof_file_user);
 #endif
-	fut_endup(_STARPU_PROF_FILE_USER);
 }
 
 void _starpu_stop_fxt_profiling(void)
@@ -303,17 +310,15 @@ void _starpu_stop_fxt_profiling(void)
 		return;
 	if (!_starpu_written)
 	{
-#ifdef STARPU_VERBOSE
-	        char hostname[128];
-		gethostname(hostname, 128);
-		_STARPU_MSG("Writing FxT traces into file %s:%s\n", hostname, _STARPU_PROF_FILE_USER);
-#endif
-		fut_endup(_STARPU_PROF_FILE_USER);
+		_starpu_fxt_dump_file();
 
 		/* Should we generate a Paje trace directly ? */
 		int generate_trace = starpu_get_env_number("STARPU_GENERATE_TRACE");
 		if (generate_trace == 1)
-			_starpu_generate_paje_trace(_STARPU_PROF_FILE_USER, "paje.trace");
+		{
+			char *fxt_prefix = starpu_getenv("STARPU_FXT_PREFIX");
+			_starpu_generate_paje_trace(_starpu_prof_file_user, "paje.trace", fxt_prefix);
+		}
 
 		int ret = fut_done();
 		if (ret < 0)

+ 1 - 1
src/common/fxt.h

@@ -291,7 +291,7 @@ extern int _starpu_fxt_willstart;
 extern starpu_pthread_mutex_t _starpu_fxt_started_mutex;
 extern starpu_pthread_cond_t _starpu_fxt_started_cond;
 
-/* Wait until FXT is started (or not). Returns if FXT was started */
+/** Wait until FXT is started (or not). Returns if FXT was started */
 static inline int _starpu_fxt_wait_initialisation()
 {
 	STARPU_PTHREAD_MUTEX_LOCK(&_starpu_fxt_started_mutex);

+ 29 - 14
src/common/graph.h

@@ -28,8 +28,10 @@ MULTILIST_CREATE_TYPE(_starpu_graph_node, dropped)
 
 struct _starpu_graph_node
 {
-	starpu_pthread_mutex_t mutex;	/* protects access to the job */
-	struct _starpu_job *job;	/* pointer to the job, if it is still alive, NULL otherwise */
+	/** protects access to the job */
+	starpu_pthread_mutex_t mutex;
+	/** pointer to the job, if it is still alive, NULL otherwise */
+	struct _starpu_job *job;
 
 	/**
 	 * Fields for graph analysis for scheduling heuristics
@@ -44,22 +46,35 @@ struct _starpu_graph_node
 	struct _starpu_graph_node_multilist_dropped dropped;
 
 	/** set of incoming dependencies */
-	struct _starpu_graph_node **incoming;	/* May contain NULLs for terminated jobs */
-	unsigned *incoming_slot;	/* Index within corresponding outgoing array */
-	unsigned n_incoming;		/* Number of slots used */
-	unsigned alloc_incoming;	/* Size of incoming */
+	/** May contain NULLs for terminated jobs */
+	struct _starpu_graph_node **incoming;
+	/** Index within corresponding outgoing array */
+	unsigned *incoming_slot;
+	/** Number of slots used */
+	unsigned n_incoming;
+	/** Size of incoming */
+	unsigned alloc_incoming;
 	/** set of outgoing dependencies */
 	struct _starpu_graph_node **outgoing;
-	unsigned *outgoing_slot;	/* Index within corresponding incoming array */
-	unsigned n_outgoing;		/* Number of slots used */
-	unsigned alloc_outgoing;	/* Size of outgoing */
 
-	unsigned depth;			/* Rank from bottom, in number of jobs */
-					/* Only available if _starpu_graph_compute_depths was called */
-	unsigned descendants;		/* Number of children, grand-children, etc. */
-					/* Only available if _starpu_graph_compute_descendants was called */
+	/** Index within corresponding incoming array */
+	unsigned *outgoing_slot;
+	/** Number of slots used */
+	unsigned n_outgoing;
+	/** Size of outgoing */
+	unsigned alloc_outgoing;
 
-	int graph_n;			/* Variable available for graph flow */
+	/** Rank from bottom, in number of jobs
+	 * Only available if _starpu_graph_compute_depths was called
+	 */
+	unsigned depth;
+	/** Number of children, grand-children, etc.
+	 * Only available if _starpu_graph_compute_descendants was called
+	 */
+	unsigned descendants;
+
+	/** Variable available for graph flow */
+	int graph_n;
 };
 
 MULTILIST_CREATE_INLINES(struct _starpu_graph_node, _starpu_graph_node, all)

+ 4 - 6
src/common/knobs.h

@@ -96,7 +96,7 @@ __STARPU_PERF_COUNTER_UPDATE_64BIT(min,<=,double,double);
 #undef __STARPU_PERF_COUNTER_UPDATE_32BIT
 #undef __STARPU_PERF_COUNTER_UPDATE_64BIT
 
-/* Floating point atomic accumulate */
+/** Floating point atomic accumulate */
 static inline void _starpu_perf_counter_update_acc_float(float *ptr, float acc_value)
 {
 	STARPU_ASSERT(sizeof(float) == sizeof(uint32_t));
@@ -339,14 +339,12 @@ static inline int _starpu_perf_knob_id_build(const enum starpu_perf_knob_scope s
 	return (index << _STARPU_PERF_KNOBS_ID_SCOPE_BITS) | scope;
 }
 
-
 void _starpu_perf_knob_init(void);
 void _starpu_perf_knob_exit(void);
 
-struct starpu_perf_knob_group *_starpu_perf_knob_group_register(
-	enum starpu_perf_knob_scope scope,
-	void (*set_func)(const struct starpu_perf_knob * const knob, void *context, const struct starpu_perf_knob_value * const value),
-	void (*get_func)(const struct starpu_perf_knob * const knob, void *context,       struct starpu_perf_knob_value * const value));
+struct starpu_perf_knob_group *_starpu_perf_knob_group_register(enum starpu_perf_knob_scope scope,
+								void (*set_func)(const struct starpu_perf_knob * const knob, void *context, const struct starpu_perf_knob_value * const value),
+								void (*get_func)(const struct starpu_perf_knob * const knob, void *context, struct starpu_perf_knob_value * const value));
 void _starpu_perf_knob_group_unregister(struct starpu_perf_knob_group *group);
 
 int _starpu_perf_knob_register(struct starpu_perf_knob_group *group, const char *name, enum starpu_perf_knob_type type, const char *help);

+ 2 - 0
src/common/list.h

@@ -18,6 +18,8 @@
 #ifndef __LIST_H__
 #define __LIST_H__
 
+/** @file */
+
 #include <starpu_util.h>
 
 /** @remarks list how-to

+ 4 - 5
src/common/timing.h

@@ -19,11 +19,6 @@
 
 /** @file */
 
-/*
- * _starpu_timing_init must be called prior to using any of these timing
- * functions.
- */
-
 #include <stdint.h>
 #include <common/config.h>
 #ifdef HAVE_UNISTD_H
@@ -32,6 +27,10 @@
 #include <starpu.h>
 #include <starpu_util.h>
 
+/**
+ * _starpu_timing_init must be called prior to using any of these timing
+ * functions.
+ */
 void _starpu_timing_init(void);
 void _starpu_clock_gettime(struct timespec *ts);
 

+ 2 - 0
src/common/uthash.h

@@ -24,6 +24,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef UTHASH_H
 #define UTHASH_H 
 
+/** @file */
+
 #include <string.h>   /* memcmp,strlen */
 #include <stddef.h>   /* ptrdiff_t */
 

+ 1 - 1
src/common/utils.c

@@ -112,7 +112,7 @@ int _starpu_mkpath(const char *s, mode_t mode)
 	{
 		if (!S_ISDIR(sb.st_mode))
 		{
-			_STARPU_MSG("Error: %s is not a directory:\n", path);
+			_STARPU_MSG("Error: %s already exists and is not a directory:\n", path);
 			STARPU_ABORT();
 		}
 		/* It already exists and is a directory.  */

+ 1 - 1
src/common/utils.h

@@ -152,7 +152,7 @@ char *_starpu_mkdtemp(char *tmpl);
 int _starpu_mkpath(const char *s, mode_t mode);
 void _starpu_mkpath_and_check(const char *s, mode_t mode);
 char *_starpu_mktemp(const char *directory, int flags, int *fd);
-/* This version creates a hierarchy of n temporary directories, useful when
+/** This version creates a hierarchy of n temporary directories, useful when
  * creating a lot of temporary files to be stored in the same place */
 char *_starpu_mktemp_many(const char *directory, int depth, int flags, int *fd);
 void _starpu_rmtemp_many(char *path, int depth);

+ 5 - 5
src/core/debug.h

@@ -290,20 +290,20 @@
 
 #endif
 
-/* Create a file that will contain StarPU's log */
+/** Create a file that will contain StarPU's log */
 void _starpu_open_debug_logfile(void);
 
-/* Close StarPU's log file */
+/** Close StarPU's log file */
 void _starpu_close_debug_logfile(void);
 
-/* Write into StarPU's log file */
+/** Write into StarPU's log file */
 void _starpu_print_to_logfile(const char *format, ...) STARPU_ATTRIBUTE_FORMAT(printf, 1, 2);
 
-/* Tell gdb whether FXT is compiled in or not */
+/** Tell gdb whether FXT is compiled in or not */
 extern int _starpu_use_fxt;
 
 #if defined(STARPU_USE_AYUDAME1)
-/* Get an Ayudame id for CL */
+/** Get an Ayudame id for CL */
 int64_t _starpu_ayudame_get_func_id(struct starpu_codelet *cl);
 #endif
 

+ 14 - 9
src/core/dependencies/cg.h

@@ -60,7 +60,8 @@ struct _starpu_cg_list
 	/** List of successors */
 	unsigned nsuccs; /* how many successors ? */
 #ifdef STARPU_DYNAMIC_DEPS_SIZE
-	unsigned succ_list_size; /* How many allocated items in succ */
+	/** How many allocated items in succ */
+	unsigned succ_list_size;
 	struct _starpu_cg **succ;
 #else
 	struct _starpu_cg *succ[STARPU_NMAXDEPS];
@@ -77,27 +78,31 @@ enum _starpu_cg_type
 /** Completion Group */
 struct _starpu_cg
 {
-	unsigned ntags; /* number of tags depended on */
-	unsigned remaining; /* number of remaining tags */
+	/** number of tags depended on */
+	unsigned ntags;
+	/** number of remaining tags */
+	unsigned remaining;
 
 #ifdef STARPU_DEBUG
 	unsigned ndeps;
-	void **deps; /* array of predecessors, size ndeps */
-	char *done;  /* which ones have notified, size ndeps */
+	/** array of predecessors, size ndeps */
+	void **deps;
+	/** which ones have notified, size ndeps */
+	char *done;
 #endif
 
 	enum _starpu_cg_type cg_type;
 
 	union
 	{
-		/* STARPU_CG_TAG */
+		/** STARPU_CG_TAG */
 		struct _starpu_tag *tag;
 
-		/* STARPU_CG_TASK */
+		/** STARPU_CG_TASK */
 		struct _starpu_job *job;
 
-		/* STARPU_CG_APPS */
-		/* in case this completion group is related to an application,
+		/** STARPU_CG_APPS
+		 * in case this completion group is related to an application,
 		 * we have to explicitely wake the waiting thread instead of
 		 * reschedule the corresponding task */
 		struct

+ 14 - 12
src/core/dependencies/tags.h

@@ -28,19 +28,18 @@
 
 enum _starpu_tag_state
 {
-	/* this tag is not declared by any task */
+	/** this tag is not declared by any task */
 	STARPU_INVALID_STATE,
-	/* _starpu_tag_declare was called to associate the tag to a task */
+	/** _starpu_tag_declare was called to associate the tag to a task */
 	STARPU_ASSOCIATED,
-	/* some task dependencies are not fulfilled yet */
+	/** some task dependencies are not fulfilled yet */
 	STARPU_BLOCKED,
-	/* the task can be (or has been) submitted to the scheduler (all deps
- 	 * fulfilled) */
+	/** the task can be (or has been) submitted to the scheduler (all deps fulfilled) */
 	STARPU_READY,
 // useless ...
-//	/* the task has been submitted to the scheduler */
+//	/** the task has been submitted to the scheduler */
 //	STARPU_SCHEDULED,
-	/* the task has been performed */
+	/** the task has been performed */
 	STARPU_DONE
 };
 
@@ -48,15 +47,18 @@ struct _starpu_job;
 
 struct _starpu_tag
 {
-	/* Lock for this structure. Locking order is in dependency order: a tag
-	 * must not be locked before locking a tag it depends on */
+	/**
+	   Lock for this structure. Locking order is in dependency order: a tag
+	   * must not be locked before locking a tag it depends on */
 	struct _starpu_spinlock lock;
-	starpu_tag_t id; /* an identifier for the task */
+	/** an identifier for the task */
+	starpu_tag_t id;
 	enum _starpu_tag_state state;
 
 	struct _starpu_cg_list tag_successors;
 
-	struct _starpu_job *job; /* which job is associated to the tag if any ? */
+	/** which job is associated to the tag if any ? */
+	struct _starpu_job *job;
 
 	unsigned is_assigned;
 	unsigned is_submitted;
@@ -69,7 +71,7 @@ void _starpu_notify_job_start_tag_dependencies(struct _starpu_tag *tag, _starpu_
 
 void _starpu_tag_declare(starpu_tag_t id, struct _starpu_job *job);
 
-/* lock should be taken, and this releases it */
+/** lock should be taken, and this releases it */
 void _starpu_tag_set_ready(struct _starpu_tag *tag);
 
 unsigned _starpu_submit_job_enforce_task_deps(struct _starpu_job *j);

+ 4 - 2
src/core/perfmodel/perfmodel.h

@@ -50,8 +50,10 @@ struct _starpu_perfmodel_state
 	starpu_pthread_rwlock_t model_rwlock;
 	int *nimpls;
 	int *nimpls_set;
-	int ncombs;  /* The number of combinations currently used by the model */
-	int ncombs_set; /* The number of combinations allocated in the array nimpls and ncombs */
+	/** The number of combinations currently used by the model */
+	int ncombs;
+	/** The number of combinations allocated in the array nimpls and ncombs */
+	int ncombs_set;
 	int *combs;
 };
 

+ 1 - 1
src/core/simgrid.h

@@ -73,7 +73,7 @@ union _starpu_async_channel_event;
 int _starpu_simgrid_wait_transfer_event(union _starpu_async_channel_event *event);
 int _starpu_simgrid_test_transfer_event(union _starpu_async_channel_event *event);
 void _starpu_simgrid_sync_gpus(void);
-/* Return the number of hosts prefixed by PREFIX */
+/** Return the number of hosts prefixed by PREFIX */
 int _starpu_simgrid_get_nbhosts(const char *prefix);
 unsigned long long _starpu_simgrid_get_memsize(const char *prefix, unsigned devid);
 starpu_sg_host_t _starpu_simgrid_get_host_by_name(const char *name);

+ 6 - 3
src/core/topology.h

@@ -31,9 +31,12 @@ struct _starpu_machine_config;
 /** This is allocated for each hwloc object */
 struct _starpu_hwloc_userdata
 {
-	struct _starpu_worker_list *worker_list; /** List of workers running on this obj */
-	unsigned ngpus; /** Number of GPUs sharing this PCI link */
-	struct _starpu_worker *pu_worker; /** Worker running this PU */
+	 /** List of workers running on this obj */
+	struct _starpu_worker_list *worker_list;
+	 /** Number of GPUs sharing this PCI link */
+	unsigned ngpus;
+	/** Worker running this PU */
+	struct _starpu_worker *pu_worker;
 };
 #endif
 #endif

+ 6 - 6
src/core/workers.h

@@ -204,7 +204,7 @@ LIST_TYPE(_starpu_worker,
 	int enable_knob;
 	int bindid_requested;
 
-	/* Keep this last, to make sure to separate worker data in separate
+	  /** Keep this last, to make sure to separate worker data in separate
 	  cache lines. */
 	char padding[STARPU_CACHELINE_SIZE];
 );
@@ -228,7 +228,7 @@ struct _starpu_combined_worker
 	hwloc_bitmap_t hwloc_cpu_set;
 #endif
 
-	/* Keep this last, to make sure to separate worker data in separate
+	/** Keep this last, to make sure to separate worker data in separate
 	  cache lines. */
 	char padding[STARPU_CACHELINE_SIZE];
 };
@@ -412,7 +412,7 @@ struct _starpu_machine_config
         /* Memory node for FPGA, if only one */
 	int fpga_nodeid;
 
-	/* Separate out previous variables from per-worker data. */
+	/** Separate out previous variables from per-worker data. */
 	char padding1[STARPU_CACHELINE_SIZE];
 
 	/** Basic workers : each of this worker is running its own driver and
@@ -425,7 +425,7 @@ struct _starpu_machine_config
 
 	starpu_pthread_mutex_t submitted_mutex;
 
-	/* Separate out previous mutex from the rest of the data. */
+	/** Separate out previous mutex from the rest of the data. */
 	char padding2[STARPU_CACHELINE_SIZE];
 
 	/** Translation table from bindid to worker IDs */
@@ -1216,8 +1216,8 @@ void _starpu_worker_refuse_task(struct _starpu_worker *worker, struct starpu_tas
 void _starpu_set_catch_signals(int do_catch_signal);
 int _starpu_get_catch_signals(void);
 
-/* Performance Monitoring */
-static inline int _starpu_perf_counter_paused(void) 
+/** Performance Monitoring */
+static inline int _starpu_perf_counter_paused(void)
 {
 	STARPU_RMB();
 	return STARPU_UNLIKELY(_starpu_config.perf_counter_pause_depth > 0);

+ 8 - 4
src/datawizard/copy_driver.h

@@ -49,10 +49,14 @@ struct _starpu_data_replicate;
 
 enum _starpu_is_prefetch
 {
-	STARPU_FETCH = 0,		/* A task really needs it now! */
-	STARPU_TASK_PREFETCH = 1,	/* A task will need it soon */
-	STARPU_PREFETCH = 2,		/* It is a good idea to have it asap */
-	STARPU_IDLEFETCH = 3,		/* Get this here when you have time to */
+ 	/** A task really needs it now! */
+ 	STARPU_FETCH = 0,
+	/** A task will need it soon */
+	STARPU_TASK_PREFETCH = 1,
+	/** It is a good idea to have it asap */
+	STARPU_PREFETCH = 2,
+	/** Get this here when you have time to */
+	STARPU_IDLEFETCH = 3,
 	STARPU_NFETCH
 };
 

+ 2 - 1
src/datawizard/data_request.h

@@ -35,7 +35,8 @@
 #define MAX_PENDING_REQUESTS_PER_NODE 20
 #define MAX_PENDING_PREFETCH_REQUESTS_PER_NODE 10
 #define MAX_PENDING_IDLE_REQUESTS_PER_NODE 1
-#define MAX_PUSH_TIME 1000 /* Maximum time in us that we can afford pushing requests before going back to the driver loop, e.g. for checking GPU task termination */
+/** Maximum time in us that we can afford pushing requests before going back to the driver loop, e.g. for checking GPU task termination */
+#define MAX_PUSH_TIME 1000
 
 struct _starpu_data_replicate;
 

+ 2 - 2
src/datawizard/memalloc.h

@@ -59,8 +59,8 @@ LIST_TYPE(_starpu_mem_chunk,
 	unsigned home:1;
 	/** Whether the memchunk is in the clean part of the mc_list */
 	unsigned clean:1;
-	/** Was this chunk used since it got allocated?  */
-	/* FIXME: probably useless now with nb_tasks_prefetch */
+	/** Was this chunk used since it got allocated?
+	    FIXME: probably useless now with nb_tasks_prefetch */
 	unsigned diduse:1;
 	/** Was this chunk marked as "won't use"? */
 	unsigned wontuse:1;

+ 3 - 3
src/datawizard/memory_nodes.h

@@ -45,7 +45,7 @@ struct _starpu_memory_node_descr
 	enum starpu_node_kind nodes[STARPU_MAXNODES];
 	struct _starpu_node_ops *node_ops[STARPU_MAXNODES];
 
-	/* Get the device id associated to this node, or -1 if not applicable */
+	/** Get the device id associated to this node, or -1 if not applicable */
 	int devid[STARPU_MAXNODES];
 
 	unsigned nworkers[STARPU_MAXNODES];
@@ -55,7 +55,7 @@ struct _starpu_memory_node_descr
 #endif
 
 	// TODO move this 2 lists outside struct _starpu_memory_node_descr
-	/* Every worker is associated to a condition variable on which the
+	/** Every worker is associated to a condition variable on which the
 	 * worker waits when there is task available. It is possible that
 	 * multiple worker share the same condition variable, so we maintain a
 	 * list of all these condition variables so that we can wake up all
@@ -63,7 +63,7 @@ struct _starpu_memory_node_descr
 	starpu_pthread_rwlock_t conditions_rwlock;
 	struct _starpu_cond_and_worker conditions_attached_to_node[STARPU_MAXNODES][STARPU_NMAXWORKERS];
 	struct _starpu_cond_and_worker conditions_all[STARPU_MAXNODES*STARPU_NMAXWORKERS];
-	/* the number of queues attached to each node */
+	/** the number of queues attached to each node */
 	unsigned total_condition_count;
 	unsigned condition_count[STARPU_MAXNODES];
 };

+ 1 - 1
src/datawizard/memstats.h

@@ -25,7 +25,7 @@
 #ifdef STARPU_MEMORY_STATS
 struct _starpu_memory_stats
 {
-	/* Handle access stats per node */
+	/** Handle access stats per node */
 	unsigned direct_access[STARPU_MAXNODES];
 	unsigned loaded_shared[STARPU_MAXNODES];
 	unsigned loaded_owner[STARPU_MAXNODES];

+ 97 - 10
src/debug/traces/starpu_fxt.c

@@ -3432,8 +3432,7 @@ void _starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *op
 	fd_in = open(filename_in, O_RDONLY);
 	if (fd_in < 0)
 	{
-	        perror("open failed :");
-	        exit(-1);
+		STARPU_ABORT_MSG("Failed to open '%s' (err %s)", filename_in, strerror(errno));
 	}
 
 	static fxt_t fut;
@@ -4264,6 +4263,59 @@ void starpu_fxt_options_init(struct starpu_fxt_options *options)
 	options->dumped_codelets = NULL;
 	options->activity_path = "activity.data";
 	options->sched_tasks_path = "sched_tasks.rec";
+	options->dir = NULL;
+}
+
+static
+void _set_dir(char *dir, char **option)
+{
+	if (*option)
+	{
+		char *tmp = strdup(*option);
+		_STARPU_MALLOC(*option, 256);
+		snprintf(*option, 256, "%s/%s", dir, tmp);
+		free(tmp);
+	}
+}
+
+static
+void _starpu_fxt_options_set_dir(struct starpu_fxt_options *options)
+{
+	if (!options->dir)
+		return;
+
+	_starpu_mkpath_and_check(options->dir, S_IRWXU);
+	_set_dir(options->dir, &options->out_paje_path);
+	_set_dir(options->dir, &options->dag_path);
+	_set_dir(options->dir, &options->tasks_path);
+	_set_dir(options->dir, &options->comms_path);
+	_set_dir(options->dir, &options->number_events_path);
+	_set_dir(options->dir, &options->data_path);
+	_set_dir(options->dir, &options->papi_path);
+	_set_dir(options->dir, &options->anim_path);
+	_set_dir(options->dir, &options->states_path);
+	_set_dir(options->dir, &options->distrib_time_path);
+	_set_dir(options->dir, &options->activity_path);
+	_set_dir(options->dir, &options->sched_tasks_path);
+}
+
+void starpu_fxt_options_shutdown(struct starpu_fxt_options *options)
+{
+	if (options->dir)
+	{
+		free(options->out_paje_path);
+		free(options->dag_path);
+		free(options->tasks_path);
+		free(options->comms_path);
+		free(options->number_events_path);
+		free(options->data_path);
+		free(options->papi_path);
+		free(options->anim_path);
+		free(options->states_path);
+		free(options->distrib_time_path);
+		free(options->activity_path);
+		free(options->sched_tasks_path);
+	}
 }
 
 static
@@ -4275,6 +4327,8 @@ void _starpu_fxt_distrib_file_init(struct starpu_fxt_options *options)
 	if (options->distrib_time_path)
 	{
 		distrib_time = fopen(options->distrib_time_path, "w+");
+		if (distrib_time == NULL)
+			STARPU_ABORT_MSG("Failed to open '%s' (err %s)", options->distrib_time_path, strerror(errno));
 	}
 	else
 	{
@@ -4299,7 +4353,11 @@ static
 void _starpu_fxt_activity_file_init(struct starpu_fxt_options *options)
 {
 	if (options->activity_path)
+	{
 		activity_file = fopen(options->activity_path, "w+");
+		if (activity_file == NULL)
+			STARPU_ABORT_MSG("Failed to open '%s' (err %s)", options->activity_path, strerror(errno));
+	}
 	else
 		activity_file = NULL;
 }
@@ -4308,7 +4366,11 @@ static
 void _starpu_fxt_sched_tasks_file_init(struct starpu_fxt_options *options)
 {
 	if (options->sched_tasks_path)
+	{
 		sched_tasks_file = fopen(options->sched_tasks_path, "w+");
+		if (sched_tasks_file == NULL)
+			STARPU_ABORT_MSG("Failed to open '%s' (err %s)", options->sched_tasks_path, strerror(errno));
+	}
 	else
 		sched_tasks_file = NULL;
 }
@@ -4319,6 +4381,9 @@ void _starpu_fxt_anim_file_init(struct starpu_fxt_options *options)
 	if (options->anim_path)
 	{
 		anim_file = fopen(options->anim_path, "w+");
+		if (anim_file == NULL)
+			STARPU_ABORT_MSG("Failed to open '%s' (err %s)", options->anim_path, strerror(errno));
+
 		_starpu_fxt_component_print_header(anim_file);
 	}
 	else
@@ -4329,7 +4394,11 @@ static
 void _starpu_fxt_tasks_file_init(struct starpu_fxt_options *options)
 {
 	if (options->tasks_path)
+	{
 		tasks_file = fopen(options->tasks_path, "w+");
+		if (tasks_file == NULL)
+			STARPU_ABORT_MSG("Failed to open '%s' (err %s)", options->tasks_path, strerror(errno));
+	}
 	else
 		tasks_file = NULL;
 }
@@ -4338,7 +4407,11 @@ static
 void _starpu_fxt_data_file_init(struct starpu_fxt_options *options)
 {
 	if (options->data_path)
+	{
 		data_file = fopen(options->data_path, "w+");
+		if (data_file == NULL)
+			STARPU_ABORT_MSG("Failed to open '%s' (err %s)", options->data_path, strerror(errno));
+	}
 	else
 		data_file = NULL;
 }
@@ -4347,7 +4420,11 @@ static
 void _starpu_fxt_comms_file_init(struct starpu_fxt_options *options)
 {
 	if (options->comms_path)
+	{
 		comms_file = fopen(options->comms_path, "w+");
+		if (comms_file == NULL)
+			STARPU_ABORT_MSG("Failed to open '%s' (err %s)", options->comms_path, strerror(errno));
+	}
 	else
 		comms_file = NULL;
 }
@@ -4358,6 +4435,8 @@ void _starpu_fxt_number_events_file_init(struct starpu_fxt_options *options)
 	if (options->number_events_path)
 	{
 		number_events_file = fopen(options->number_events_path, "w+");
+		if (number_events_file == NULL)
+			STARPU_ABORT_MSG("Failed to open '%s' (err %s)", options->number_events_path, strerror(errno));
 
 		/* FUT_SETUP_CODE is the event with the maximal value */
 		number_events = calloc(FUT_SETUP_CODE+1, sizeof(uint64_t));
@@ -4371,7 +4450,11 @@ void _starpu_fxt_papi_file_init(struct starpu_fxt_options *options)
 {
 #ifdef STARPU_PAPI
 	if (options->papi_path)
+	{
 		papi_file = fopen(options->papi_path, "w+");
+		if (papi_file == NULL)
+			STARPU_ABORT_MSG("Failed to open '%s' (err %s)", options->papi_path, strerror(errno));
+	}
 	else
 		papi_file = NULL;
 #endif
@@ -4395,7 +4478,11 @@ static
 void _starpu_fxt_trace_file_init(struct starpu_fxt_options *options)
 {
 	if (options->states_path)
+	{
 		trace_file = fopen(options->states_path, "w+");
+		if (trace_file == NULL)
+			STARPU_ABORT_MSG("Failed to open '%s' (err %s)", options->states_path, strerror(errno));
+	}
 	else
 		trace_file = NULL;
 
@@ -4545,8 +4632,7 @@ uint64_t _starpu_fxt_find_start_time(char *filename_in)
 	fd_in = open(filename_in, O_RDONLY);
 	if (fd_in < 0)
 	{
-	        perror("open failed :");
-	        exit(-1);
+		STARPU_ABORT_MSG("Failed to open '%s' (err %s)", filename_in, strerror(errno));
 	}
 
 	static fxt_t fut;
@@ -4576,6 +4662,7 @@ uint64_t _starpu_fxt_find_start_time(char *filename_in)
 
 void starpu_fxt_generate_trace(struct starpu_fxt_options *options)
 {
+	_starpu_fxt_options_set_dir(options);
 	_starpu_fxt_dag_init(options->dag_path);
 	_starpu_fxt_distrib_file_init(options);
 	_starpu_fxt_activity_file_init(options);
@@ -4765,8 +4852,7 @@ static void write_task(struct parse_task pt)
 		kernel->file = fopen(codelet_name, "w+");
 		if(!kernel->file)
 		{
-			perror("open failed :");
-			exit(-1);
+			STARPU_ABORT_MSG("Failed to open '%s' (err %s)", codelet_name, strerror(errno));
 		}
 		HASH_ADD_STR(kernels, name, kernel);
 		fprintf(codelet_list, "%s\n", codelet_name);
@@ -4781,8 +4867,7 @@ void starpu_fxt_write_data_trace(char *filename_in)
 	fd_in = open(filename_in, O_RDONLY);
 	if (fd_in < 0)
 	{
-	        perror("open failed :");
-	        exit(-1);
+		STARPU_ABORT_MSG("Failed to open '%s' (err %s)", filename_in, strerror(errno));
 	}
 
 	static fxt_t fut;
@@ -4796,8 +4881,7 @@ void starpu_fxt_write_data_trace(char *filename_in)
 	codelet_list = fopen("codelet_list", "w+");
 	if(!codelet_list)
 	{
-		perror("open failed :");
-		exit(-1);
+		STARPU_ABORT_MSG("Failed to open '%s' (err %s)", "codelet_list", strerror(errno));
 	}
 
 	fxt_blockev_t block;
@@ -4855,6 +4939,9 @@ void starpu_fxt_write_data_trace(char *filename_in)
 		}
 	}
 
+#ifdef HAVE_FXT_CLOSE
+	fxt_close(fut);
+#endif
 	if (close(fd_in))
 	{
 	        perror("close failed :");

+ 1 - 1
src/drivers/mic/driver_mic_source.h

@@ -34,7 +34,7 @@
 
 extern struct _starpu_node_ops _starpu_driver_mic_node_ops;
 
-/* Array of structures containing all the informations useful to send
+/** Array of structures containing all the informations useful to send
  * and receive informations with devices */
 extern struct _starpu_mp_node *_starpu_mic_nodes[STARPU_MAXMICDEVS];
 

+ 2 - 2
src/drivers/mp_common/mp_common.h

@@ -57,12 +57,12 @@ enum _starpu_mp_command
 	STARPU_MP_COMMAND_ANSWER_ALLOCATE,
 	STARPU_MP_COMMAND_ERROR_ALLOCATE,
 	STARPU_MP_COMMAND_FREE,
-        /* Synchronous send */
+        /** Synchronous send */
 	STARPU_MP_COMMAND_RECV_FROM_HOST,
 	STARPU_MP_COMMAND_SEND_TO_HOST,
 	STARPU_MP_COMMAND_RECV_FROM_SINK,
 	STARPU_MP_COMMAND_SEND_TO_SINK,
-        /* Asynchronous send */
+        /** Asynchronous send */
         STARPU_MP_COMMAND_RECV_FROM_HOST_ASYNC,
         STARPU_MP_COMMAND_RECV_FROM_HOST_ASYNC_COMPLETED,
 	STARPU_MP_COMMAND_SEND_TO_HOST_ASYNC,

+ 1 - 1
src/sched_policies/helper_mct.h

@@ -23,7 +23,7 @@ struct _starpu_mct_data
 	double beta;
 	double _gamma;
 	double idle_power;
-	starpu_pthread_mutex_t scheduling_mutex; 
+	starpu_pthread_mutex_t scheduling_mutex;
 };
 
 struct _starpu_mct_data *starpu_mct_init_parameters(struct starpu_sched_component_mct_data *params);

+ 1 - 1
src/sched_policies/prio_deque.h

@@ -27,7 +27,7 @@ struct _starpu_prio_deque
 	struct starpu_task_prio_list list;
 	unsigned ntasks;
 	unsigned nprocessed;
-	// Assumptions: 
+	// Assumptions:
 	// exp_len is the sum of predicted_length + predicted_tansfer of all tasks in list
 	// exp_start is the time at which the first task of list can start
 	// exp_end = exp_start + exp_end

+ 1 - 1
src/sched_policies/sched_component.h

@@ -23,7 +23,7 @@
 #include <starpu_sched_component.h>
 
 
-/* lock and unlock drivers for modifying schedulers */
+/** lock and unlock drivers for modifying schedulers */
 void _starpu_sched_component_lock_all_workers(void);
 void _starpu_sched_component_unlock_all_workers(void);
 

+ 5 - 5
src/util/starpu_clusters_create.h

@@ -79,7 +79,7 @@ LIST_TYPE(_starpu_cluster,
 )
 
 
-/* Machine discovery and cluster creation main funcitons */
+/** Machine discovery and cluster creation main funcitons */
 int _starpu_cluster_machine(hwloc_obj_type_t cluster_level,
 			     struct starpu_cluster_machine* machine);
 int _starpu_cluster_topology(hwloc_obj_type_t cluster_level,
@@ -88,13 +88,13 @@ void _starpu_cluster_group(hwloc_obj_type_t cluster_level,
 			   struct starpu_cluster_machine* machine);
 void _starpu_cluster(struct _starpu_cluster_group* group);
 
-/* Parameter functions */
+/** Parameter functions */
 void _starpu_cluster_init_parameters(struct _starpu_cluster_parameters* globals);
 void _starpu_cluster_copy_parameters(struct _starpu_cluster_parameters* src,
 				     struct _starpu_cluster_parameters* dst);
 int _starpu_cluster_analyze_parameters(struct _starpu_cluster_parameters* params, int npus);
 
-/* Cluster helper functions */
+/** Cluster helper functions */
 void _starpu_cluster_init(struct _starpu_cluster* cluster, struct _starpu_cluster_group* father);
 void _starpu_cluster_create(struct _starpu_cluster* cluster);
 
@@ -102,14 +102,14 @@ int _starpu_cluster_bind(struct _starpu_cluster* cluster);
 int _starpu_cluster_remove(struct _starpu_cluster_list* cluster_list,
 			   struct _starpu_cluster* cluster);
 
-/* Cluster group helper function */
+/** Cluster group helper function */
 void _starpu_cluster_group_init(struct _starpu_cluster_group* group,
 				struct starpu_cluster_machine* father);
 void _starpu_cluster_group_create(struct _starpu_cluster_group* group);
 int _starpu_cluster_group_remove(struct _starpu_cluster_group_list* group_list,
 				 struct _starpu_cluster_group* group);
 
-/* Binding helpers */
+/** Binding helpers */
 void _starpu_cluster_noop(void* buffers[], void* cl_arg)
 {
 	(void) buffers;

+ 29 - 26
starpurm/src/starpurm_private.h

@@ -17,7 +17,10 @@
 #ifndef __STARPURM_PRIVATE_H
 #define __STARPURM_PRIVATE_H
 
-enum e_state {
+/** @file */
+
+enum e_state
+{
 	state_uninitialized = 0,
 	state_init
 };
@@ -33,86 +36,86 @@ enum e_starpurm_unit_type
 
 struct s_starpurm
 {
-	/* Machine topology as detected by hwloc. */
+	/** Machine topology as detected by hwloc. */
 	hwloc_topology_t topology;
 
-	/* Current upper bound on the number of CPU cores selectable for computing with the runtime system. */
+	/** Current upper bound on the number of CPU cores selectable for computing with the runtime system. */
 	unsigned max_ncpus;
 
-	/* Number of currently selected CPU workers */
+	/** Number of currently selected CPU workers */
 	unsigned selected_ncpus;
 
-	/* Number of currently selected workers (CPU+devices) */
+	/** Number of currently selected workers (CPU+devices) */
 	unsigned selected_nworkers;
 
-	/* Initialization state of the RM instance. */
+	/** Initialization state of the RM instance. */
 	int state;
 
-	/* Boolean indicating the state of the dynamic resource sharing layer.
+	/** Boolean indicating the state of the dynamic resource sharing layer.
 	 *
 	 * !0 indicates that dynamic resource sharing is enabled.
 	 * 0 indicates that dynamic resource sharing is disabled.
 	 */
 	int dynamic_resource_sharing;
 
-	/* Id of the StarPU's sched_ctx used by the RM instance. */
+	/** Id of the StarPU's sched_ctx used by the RM instance. */
 	unsigned sched_ctx_id;
 
-	/* Number of unit types supported by this RM instance. */
+	/** Number of unit types supported by this RM instance. */
 	int unit_ntypes;
 
-	/* Number of unitss available for each type. */
+	/** Number of unitss available for each type. */
 	int *nunits_by_type;
 
-	/* Number of units. */
+	/** Number of units. */
 	int nunits;
 
-	/* Offset of unit numbering for each type. */
+	/** Offset of unit numbering for each type. */
 	int *unit_offsets_by_type;
 
-	/* Array of units. */
+	/** Array of units. */
 	struct s_starpurm_unit *units;
 
-	/* Cpuset of all the StarPU's workers (CPU+devices. */
+	/** Cpuset of all the StarPU's workers (CPU+devices. */
 	hwloc_cpuset_t global_cpuset;
 
-	/* Cpuset of all StarPU CPU workers. */
+	/** Cpuset of all StarPU CPU workers. */
 	hwloc_cpuset_t all_cpu_workers_cpuset;
 
-	/* Cpuset of all StarPU OpenCL workers. */
+	/** Cpuset of all StarPU OpenCL workers. */
 	hwloc_cpuset_t all_opencl_device_workers_cpuset;
 
-	/* Cpuset of all StarPU CUDA workers. */
+	/** Cpuset of all StarPU CUDA workers. */
 	hwloc_cpuset_t all_cuda_device_workers_cpuset;
 
-	/* Cpuset of all StarPU MIC workers. */
+	/** Cpuset of all StarPU MIC workers. */
 	hwloc_cpuset_t all_mic_device_workers_cpuset;
 
-	/* Cpuset of all StarPU device workers. */
+	/** Cpuset of all StarPU device workers. */
 	hwloc_cpuset_t all_device_workers_cpuset;
 
-	/* Cpuset of all selected workers (CPU+devices). */
+	/** Cpuset of all selected workers (CPU+devices). */
 	hwloc_cpuset_t selected_cpuset;
 
-	/* Cpuset mask of initially owned cpuset or full if not used. */
+	/** Cpuset mask of initially owned cpuset or full if not used. */
 	hwloc_cpuset_t initially_owned_cpuset_mask;
 
-	/* maximum value among worker ids */
+	/** maximum value among worker ids */
 	int max_worker_id;
 
-	/* worker id to unit id table */
+	/** worker id to unit id table */
 	int *worker_unit_ids;
 
-	/* Temporary contexts accounting. */
+	/** Temporary contexts accounting. */
 	unsigned int max_temporary_ctxs;
 	unsigned int avail_temporary_ctxs;
 	pthread_mutex_t temporary_ctxs_mutex;
 	pthread_cond_t temporary_ctxs_cond;
 
-	/* Global StarPU pause state */
+	/** Global StarPU pause state */
 	int starpu_in_pause;
 
-	/* Event list. */
+	/** Event list. */
 	pthread_t event_thread;
 	pthread_mutex_t event_list_mutex;
 	pthread_cond_t event_list_cond;

+ 1 - 2
tests/errorcheck/workers_cpuid.c

@@ -22,7 +22,7 @@
  * expected binding does happen
  */
 
-#if !defined(STARPU_USE_CPU) || !defined(STARPU_HAVE_HWLOC)
+#if !defined(STARPU_USE_CPU) || !defined(STARPU_HAVE_HWLOC) || !defined(STARPU_HAVE_SETENV)
 #warning no cpu are available. Skipping test
 int main(void)
 {
@@ -130,7 +130,6 @@ static long * generate_arrangement(int arr_size, long *set, int set_size)
 	int i;
 
 	STARPU_ASSERT(arr_size <= set_size);
-	srandom(time(0));
 
 	for (i=0; i<arr_size; i++)
 	{

+ 8 - 5
tools/gdbinit

@@ -390,6 +390,9 @@ define starpu-print-data
   printf "Current mode "
   starpu-print-mode $data->current_mode
   printf "\n"
+  if $data->mpi_data
+    printf "TAG %ld\n",((struct _starpu_mpi_data *) ($data->mpi_data))->node_tag.data_tag
+  end
   if $data->current_mode & (4|8)
     set $n = 0
     while $n < _starpu_config.topology.nworkers
@@ -449,7 +452,7 @@ define starpu-print-data
     set $tasklist = $tasklist->next
   end
   printf "Requester tasks\n"
-  set $requesterlist = $data->req_list._head
+  set $requesterlist = $data->req_list.list._head
   while $requesterlist != 0x0
     printf "mode: "
     starpu-print-mode $requesterlist->mode
@@ -458,7 +461,7 @@ define starpu-print-data
     set $requesterlist = $requesterlist->_next
   end
   printf "Arbitered requester tasks\n"
-  set $requesterlist = $data->arbitered_req_list._head
+  set $requesterlist = $data->arbitered_req_list.list._head
   while $requesterlist != 0x0
     printf "mode: "
     starpu-print-mode $requesterlist->mode
@@ -959,7 +962,7 @@ end
 
 define starpu-mpi-print-request
     set $request = (struct _starpu_mpi_req *)$arg0
-    printf "Request (struct _starpu_mpi_req *) %p data %p tag %d to MPI node %d type ", $request, $request->data_handle, $request->data_handle && $request->data_handle->mpi_data ? ((struct _starpu_mpi_node_tag *) ($request->data_handle->mpi_data))->data_tag : -1, $request->node_tag.node.rank,
+    printf "Request (struct _starpu_mpi_req *) %p data %p tag %ld to MPI node %d type ", $request, $request->data_handle, $request->data_handle && $request->data_handle->mpi_data ? ((struct _starpu_mpi_data *) ($request->data_handle->mpi_data))->node_tag.data_tag : -1, $request->node_tag.node.rank,
     if $request->request_type == SEND_REQ
        printf "SEND_REQ"
     end
@@ -999,7 +1002,7 @@ end
 
 define starpu-mpi-print-requests-list
   set $list = $arg0
-  set $request = $list->_head
+  set $request = $list._head
   while $request
     starpu-mpi-print-request $request
     set $request = $request->_next
@@ -1019,7 +1022,7 @@ define starpu-mpi-print-ready-send-requests
   set $prio_list = (struct _starpu_mpi_req_prio_list) ready_send_requests
   if _starpu_debug
     if $prio_list
-        starpu-mpi-print-requests-list &$prio_list.list
+        starpu-mpi-print-requests-list $prio_list.list
     else
 	printf "No ready send requests\n"
     end

+ 12 - 1
tools/starpu_fxt_tool.c

@@ -32,7 +32,8 @@ static void usage()
 	fprintf(stderr, "   -i <input file[s]>  specify the input file[s]. Several files can be provided,\n");
 	fprintf(stderr, "                       or the option specified several times for MPI execution\n");
 	fprintf(stderr, "                       case\n");
-        fprintf(stderr, "   -o <output file>    specify the output file\n");
+        fprintf(stderr, "   -o <output file>    specify the paje output filename\n");
+	fprintf(stderr, "   -d <directory>      specify the directory in which to save files\n");
         fprintf(stderr, "   -c                  use a different colour for every type of task\n");
 	fprintf(stderr, "   -no-events          do not show events\n");
 	fprintf(stderr, "   -no-counter         do not show scheduler counters\n");
@@ -77,6 +78,13 @@ static int parse_args(int argc, char **argv)
 			continue;
 		}
 
+		if (strcmp(argv[i], "-d") == 0)
+		{
+			options.dir = argv[++i];
+			reading_input_filenames = 0;
+			continue;
+		}
+
 		if (strcmp(argv[i], "-i") == 0)
 		{
 			if (options.ninputfiles >= STARPU_FXT_MAX_FILES)
@@ -193,6 +201,7 @@ static int parse_args(int argc, char **argv)
                 usage();
 		return 77;
 	}
+
 	return 0;
 }
 
@@ -203,5 +212,7 @@ int main(int argc, char **argv)
 
 	starpu_fxt_generate_trace(&options);
 
+	starpu_fxt_options_shutdown(&options);
+
 	return 0;
 }