Browse Source

Don't bother initializing data to zeros when it is already zeroed

Notably avoid calling pthread_mutex/cond/rwlock_init
Samuel Thibault 5 years ago
parent
commit
385fa6ad24

+ 6 - 0
configure.ac

@@ -829,6 +829,12 @@ if test x$have_pthread_setname_np = xyes; then
 	AC_DEFINE(STARPU_HAVE_PTHREAD_SETNAME_NP,[1],[pthread_setname_np is available])
 fi
 
+if test "x$cross_compiling" = "xno"; then
+	STARPU_INIT_ZERO([[#include <pthread.h>]], pthread_mutex_t, PTHREAD_MUTEX_INITIALIZER)
+	STARPU_INIT_ZERO([[#include <pthread.h>]], pthread_cond_t, PTHREAD_COND_INITIALIZER)
+	STARPU_INIT_ZERO([[#include <pthread.h>]], pthread_rwlock_t, PTHREAD_RWLOCK_INITIALIZER)
+fi
+
 # There is no posix_memalign on Mac OS X, only memalign
 AC_CHECK_FUNCS([posix_memalign], [AC_DEFINE([STARPU_HAVE_POSIX_MEMALIGN], [1], [Define to 1 if you have the `posix_memalign' function.])])
 AC_CHECK_FUNCS([memalign], [AC_DEFINE([STARPU_HAVE_MEMALIGN], [1], [Define to 1 if you have the `memalign' function.])])

+ 22 - 1
doc/doxygen/chapters/api/threads.doxy

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2017, 2019                          CNRS
- * Copyright (C) 2009-2011,2014,2016                      Université de Bordeaux
+ * Copyright (C) 2009-2011,2014,2016,2020                 Université de Bordeaux
  * Copyright (C) 2011,2012                                Inria
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -35,6 +35,13 @@ Call starpu_pthread_create() and abort on error.
 \ingroup API_Threads
 Call starpu_pthread_mutex_init() and abort on error.
 
+\def STARPU_PTHREAD_MUTEX_INIT0
+\ingroup API_Threads
+Call starpu_pthread_mutex_init() only if the content of
+PTHREAD_MUTEX_INITIALIZER is not zero. This should be called instead
+of STARPU_PTHREAD_MUTEX_INIT when it is known that the content of the
+pthread_mutex_t was already zeroed.
+
 \def STARPU_PTHREAD_MUTEX_DESTROY
 \ingroup API_Threads
 Call starpu_pthread_mutex_destroy() and abort on error.
@@ -67,6 +74,13 @@ Call starpu_pthread_getspecific() and abort on error.
 \ingroup API_Threads
 Call starpu_pthread_rwlock_init() and abort on error.
 
+\def STARPU_PTHREAD_RWLOCK_INIT0
+\ingroup API_Threads
+Call starpu_pthread_rwlock_init() only if the content of
+PTHREAD_RWLOCK_INITIALIZER is not zero. This should be called instead
+of STARPU_PTHREAD_RWLOCK_INIT when it is known that the content of the
+pthread_rwlock_t was already zeroed.
+
 \def STARPU_PTHREAD_RWLOCK_RDLOCK
 \ingroup API_Threads
 Call starpu_pthread_rwlock_rdlock() and abort on error.
@@ -87,6 +101,13 @@ Call starpu_pthread_rwlock_destroy() and abort on error.
 \ingroup API_Threads
 Call starpu_pthread_cond_init() and abort on error.
 
+\def STARPU_PTHREAD_COND_INIT0
+\ingroup API_Threads
+Call starpu_pthread_cond_init() only if the content of
+PTHREAD_COND_INITIALIZER is not zero. This should be called instead
+of STARPU_PTHREAD_COND_INIT when it is known that the content of the
+pthread_cond_t was already zeroed.
+
 \def STARPU_PTHREAD_COND_DESTROY
 \ingroup API_Threads
 Call starpu_pthread_cond_destroy() and abort on error.

+ 3 - 0
include/starpu_config.h.in

@@ -165,6 +165,9 @@ typedef ssize_t starpu_ssize_t;
 #undef STARPU_HAVE_PTHREAD_BARRIER
 #undef STARPU_HAVE_PTHREAD_SETNAME_NP
 #undef STARPU_HAVE_STRUCT_TIMESPEC
+#undef STARPU_PTHREAD_MUTEX_INITIALIZER_ZERO
+#undef STARPU_PTHREAD_COND_INITIALIZER_ZERO
+#undef STARPU_PTHREAD_RWLOCK_INITIALIZER_ZERO
 
 /* This is only for building examples */
 #undef STARPU_HAVE_HELGRIND_H

+ 53 - 5
include/starpu_thread_util.h

@@ -1,8 +1,8 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2012,2013                                Inria
- * Copyright (C) 2010-2013,2015,2017,2019                      CNRS
- * Copyright (C) 2010-2014,2016,2017                      Université de Bordeaux
+ * Copyright (C) 2010-2013,2015,2017,2019                 CNRS
+ * Copyright (C) 2010-2014,2016,2017,2020                 Université de Bordeaux
  *
  * 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
@@ -64,7 +64,7 @@
  * Encapsulation of the starpu_pthread_mutex_* functions.
  */
 
-#define STARPU_PTHREAD_MUTEX_INIT(mutex, attr) do {                           \
+#define _STARPU_PTHREAD_MUTEX_INIT(mutex, attr) do {                           \
 	int p_ret = starpu_pthread_mutex_init((mutex), (attr));                \
 	if (STARPU_UNLIKELY(p_ret)) {                                          \
 		fprintf(stderr,                                                \
@@ -74,6 +74,22 @@
 	}                                                                      \
 } while (0)
 
+#ifdef STARPU_PTHREAD_MUTEX_INITIALIZER_ZERO
+#define STARPU_PTHREAD_MUTEX_INIT(mutex, attr) do {                            \
+	if (!attr)                                                             \
+		memset(mutex, 0, sizeof(*mutex));                              \
+	else                                                                   \
+		_STARPU_PTHREAD_MUTEX_INIT(mutex, attr);                       \
+} while (0)
+#define STARPU_PTHREAD_MUTEX_INIT0(mutex, attr) do {                           \
+	if (attr)                                                              \
+		_STARPU_PTHREAD_MUTEX_INIT(mutex, attr);                       \
+} while (0)
+#else
+#define STARPU_PTHREAD_MUTEX_INIT(mutex, attr) _STARPU_PTHREAD_MUTEX_INIT(mutex, attr)
+#define STARPU_PTHREAD_MUTEX_INIT0(mutex, attr) _STARPU_PTHREAD_MUTEX_INIT(mutex, attr)
+#endif
+
 #define STARPU_PTHREAD_MUTEX_DESTROY(mutex) do {                              \
 	int p_ret = starpu_pthread_mutex_destroy(mutex);                       \
 	if (STARPU_UNLIKELY(p_ret)) {                                          \
@@ -199,7 +215,7 @@ int _starpu_pthread_mutex_trylock_sched(starpu_pthread_mutex_t *mutex, char *fil
 /*
  * Encapsulation of the starpu_pthread_rwlock_* functions.
  */
-#define STARPU_PTHREAD_RWLOCK_INIT(rwlock, attr) do {                          \
+#define _STARPU_PTHREAD_RWLOCK_INIT(rwlock, attr) do {                         \
 	int p_ret = starpu_pthread_rwlock_init((rwlock), (attr));              \
 	if (STARPU_UNLIKELY(p_ret)) {                                          \
 		fprintf(stderr,                                                \
@@ -209,6 +225,22 @@ int _starpu_pthread_mutex_trylock_sched(starpu_pthread_mutex_t *mutex, char *fil
 	}                                                                      \
 } while (0)
 
+#ifdef STARPU_PTHREAD_RWLOCK_INITIALIZER_ZERO
+#define STARPU_PTHREAD_RWLOCK_INIT(rwlock, attr) do {                            \
+	if (!attr)                                                             \
+		memset(rwlock, 0, sizeof(*rwlock));                              \
+	else                                                                   \
+		_STARPU_PTHREAD_RWLOCK_INIT(rwlock, attr);                       \
+} while (0)
+#define STARPU_PTHREAD_RWLOCK_INIT0(rwlock, attr) do {                           \
+	if (attr)                                                              \
+		_STARPU_PTHREAD_RWLOCK_INIT(rwlock, attr);                       \
+} while (0)
+#else
+#define STARPU_PTHREAD_RWLOCK_INIT(rwlock, attr) _STARPU_PTHREAD_RWLOCK_INIT(rwlock, attr)
+#define STARPU_PTHREAD_RWLOCK_INIT0(rwlock, attr) _STARPU_PTHREAD_RWLOCK_INIT(rwlock, attr)
+#endif
+
 #define STARPU_PTHREAD_RWLOCK_RDLOCK(rwlock) do {                              \
 	int p_ret = starpu_pthread_rwlock_rdlock(rwlock);                      \
 	if (STARPU_UNLIKELY(p_ret)) {                                          \
@@ -282,7 +314,7 @@ int _starpu_pthread_rwlock_trywrlock(starpu_pthread_rwlock_t *rwlock, char *file
 /*
  * Encapsulation of the starpu_pthread_cond_* functions.
  */
-#define STARPU_PTHREAD_COND_INIT(cond, attr) do {                             \
+#define _STARPU_PTHREAD_COND_INIT(cond, attr) do {                             \
 	int p_ret = starpu_pthread_cond_init((cond), (attr));                  \
 	if (STARPU_UNLIKELY(p_ret)) {                                          \
 		fprintf(stderr,                                                \
@@ -292,6 +324,22 @@ int _starpu_pthread_rwlock_trywrlock(starpu_pthread_rwlock_t *rwlock, char *file
 	}                                                                      \
 } while (0)
 
+#ifdef STARPU_PTHREAD_COND_INITIALIZER_ZERO
+#define STARPU_PTHREAD_COND_INIT(cond, attr) do {                            \
+	if (!attr)                                                             \
+		memset(cond, 0, sizeof(*cond));                              \
+	else                                                                   \
+		_STARPU_PTHREAD_COND_INIT(cond, attr);                       \
+} while (0)
+#define STARPU_PTHREAD_COND_INIT0(cond, attr) do {                           \
+	if (attr)                                                              \
+		_STARPU_PTHREAD_COND_INIT(cond, attr);                       \
+} while (0)
+#else
+#define STARPU_PTHREAD_COND_INIT(cond, attr) _STARPU_PTHREAD_COND_INIT(cond, attr)
+#define STARPU_PTHREAD_COND_INIT0(cond, attr) _STARPU_PTHREAD_COND_INIT(cond, attr)
+#endif
+
 #define STARPU_PTHREAD_COND_DESTROY(cond) do {                                \
 	int p_ret = starpu_pthread_cond_destroy(cond);                         \
 	if (STARPU_UNLIKELY(p_ret)) {                                          \

+ 21 - 1
m4/libs.m4

@@ -2,7 +2,7 @@
 #
 # Copyright (C) 2011                                     Inria
 # Copyright (C) 2012,2017                                CNRS
-# Copyright (C) 2011,2014                                Université de Bordeaux
+# Copyright (C) 2011,2014,2020                           Université de Bordeaux
 #
 # 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
@@ -53,3 +53,23 @@ AC_DEFUN([STARPU_CHECK_LIB], [dnl
 AC_DEFUN([STARPU_HAVE_LIBRARY], [dnl
 STARPU_CHECK_LIB([$1], [$2], main, [$3], [$4], [$5])
 ])dnl
+
+# STARPU_INIT_ZERO(INCLUDES, TYPE, INIT_MACRO)
+# Checks whether when TYPE is initialized with INIT_MACRO, the content is just
+# plain zeroes
+AC_DEFUN([STARPU_INIT_ZERO], [dnl
+AC_MSG_CHECKING(whether $3 just zeroes)
+AC_RUN_IFELSE([AC_LANG_PROGRAM(
+		$1,
+		[[$2 var = $3;
+		 char *p;
+		 for (p = (char*) &var; p < (char*) (&var+1); p++)
+		   if (*p != 0)
+		     return 1;
+		 return 0;
+		]],
+		)],
+		[AC_DEFINE([STARPU_$3_ZERO], [1], [Define to 1 if `$3' is just zeroes])
+		 AC_MSG_RESULT(yes)],
+		[AC_MSG_RESULT(no)])
+])dnl

+ 8 - 8
mpi/src/mpi/starpu_mpi_mpi_backend.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2017                                     Inria
  * Copyright (C) 2010-2015,2017,2018,2019                 CNRS
- * Copyright (C) 2009-2014,2017,2018-2019                 Université de Bordeaux
+ * Copyright (C) 2009-2014,2017,2018-2020                 Université de Bordeaux
  *
  * 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
@@ -51,21 +51,21 @@ void _starpu_mpi_mpi_backend_request_init(struct _starpu_mpi_req *req)
 {
 	_STARPU_MPI_CALLOC(req->backend, 1, sizeof(struct _starpu_mpi_req_backend));
 
-	req->backend->data_request = 0;
+	//req->backend->data_request = 0;
 
 	STARPU_PTHREAD_MUTEX_INIT(&req->backend->req_mutex, NULL);
 	STARPU_PTHREAD_COND_INIT(&req->backend->req_cond, NULL);
 	STARPU_PTHREAD_MUTEX_INIT(&req->backend->posted_mutex, NULL);
 	STARPU_PTHREAD_COND_INIT(&req->backend->posted_cond, NULL);
 
-	req->backend->other_request = NULL;
+	//req->backend->other_request = NULL;
 
-	req->backend->size_req = 0;
-	req->backend->internal_req = NULL;
-	req->backend->is_internal_req = 0;
+	//req->backend->size_req = 0;
+	//req->backend->internal_req = NULL;
+	//req->backend->is_internal_req = 0;
 	req->backend->to_destroy = 1;
-	req->backend->early_data_handle = NULL;
-	req->backend->envelope = NULL;
+	//req->backend->early_data_handle = NULL;
+	//req->backend->envelope = NULL;
 }
 
 void _starpu_mpi_mpi_backend_request_fill(struct _starpu_mpi_req *req, MPI_Comm comm, int is_internal_req)

+ 17 - 17
mpi/src/starpu_mpi_req.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2019                                CNRS
- * Copyright (C) 2009-2019                                Université de Bordeaux
+ * Copyright (C) 2009-2020                                Université de Bordeaux
  * Copyright (C) 2012,2013,2016,2017                      Inria
  * Copyright (C) 2017                                     Guillaume Beauchamp
  *
@@ -25,37 +25,37 @@ void _starpu_mpi_request_init(struct _starpu_mpi_req **req)
 	_STARPU_MPI_CALLOC(*req, 1, sizeof(struct _starpu_mpi_req));
 
 	/* Initialize the request structure */
-	(*req)->data_handle = NULL;
-	(*req)->prio = 0;
+	//(*req)->data_handle = NULL;
+	//(*req)->prio = 0;
 
-	(*req)->datatype = 0;
-	(*req)->datatype_name = NULL;
-	(*req)->ptr = NULL;
+	//(*req)->datatype = 0;
+	//(*req)->datatype_name = NULL;
+	//(*req)->ptr = NULL;
 	(*req)->count = -1;
 	(*req)->registered_datatype = -1;
 
 	(*req)->node_tag.node.rank = -1;
 	(*req)->node_tag.data_tag = -1;
-	(*req)->node_tag.node.comm = 0;
+	//(*req)->node_tag.node.comm = 0;
 
-	(*req)->func = NULL;
+	//(*req)->func = NULL;
 
-	(*req)->status = NULL;
-	(*req)->flag = NULL;
+	//(*req)->status = NULL;
+	//(*req)->flag = NULL;
 	_starpu_mpi_req_multilist_init_coop_sends(*req);
 
 	(*req)->ret = -1;
 
 	(*req)->request_type = UNKNOWN_REQ;
 
-	(*req)->submitted = 0;
-	(*req)->completed = 0;
-	(*req)->posted = 0;
+	//(*req)->submitted = 0;
+	//(*req)->completed = 0;
+	//(*req)->posted = 0;
 
-	(*req)->sync = 0;
+	//(*req)->sync = 0;
 	(*req)->detached = -1;
-	(*req)->callback = NULL;
-	(*req)->callback_arg = NULL;
+	//(*req)->callback = NULL;
+	//(*req)->callback_arg = NULL;
 
 	(*req)->sequential_consistency = 1;
 	(*req)->pre_sync_jobid = -1;
@@ -64,7 +64,7 @@ void _starpu_mpi_request_init(struct _starpu_mpi_req **req)
 #ifdef STARPU_SIMGRID
 	starpu_pthread_queue_init(&((*req)->queue));
 	starpu_pthread_queue_register(&_starpu_mpi_thread_wait, &((*req)->queue));
-	(*req)->done = 0;
+	//(*req)->done = 0;
 #endif
 	_mpi_backend._starpu_mpi_backend_request_init(*req);
 }

+ 2 - 2
src/common/graph.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2016,2017                                CNRS
  * Copyright (C) 2017                                     Inria
- * Copyright (C) 2016-2018                                Université de Bordeaux
+ * Copyright (C) 2016-2018,2020                           Université de Bordeaux
  *
  * 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
@@ -140,7 +140,7 @@ void _starpu_graph_add_job(struct _starpu_job *job)
 	_STARPU_CALLOC(node, 1, sizeof(*node));
 	node->job = job;
 	job->graph_node = node;
-	STARPU_PTHREAD_MUTEX_INIT(&node->mutex, NULL);
+	STARPU_PTHREAD_MUTEX_INIT0(&node->mutex, NULL);
 
 	_starpu_graph_wrlock();
 

+ 7 - 2
src/common/list.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2008-2018                                Université de Bordeaux
+ * Copyright (C) 2008-2018,2020                           Université de Bordeaux
  * Copyright (C) 2010-2012,2015-2018                      CNRS
  * Copyright (C) 2017                                     Inria
  * Copyright (C) 2013                                     Thibaut Lambert
@@ -51,6 +51,9 @@
  *   * Initializes a list (initially empty)
  *   void		FOO_list_init(struct FOO_list*);
  *
+ *   * Initializes a list (initially empty), assuming that the content of FOO_list was already zeroed
+ *   void		FOO_list_init0(struct FOO_list*);
+ *
  *   * Suppresses a liste
  *   void		FOO_list_delete(struct FOO_list*);
  *
@@ -225,7 +228,9 @@
   /** @internal */LIST_INLINE struct ENAME *ENAME##_list_back(const struct ENAME##_list *l) \
     { return l->_tail; } \
   /** @internal */LIST_INLINE void ENAME##_list_init(struct ENAME##_list *l) \
-    { l->_head=NULL; l->_tail=l->_head; } \
+    { l->_head=NULL; l->_tail=NULL; } \
+  /** @internal */LIST_INLINE void ENAME##_list_init0(struct ENAME##_list *l STARPU_ATTRIBUTE_UNUSED) \
+    { } \
   /** @internal */LIST_INLINE struct ENAME##_list *ENAME##_list_new(void) \
     { struct ENAME##_list *l; _STARPU_MALLOC(l, sizeof(struct ENAME##_list)); \
       ENAME##_list_init(l); return l; } \

+ 14 - 4
src/common/prio_list.h

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2017,2018                                Inria
  * Copyright (C) 2016,2017                                CNRS
- * Copyright (C) 2015-2017,2019                           Université de Bordeaux
+ * Copyright (C) 2015-2017,2019-2020                      Université de Bordeaux
  *
  * 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
@@ -37,6 +37,9 @@
  * * Initialize a new priority list
  * void FOO_prio_list_init(struct FOO_prio_list*)
  *
+ * * Initialize a new priority list, assuming that the content of FOO_prio_list was already zeroed
+ * void FOO_prio_list_init0(struct FOO_prio_list*)
+ *
  * * Free an empty priority list
  * void FOO_prio_list_deinit(struct FOO_prio_list*)
  *
@@ -152,6 +155,11 @@
 		starpu_rbtree_init(&priolist->tree); \
 		priolist->empty = 1; \
 	} \
+	PRIO_LIST_INLINE void ENAME##_prio_list_init0(struct ENAME##_prio_list *priolist) \
+	{ \
+		starpu_rbtree_init0(&priolist->tree); \
+		priolist->empty = 1; \
+	} \
 	PRIO_LIST_INLINE void ENAME##_prio_list_deinit(struct ENAME##_prio_list *priolist) \
 	{ \
 		if (starpu_rbtree_empty(&priolist->tree)) \
@@ -183,10 +191,10 @@
 		if (node) \
 			stage = ENAME##_node_to_list_stage(node); \
 		else { \
-			_STARPU_MALLOC(stage, sizeof(*stage));	\
-			starpu_rbtree_node_init(&stage->node); \
+			_STARPU_CALLOC(stage, 1, sizeof(*stage));	\
+			starpu_rbtree_node_init0(&stage->node); \
 			stage->prio = prio; \
-			ENAME##_list_init(&stage->list); \
+			ENAME##_list_init0(&stage->list); \
 			starpu_rbtree_insert_slot(&priolist->tree, slot, &stage->node); \
 		} \
 		return stage; \
@@ -469,6 +477,8 @@
 	struct ENAME##_prio_list { struct ENAME##_list list; }; \
 	PRIO_LIST_INLINE void ENAME##_prio_list_init(struct ENAME##_prio_list *priolist) \
 	{ ENAME##_list_init(&(priolist)->list); } \
+	PRIO_LIST_INLINE void ENAME##_prio_list_init0(struct ENAME##_prio_list *priolist) \
+	{ ENAME##_list_init0(&(priolist)->list); } \
 	PRIO_LIST_INLINE void ENAME##_prio_list_deinit(struct ENAME##_prio_list *priolist) \
 	{ (void) (priolist); /* ENAME##_list_deinit(&(priolist)->list); */ } \
 	PRIO_LIST_INLINE void ENAME##_prio_list_push_back(struct ENAME##_prio_list *priolist, struct ENAME *e) \

+ 21 - 0
src/common/rbtree.h

@@ -34,6 +34,8 @@
 #include <stdint.h>
 #include <sys/types.h>
 
+#include <starpu_util.h>
+
 #define MACRO_BEGIN ({
 #define MACRO_END })
 /*
@@ -68,6 +70,13 @@ static inline void starpu_rbtree_init(struct starpu_rbtree *tree)
 }
 
 /*
+ * This version assumes that the content of tree was already zeroed
+ */
+static inline void starpu_rbtree_init0(struct starpu_rbtree *tree STARPU_ATTRIBUTE_UNUSED)
+{
+}
+
+/*
  * Initialize a node.
  *
  * A node is in no tree when its parent points to itself.
@@ -82,6 +91,18 @@ static inline void starpu_rbtree_node_init(struct starpu_rbtree_node *node)
 }
 
 /*
+ * This version assumes that the content of node was already zeroed
+ */
+static inline void starpu_rbtree_node_init0(struct starpu_rbtree_node *node)
+{
+    assert(starpu_rbtree_check_alignment(node));
+
+    node->parent = (uintptr_t)node | STARPU_RBTREE_COLOR_RED;
+    //node->children[STARPU_RBTREE_LEFT] = NULL;
+    //node->children[STARPU_RBTREE_RIGHT] = NULL;
+}
+
+/*
  * Return true if node is in no tree.
  */
 static inline int starpu_rbtree_node_unlinked(const struct starpu_rbtree_node *node)

+ 1 - 1
src/common/thread.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2013,2015,2017                           Inria
  * Copyright (C) 2010-2017                                CNRS
- * Copyright (C) 2010,2012-2019                           Université de Bordeaux
+ * Copyright (C) 2010,2012-2020                           Université de Bordeaux
  *
  * 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

+ 10 - 10
src/core/dependencies/cg.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2012                                     Inria
- * Copyright (C) 2010-2012,2014-2018                      Université de Bordeaux
+ * Copyright (C) 2010-2012,2014-2018,2020                 Université de Bordeaux
  * Copyright (C) 2010-2013,2015-2018                      CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -24,23 +24,23 @@
 #include <core/dependencies/cg.h>
 #include <core/dependencies/tags.h>
 
-void _starpu_cg_list_init(struct _starpu_cg_list *list)
+void _starpu_cg_list_init0(struct _starpu_cg_list *list)
 {
 	_starpu_spin_init(&list->lock);
-	list->ndeps = 0;
-	list->ndeps_completed = 0;
+	//list->ndeps = 0;
+	//list->ndeps_completed = 0;
 #ifdef STARPU_DEBUG
-	list->deps = NULL;
-	list->done = NULL;
+	//list->deps = NULL;
+	//list->done = NULL;
 #endif
 
-	list->terminated = 0;
+	//list->terminated = 0;
 
-	list->nsuccs = 0;
+	//list->nsuccs = 0;
 #ifdef STARPU_DYNAMIC_DEPS_SIZE
 	/* this is a small initial default value ... may be changed */
-	list->succ_list_size = 0;
-	list->succ = NULL;
+	//list->succ_list_size = 0;
+	//list->succ = NULL;
 #endif
 }
 

+ 2 - 2
src/core/dependencies/cg.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2018                                Université de Bordeaux
+ * Copyright (C) 2010-2018,2020                           Université de Bordeaux
  * Copyright (C) 2010,2011,2013,2015,2017                 CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -114,7 +114,7 @@ void _starpu_notify_dependencies(struct _starpu_job *j);
 void _starpu_job_notify_start(struct _starpu_job *j, struct starpu_perfmodel_arch* perf_arch);
 void _starpu_job_notify_ready_soon(struct _starpu_job *j, _starpu_notify_job_start_data *data);
 
-void _starpu_cg_list_init(struct _starpu_cg_list *list);
+void _starpu_cg_list_init0(struct _starpu_cg_list *list);
 void _starpu_cg_list_deinit(struct _starpu_cg_list *list);
 int _starpu_add_successor_to_cg_list(struct _starpu_cg_list *successors, struct _starpu_cg *cg);
 int _starpu_list_task_successors_in_cg_list(struct _starpu_cg_list *successors, unsigned ndeps, struct starpu_task *task_array[]);

+ 6 - 6
src/core/dependencies/tags.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2008-2014,2016-2018                      Université de Bordeaux
+ * Copyright (C) 2008-2014,2016-2018,2020                 Université de Bordeaux
  * Copyright (C) 2011,2012,2016                           Inria
  * Copyright (C) 2010-2013,2015-2017,2019                 CNRS
  *
@@ -76,16 +76,16 @@ static struct _starpu_cg *create_cg_tag(unsigned ntags, struct _starpu_tag *tag)
 static struct _starpu_tag *_starpu_tag_init(starpu_tag_t id)
 {
 	struct _starpu_tag *tag;
-	_STARPU_MALLOC(tag, sizeof(struct _starpu_tag));
+	_STARPU_CALLOC(tag, 1, sizeof(struct _starpu_tag));
 
-	tag->job = NULL;
-	tag->is_assigned = 0;
-	tag->is_submitted = 0;
+	//tag->job = NULL;
+	//tag->is_assigned = 0;
+	//tag->is_submitted = 0;
 
 	tag->id = id;
 	tag->state = STARPU_INVALID_STATE;
 
-	_starpu_cg_list_init(&tag->tag_successors);
+	_starpu_cg_list_init0(&tag->tag_successors);
 
 	_starpu_spin_init(&tag->lock);
 

+ 5 - 7
src/core/jobs.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2017                                Inria
- * Copyright (C) 2008-2019                                Université de Bordeaux
+ * Copyright (C) 2008-2020                                Université de Bordeaux
  * Copyright (C) 2010-2019                                CNRS
  * Copyright (C) 2013                                     Thibaut Lambert
  * Copyright (C) 2011                                     Télécom-SudParis
@@ -70,11 +70,9 @@ struct _starpu_job* STARPU_ATTRIBUTE_MALLOC _starpu_job_create(struct starpu_tas
 	struct _starpu_job *job;
         _STARPU_LOG_IN();
 
-	_STARPU_MALLOC(job, sizeof(*job));
-
 	/* As most of the fields must be initialized at NULL, let's put 0
 	 * everywhere */
-	memset(job, 0, sizeof(*job));
+	_STARPU_CALLOC(job, 1, sizeof(*job));
 
 	if (task->dyn_handles)
 	{
@@ -99,10 +97,10 @@ struct _starpu_job* STARPU_ATTRIBUTE_MALLOC _starpu_job_create(struct starpu_tas
 			maxnjobs = jobs;
 	}
 
-	_starpu_cg_list_init(&job->job_successors);
+	_starpu_cg_list_init0(&job->job_successors);
 
-	STARPU_PTHREAD_MUTEX_INIT(&job->sync_mutex, NULL);
-	STARPU_PTHREAD_COND_INIT(&job->sync_cond, NULL);
+	STARPU_PTHREAD_MUTEX_INIT0(&job->sync_mutex, NULL);
+	STARPU_PTHREAD_COND_INIT0(&job->sync_cond, NULL);
 
 	/* By default we have sequential tasks */
 	job->task_size = 1;

+ 8 - 8
src/core/perfmodel/perfmodel_history.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2014,2016,2017                      Inria
- * Copyright (C) 2008-2019                                Université de Bordeaux
+ * Copyright (C) 2008-2020                                Université de Bordeaux
  * Copyright (C) 2010-2017, 2019                          CNRS
  * Copyright (C) 2013                                     Thibaut Lambert
  * Copyright (C) 2011                                     Télécom-SudParis
@@ -582,7 +582,7 @@ static void parse_per_arch_model_file(FILE *f, const char *path, struct starpu_p
 			 * good-enough estimation */
 			STARPU_HG_DISABLE_CHECKING(entry->nsample);
 			STARPU_HG_DISABLE_CHECKING(entry->mean);
-			entry->nerror = 0;
+			//entry->nerror = 0;
 		}
 
 		scan_history_entry(f, path, entry);
@@ -1886,18 +1886,18 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 
 				/* Do not take the first measurement into account, it is very often quite bogus */
 				/* TODO: it'd be good to use a better estimation heuristic, like the median, or latest n values, etc. */
-				entry->mean = 0;
-				entry->sum = 0;
+				//entry->mean = 0;
+				//entry->sum = 0;
 
-				entry->deviation = 0.0;
-				entry->sum2 = 0;
+				//entry->deviation = 0.0;
+				//entry->sum2 = 0;
 
 				entry->size = _starpu_job_get_data_size(model, arch, impl, j);
 				entry->flops = j->task->flops;
 
 				entry->footprint = key;
-				entry->nsample = 0;
-				entry->nerror = 0;
+				//entry->nsample = 0;
+				//entry->nerror = 0;
 
 				insert_history_entry(entry, list, &per_arch_model->history);
 			}

+ 5 - 5
src/core/task_bundle.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011-2014                                Université de Bordeaux
+ * Copyright (C) 2011-2014, 2020                                Université de Bordeaux
  * Copyright (C) 2011,2012                                Inria
  * Copyright (C) 2011,2013,2015-2017                      CNRS
  * Copyright (C) 2011                                     Télécom-SudParis
@@ -29,15 +29,15 @@
 /* Initialize a task bundle */
 void starpu_task_bundle_create(starpu_task_bundle_t *bundle)
 {
-	_STARPU_MALLOC(*bundle, sizeof(struct _starpu_task_bundle));
+	_STARPU_CALLOC(*bundle, 1, sizeof(struct _starpu_task_bundle));
 
-	STARPU_PTHREAD_MUTEX_INIT(&(*bundle)->mutex, NULL);
+	STARPU_PTHREAD_MUTEX_INIT0(&(*bundle)->mutex, NULL);
 	/* Of course at the beginning a bundle is open,
 	 * user can insert and remove tasks from it */
-	(*bundle)->closed = 0;
+	//(*bundle)->closed = 0;
 
 	/* Start with an empty list */
-	(*bundle)->list = NULL;
+	//(*bundle)->list = NULL;
 
 }
 

+ 41 - 38
src/datawizard/filters.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011,2012,2016,2017                      Inria
- * Copyright (C) 2008-2019                                Université de Bordeaux
+ * Copyright (C) 2008-2020                                Université de Bordeaux
  * Copyright (C) 2010                                     Mehdi Juhoor
  * Copyright (C) 2010-2013,2015-2019                      CNRS
  * Copyright (C) 2013                                     Thibaut Lambert
@@ -228,24 +228,27 @@ static void _starpu_data_partition(starpu_data_handle_t initial_handle, starpu_d
 		else
 			ops = initial_handle->ops;
 
+		/* As most of the fields must be initialized at NULL, let's put
+		 * 0 everywhere */
+		memset(child, 0, sizeof(*child));
 		_starpu_data_handle_init(child, ops, initial_handle->mf_node);
 
-		child->nchildren = 0;
-		child->nplans = 0;
-		child->switch_cl = NULL;
-		child->partitioned = 0;
-		child->readonly = 0;
+		//child->nchildren = 0;
+		//child->nplans = 0;
+		//child->switch_cl = NULL;
+		//child->partitioned = 0;
+		//child->readonly = 0;
 		child->active = inherit_state;
-		child->active_ro = 0;
-                child->mpi_data = NULL;
+		//child->active_ro = 0;
+                //child->mpi_data = NULL;
 		child->root_handle = initial_handle->root_handle;
 		child->father_handle = initial_handle;
-		child->active_children = NULL;
-		child->active_readonly_children = NULL;
-		child->nactive_readonly_children = 0;
+		//child->active_children = NULL;
+		//child->active_readonly_children = NULL;
+		//child->nactive_readonly_children = 0;
 		child->nsiblings = nparts;
 		if (inherit_state)
-			child->siblings = NULL;
+			; //child->siblings = NULL;
 		else
 			child->siblings = childrenp;
 		child->sibling_index = i;
@@ -258,31 +261,31 @@ static void _starpu_data_partition(starpu_data_handle_t initial_handle, starpu_d
 		/* initialize the chunk lock */
 		_starpu_data_requester_prio_list_init(&child->req_list);
 		_starpu_data_requester_prio_list_init(&child->reduction_req_list);
-		child->reduction_tmp_handles = NULL;
-		child->write_invalidation_req = NULL;
-		child->refcnt = 0;
-		child->unlocking_reqs = 0;
-		child->busy_count = 0;
-		child->busy_waiting = 0;
-		STARPU_PTHREAD_MUTEX_INIT(&child->busy_mutex, NULL);
-		STARPU_PTHREAD_COND_INIT(&child->busy_cond, NULL);
-		child->reduction_refcnt = 0;
+		//child->reduction_tmp_handles = NULL;
+		//child->write_invalidation_req = NULL;
+		//child->refcnt = 0;
+		//child->unlocking_reqs = 0;
+		//child->busy_count = 0;
+		//child->busy_waiting = 0;
+		STARPU_PTHREAD_MUTEX_INIT0(&child->busy_mutex, NULL);
+		STARPU_PTHREAD_COND_INIT0(&child->busy_cond, NULL);
+		//child->reduction_refcnt = 0;
 		_starpu_spin_init(&child->header_lock);
 
 		child->sequential_consistency = initial_handle->sequential_consistency;
 		child->initialized = initial_handle->initialized;
 		child->ooc = initial_handle->ooc;
 
-		STARPU_PTHREAD_MUTEX_INIT(&child->sequential_consistency_mutex, NULL);
+		//STARPU_PTHREAD_MUTEX_INIT(&child->sequential_consistency_mutex, NULL);
 		child->last_submitted_mode = STARPU_R;
-		child->last_sync_task = NULL;
-		child->last_submitted_accessors.task = NULL;
+		//child->last_sync_task = NULL;
+		//child->last_submitted_accessors.task = NULL;
 		child->last_submitted_accessors.next = &child->last_submitted_accessors;
 		child->last_submitted_accessors.prev = &child->last_submitted_accessors;
-		child->post_sync_tasks = NULL;
+		//child->post_sync_tasks = NULL;
 		/* Tell helgrind that the race in _starpu_unlock_post_sync_tasks is fine */
 		STARPU_HG_DISABLE_CHECKING(child->post_sync_tasks_cnt);
-		child->post_sync_tasks_cnt = 0;
+		//child->post_sync_tasks_cnt = 0;
 
 		/* The methods used for reduction are propagated to the
 		 * children. */
@@ -290,17 +293,17 @@ static void _starpu_data_partition(starpu_data_handle_t initial_handle, starpu_d
 		child->init_cl = initial_handle->init_cl;
 
 #ifdef STARPU_USE_FXT
-		child->last_submitted_ghost_sync_id_is_valid = 0;
-		child->last_submitted_ghost_sync_id = 0;
-		child->last_submitted_ghost_accessors_id = NULL;
+		//child->last_submitted_ghost_sync_id_is_valid = 0;
+		//child->last_submitted_ghost_sync_id = 0;
+		//child->last_submitted_ghost_accessors_id = NULL;
 #endif
 
 		if (_starpu_global_arbiter)
 			/* Just for testing purpose */
 			starpu_data_assign_arbiter(child, _starpu_global_arbiter);
 		else
-			child->arbiter = NULL;
-		_starpu_data_requester_prio_list_init(&child->arbitered_req_list);
+			; //child->arbiter = NULL;
+		_starpu_data_requester_prio_list_init0(&child->arbitered_req_list);
 
 		for (node = 0; node < STARPU_MAXNODES; node++)
 		{
@@ -317,16 +320,16 @@ static void _starpu_data_partition(starpu_data_handle_t initial_handle, starpu_d
 			if (inherit_state || !initial_replicate->automatically_allocated)
 				child_replicate->allocated = initial_replicate->allocated;
 			else
-				child_replicate->allocated = 0;
+				; //child_replicate->allocated = 0;
 			/* Do not allow memory reclaiming within the child for parent bits */
-			child_replicate->automatically_allocated = 0;
-			child_replicate->refcnt = 0;
+			//child_replicate->automatically_allocated = 0;
+			//child_replicate->refcnt = 0;
 			child_replicate->memory_node = node;
-			child_replicate->relaxed_coherency = 0;
+			//child_replicate->relaxed_coherency = 0;
 			if (inherit_state)
 				child_replicate->initialized = initial_replicate->initialized;
 			else
-				child_replicate->initialized = 0;
+				; //child_replicate->initialized = 0;
 
 			/* update the interface */
 			void *initial_interface = starpu_data_get_interface_on_node(initial_handle, node);
@@ -336,8 +339,8 @@ static void _starpu_data_partition(starpu_data_handle_t initial_handle, starpu_d
 			f->filter_func(initial_interface, child_interface, f, i, nparts);
 		}
 
-		child->per_worker = NULL;
-		child->user_data = NULL;
+		//child->per_worker = NULL;
+		//child->user_data = NULL;
 
 		/* We compute the size and the footprint of the child once and
 		 * store it in the handle */

+ 51 - 51
src/datawizard/interfaces/data_interface.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2017                                Inria
- * Copyright (C) 2009-2019                                Université de Bordeaux
+ * Copyright (C) 2009-2020                                Université de Bordeaux
  * Copyright (C) 2010-2019                                CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -262,69 +262,69 @@ static void _starpu_register_new_data(starpu_data_handle_t handle,
 	STARPU_ASSERT(handle);
 
 	/* initialize the new lock */
-	_starpu_data_requester_prio_list_init(&handle->req_list);
-	handle->refcnt = 0;
-	handle->unlocking_reqs = 0;
-	handle->busy_count = 0;
-	handle->busy_waiting = 0;
-	STARPU_PTHREAD_MUTEX_INIT(&handle->busy_mutex, NULL);
-	STARPU_PTHREAD_COND_INIT(&handle->busy_cond, NULL);
+	_starpu_data_requester_prio_list_init0(&handle->req_list);
+	//handle->refcnt = 0;
+	//handle->unlocking_reqs = 0;
+	//handle->busy_count = 0;
+	//handle->busy_waiting = 0;
+	STARPU_PTHREAD_MUTEX_INIT0(&handle->busy_mutex, NULL);
+	STARPU_PTHREAD_COND_INIT0(&handle->busy_cond, NULL);
 	_starpu_spin_init(&handle->header_lock);
 
 	/* first take care to properly lock the data */
 	_starpu_spin_lock(&handle->header_lock);
 
 	/* there is no hierarchy yet */
-	handle->nchildren = 0;
-	handle->nplans = 0;
-	handle->switch_cl = NULL;
-	handle->partitioned = 0;
-	handle->readonly = 0;
+	//handle->nchildren = 0;
+	//handle->nplans = 0;
+	//handle->switch_cl = NULL;
+	//handle->partitioned = 0;
+	//handle->readonly = 0;
 	handle->active = 1;
-	handle->active_ro = 0;
+	//handle->active_ro = 0;
 	handle->root_handle = handle;
-	handle->father_handle = NULL;
-	handle->active_children = NULL;
-	handle->active_readonly_children = NULL;
-	handle->nactive_readonly_children = 0;
-	handle->nsiblings = 0;
-	handle->siblings = NULL;
-	handle->sibling_index = 0; /* could be anything for the root */
+	//handle->father_handle = NULL;
+	//handle->active_children = NULL;
+	//handle->active_readonly_children = NULL;
+	//handle->nactive_readonly_children = 0;
+	//handle->nsiblings = 0;
+	//handle->siblings = NULL;
+	//handle->sibling_index = 0; /* could be anything for the root */
 	handle->depth = 1; /* the tree is just a node yet */
-        handle->mpi_data = NULL; /* invalid until set */
+        //handle->mpi_data = NULL; /* invalid until set */
 
-	handle->is_not_important = 0;
+	//handle->is_not_important = 0;
 
 	handle->sequential_consistency =
 		starpu_data_get_default_sequential_consistency_flag();
 	handle->initialized = home_node != -1;
 	handle->ooc = 1;
 
-	STARPU_PTHREAD_MUTEX_INIT(&handle->sequential_consistency_mutex, NULL);
+	STARPU_PTHREAD_MUTEX_INIT0(&handle->sequential_consistency_mutex, NULL);
 	handle->last_submitted_mode = STARPU_R;
-	handle->last_sync_task = NULL;
-	handle->last_submitted_accessors.task = NULL;
+	//handle->last_sync_task = NULL;
+	//handle->last_submitted_accessors.task = NULL;
 	handle->last_submitted_accessors.next = &handle->last_submitted_accessors;
 	handle->last_submitted_accessors.prev = &handle->last_submitted_accessors;
-	handle->post_sync_tasks = NULL;
+	//handle->post_sync_tasks = NULL;
 
 	/* Tell helgrind that the race in _starpu_unlock_post_sync_tasks is fine */
 	STARPU_HG_DISABLE_CHECKING(handle->post_sync_tasks_cnt);
-	handle->post_sync_tasks_cnt = 0;
+	//handle->post_sync_tasks_cnt = 0;
 
 	/* By default, there are no methods available to perform a reduction */
-	handle->redux_cl = NULL;
-	handle->init_cl = NULL;
+	//handle->redux_cl = NULL;
+	//handle->init_cl = NULL;
 
-	handle->reduction_refcnt = 0;
-	_starpu_data_requester_prio_list_init(&handle->reduction_req_list);
-	handle->reduction_tmp_handles = NULL;
-	handle->write_invalidation_req = NULL;
+	//handle->reduction_refcnt = 0;
+	_starpu_data_requester_prio_list_init0(&handle->reduction_req_list);
+	//handle->reduction_tmp_handles = NULL;
+	//handle->write_invalidation_req = NULL;
 
 #ifdef STARPU_USE_FXT
-	handle->last_submitted_ghost_sync_id_is_valid = 0;
-	handle->last_submitted_ghost_sync_id = 0;
-	handle->last_submitted_ghost_accessors_id = NULL;
+	//handle->last_submitted_ghost_sync_id_is_valid = 0;
+	//handle->last_submitted_ghost_sync_id = 0;
+	//handle->last_submitted_ghost_accessors_id = NULL;
 #endif
 
 	handle->wt_mask = wt_mask;
@@ -339,8 +339,8 @@ static void _starpu_register_new_data(starpu_data_handle_t handle,
 		/* Just for testing purpose */
 		starpu_data_assign_arbiter(handle, _starpu_global_arbiter);
 	else
-		handle->arbiter = NULL;
-	_starpu_data_requester_prio_list_init(&handle->arbitered_req_list);
+		; //handle->arbiter = NULL;
+	_starpu_data_requester_prio_list_init0(&handle->arbitered_req_list);
 	handle->last_locality = -1;
 
 	/* that new data is invalid from all nodes perpective except for the
@@ -352,28 +352,28 @@ static void _starpu_register_new_data(starpu_data_handle_t handle,
 		replicate = &handle->per_node[node];
 
 		replicate->memory_node = node;
-		replicate->relaxed_coherency = 0;
-		replicate->refcnt = 0;
+		//replicate->relaxed_coherency = 0;
+		//replicate->refcnt = 0;
 
 		if ((int) node == home_node)
 		{
 			/* this is the home node with the only valid copy */
 			replicate->state = STARPU_OWNER;
 			replicate->allocated = 1;
-			replicate->automatically_allocated = 0;
+			//replicate->automatically_allocated = 0;
 			replicate->initialized = 1;
 		}
 		else
 		{
 			/* the value is not available here yet */
 			replicate->state = STARPU_INVALID;
-			replicate->allocated = 0;
-			replicate->initialized = 0;
+			//replicate->allocated = 0;
+			//replicate->initialized = 0;
 		}
 	}
 
-	handle->per_worker = NULL;
-	handle->user_data = NULL;
+	//handle->per_worker = NULL;
+	//handle->user_data = NULL;
 
 	/* now the data is available ! */
 	_starpu_spin_unlock(&handle->header_lock);
@@ -451,8 +451,8 @@ int _starpu_data_handle_init(starpu_data_handle_t handle, struct starpu_data_int
 	handle->magic = 42;
 	handle->ops = interface_ops;
 	handle->mf_node = mf_node;
-	handle->mpi_data = NULL;
-	handle->partition_automatic_disabled = 0;
+	//handle->mpi_data = NULL;
+	//handle->partition_automatic_disabled = 0;
 
 	size_t interfacesize = interface_ops->interface_size;
 
@@ -761,12 +761,12 @@ static void _starpu_data_unregister(starpu_data_handle_t handle, unsigned cohere
 		int home_node = handle->home_node;
 		if (home_node >= 0)
 		{
-			struct _starpu_unregister_callback_arg arg;
+			struct _starpu_unregister_callback_arg arg = { 0 };
 			arg.handle = handle;
 			arg.memory_node = (unsigned)home_node;
 			arg.terminated = 0;
-			STARPU_PTHREAD_MUTEX_INIT(&arg.mutex, NULL);
-			STARPU_PTHREAD_COND_INIT(&arg.cond, NULL);
+			STARPU_PTHREAD_MUTEX_INIT0(&arg.mutex, NULL);
+			STARPU_PTHREAD_COND_INIT0(&arg.cond, NULL);
 
 			if (!_starpu_attempt_to_submit_data_request_from_apps(handle, STARPU_R,
 					_starpu_data_unregister_fetch_data_callback, &arg))

+ 6 - 6
src/datawizard/memstats.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2012,2015-2017                      CNRS
- * Copyright (C) 2009,2010,2012,2014                      Université de Bordeaux
+ * Copyright (C) 2009,2010,2012,2014,2020                 Université de Bordeaux
  *
  * 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
@@ -31,11 +31,11 @@ void _starpu_memory_stats_init_per_node(starpu_data_handle_t handle STARPU_ATTRI
 {
 #ifdef STARPU_MEMORY_STATS
 	/* Stats initilization */
-	handle->memory_stats->direct_access[node]=0;
-	handle->memory_stats->loaded_shared[node]=0;
-	handle->memory_stats->shared_to_owner[node]=0;
-	handle->memory_stats->loaded_owner[node]=0;
-	handle->memory_stats->invalidated[node]=0;
+	//handle->memory_stats->direct_access[node]=0;
+	//handle->memory_stats->loaded_shared[node]=0;
+	//handle->memory_stats->shared_to_owner[node]=0;
+	//handle->memory_stats->loaded_owner[node]=0;
+	//handle->memory_stats->invalidated[node]=0;
 #endif
 }
 

+ 4 - 4
src/datawizard/user_interactions.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2013,2017                           Inria
- * Copyright (C) 2009-2019                                Université de Bordeaux
+ * Copyright (C) 2009-2020                                Université de Bordeaux
  * Copyright (C) 2010-2013,2015-2018                      CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -85,9 +85,9 @@ static inline void _starpu_data_acquire_wrapper_init(struct user_interaction_wra
 	wrapper->handle = handle;
 	wrapper->node = node;
 	wrapper->mode = mode;
-	wrapper->finished = 0;
-	STARPU_PTHREAD_COND_INIT(&wrapper->cond, NULL);
-	STARPU_PTHREAD_MUTEX_INIT(&wrapper->lock, NULL);
+	//wrapper->finished = 0;
+	STARPU_PTHREAD_COND_INIT0(&wrapper->cond, NULL);
+	STARPU_PTHREAD_MUTEX_INIT0(&wrapper->lock, NULL);
 }
 
 /* Called to signal completion of asynchronous data acquisition */

+ 2 - 2
src/util/openmp_runtime_support.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2014-2018                                Inria
  * Copyright (C) 2014-2017,2019                           CNRS
- * Copyright (C) 2015,2017,2019                           Université de Bordeaux
+ * Copyright (C) 2015,2017,2019-2020                      Université de Bordeaux
  *
  * 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
@@ -319,7 +319,7 @@ static struct starpu_omp_region *create_omp_region_struct(struct starpu_omp_regi
 	_STARPU_CALLOC(region, 1, sizeof(*region));
 	region->parent_region = parent_region;
 	region->owner_device = owner_device;
-	starpu_omp_thread_list_init(&region->thread_list);
+	starpu_omp_thread_list_init0(&region->thread_list);
 
 	_starpu_spin_init(&region->lock);
 	_starpu_spin_init(&region->registered_handles_lock);