瀏覽代碼

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

Samuel Thibault 5 年之前
父節點
當前提交
6e9dda9e13
共有 5 個文件被更改,包括 48 次插入0 次删除
  1. 2 0
      configure.ac
  2. 8 0
      include/starpu.h
  3. 22 0
      src/common/fxt.c
  4. 8 0
      src/common/fxt.h
  5. 8 0
      src/core/workers.c

+ 2 - 0
configure.ac

@@ -2135,12 +2135,14 @@ if test x$use_fxt = xyes; then
 	LDFLAGS="$LDFLAGS $FXT_LDFLAGS"
    	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"
 	save_CFLAGS="$CFLAGS"
 	CFLAGS="$CFLAGS $FXT_CFLAGS"
 	AC_CHECK_DECLS([enable_fut_flush], [], [], [[#include <fut.h>]])
 	AC_CHECK_DECLS([fut_set_filename], [], [], [[#include <fut.h>]])
+	AC_CHECK_DECLS([fut_setup_flush_callback], [], [], [[#include <fut.h>]])
 	CFLAGS="$save_CFLAGS"
 
 	if test x$enable_simgrid = xyes -a x$enable_shared = xno ; then

+ 8 - 0
include/starpu.h

@@ -406,7 +406,15 @@ struct starpu_conf
 	   to specify a bigger value to avoid any flushing (which
 	   would disturb the trace).
 	*/
+#ifdef HAVE_FUT_SETUP_FLUSH_CALLBACK
+	/**
+	   Support for buffer size > 2 GB was added in FxT at the same
+	   time than fut_setup_flush_callback()
+	*/
+	uint64_t trace_buffer_size;
+#else
 	unsigned trace_buffer_size;
+#endif
 	int global_sched_ctx_min_priority;
 	int global_sched_ctx_max_priority;
 

+ 22 - 0
src/common/fxt.c

@@ -146,7 +146,25 @@ int starpu_fxt_is_enabled()
 	return starpu_get_env_number_default("STARPU_FXT_TRACE", 1);
 }
 
+#ifdef HAVE_FUT_SETUP_FLUSH_CALLBACK
+void _starpu_fxt_flush_callback()
+{
+	_STARPU_MSG("FxT is flushing trace to disk ! This can impact performance.\n");
+	_STARPU_MSG("Maybe you should increase the value of STARPU_TRACE_BUFFER_SIZE ?\n");
+
+	starpu_fxt_trace_user_event_string("fxt flush");
+}
+#endif
+
+#ifdef HAVE_FUT_SETUP_FLUSH_CALLBACK
+/**
+ * Support for buffer size > 2 GB was added in FxT at the same
+ * time than fut_setup_flush_callback()
+ */
+void _starpu_fxt_init_profiling(uint64_t trace_buffer_size)
+#else
 void _starpu_fxt_init_profiling(unsigned trace_buffer_size)
+#endif
 {
 	unsigned threadid;
 
@@ -178,7 +196,11 @@ void _starpu_fxt_init_profiling(unsigned trace_buffer_size)
 
 	threadid = _starpu_gettid();
 
+#ifdef HAVE_FUT_SETUP_FLUSH_CALLBACK
+	if (fut_setup_flush_callback(trace_buffer_size / sizeof(unsigned long), initial_key_mask, threadid, &_starpu_fxt_flush_callback) < 0)
+#else
 	if (fut_setup(trace_buffer_size / sizeof(unsigned long), initial_key_mask, threadid) < 0)
+#endif
 	{
 		perror("fut_setup");
 		STARPU_ABORT();

+ 8 - 0
src/common/fxt.h

@@ -313,7 +313,15 @@ static inline unsigned long _starpu_fxt_get_submit_order(void)
 long _starpu_gettid(void);
 
 /* Initialize the FxT library. */
+#ifdef HAVE_FUT_SETUP_FLUSH_CALLBACK
+/**
+ * Support for buffer size > 2 GB was added in FxT at the same
+ * time than fut_setup_flush_callback()
+ */
+void _starpu_fxt_init_profiling(uint64_t trace_buffer_size);
+#else
 void _starpu_fxt_init_profiling(unsigned trace_buffer_size);
+#endif
 
 /* Stop the FxT library, and generate the trace file. */
 void _starpu_stop_fxt_profiling(void);

+ 8 - 0
src/core/workers.c

@@ -1142,7 +1142,15 @@ int starpu_conf_init(struct starpu_conf *conf)
 #endif
 
 	/* 64MiB by default */
+#ifdef HAVE_FUT_SETUP_FLUSH_CALLBACK
+	/**
+	* Support for buffer size > 2 GB was added in FxT at the same
+	* time than fut_setup_flush_callback()
+	*/
+	conf->trace_buffer_size = ((uint64_t) starpu_get_env_number_default("STARPU_TRACE_BUFFER_SIZE", 64)) << 20;
+#else
 	conf->trace_buffer_size = starpu_get_env_number_default("STARPU_TRACE_BUFFER_SIZE", 64) << 20;
+#endif
 
 	/* Do not start performance counter collection by default */
 	conf->start_perf_counter_collection = 0;