Browse Source

src/datawizard/malloc.c: only check if worker may perform blocking calls before task submission

Nathalie Furmento 12 years ago
parent
commit
0a2343ec8c
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/datawizard/malloc.c

+ 6 - 3
src/datawizard/malloc.c

@@ -85,9 +85,6 @@ int starpu_malloc(void **A, size_t dim)
 {
 	int ret=0;
 
-	if (STARPU_UNLIKELY(!_starpu_worker_may_perform_blocking_calls()))
-		return -EDEADLK;
-
 	STARPU_ASSERT(A);
 
 #ifndef STARPU_SIMGRID
@@ -102,6 +99,9 @@ int starpu_malloc(void **A, size_t dim)
 #else
 		int push_res;
 
+		if (STARPU_UNLIKELY(!_starpu_worker_may_perform_blocking_calls()))
+			return -EDEADLK;
+
 		struct malloc_pinned_codelet_struct s =
 		{
 			.ptr = A,
@@ -128,6 +128,9 @@ int starpu_malloc(void **A, size_t dim)
 //#ifdef STARPU_USE_OPENCL
 //		int push_res;
 //
+//		if (STARPU_UNLIKELY(!_starpu_worker_may_perform_blocking_calls()))
+//			return -EDEADLK;
+//
 //		struct malloc_pinned_codelet_struct s =
 //		{
 //			.ptr = A,