Forráskód Böngészése

port r19751 from numa branch: Fix getting the value for the callback

Samuel Thibault 8 éve
szülő
commit
1956b6a05d
2 módosított fájl, 8 hozzáadás és 8 törlés
  1. 7 7
      src/datawizard/malloc.c
  2. 1 1
      tests/datawizard/acquire_cb_insert.c

+ 7 - 7
src/datawizard/malloc.c

@@ -28,7 +28,7 @@
 #include <datawizard/malloc.h>
 #include <core/simgrid.h>
 
-#ifdef STARPU_SIMGRID
+#if 1 //def STARPU_SIMGRID
 #include <sys/mman.h>
 #include <fcntl.h>
 #endif
@@ -46,7 +46,7 @@ static int disable_pinning;
 static int malloc_on_node_default_flags[STARPU_MAXNODES];
 
 /* This file is used for implementing "folded" allocation */
-#ifdef STARPU_SIMGRID
+#if 1 //def STARPU_SIMGRID
 static int bogusfile = -1;
 static unsigned long _starpu_malloc_simulation_fold;
 #endif
@@ -221,7 +221,7 @@ int starpu_malloc_flags(void **A, size_t dim, int flags)
 #endif /* STARPU_SIMGRID */
 	}
 
-#ifdef STARPU_SIMGRID
+#if 1 //def STARPU_SIMGRID
 	if (flags & STARPU_MALLOC_SIMULATION_FOLDED)
 	{
 		/* Use "folded" allocation: the same file is mapped several
@@ -311,7 +311,7 @@ int starpu_malloc_flags(void **A, size_t dim, int flags)
 				ret = -ENOMEM;
 		}
 
-#if defined(STARPU_SIMGRID) || defined(STARPU_USE_CUDA)
+#if  1 //defined(STARPU_SIMGRID) || defined(STARPU_USE_CUDA)
 end:
 #endif
 	if (ret == 0)
@@ -370,7 +370,7 @@ static struct starpu_codelet free_pinned_cl =
 
 int starpu_free_flags(void *A, size_t dim, int flags)
 {
-#ifndef STARPU_SIMGRID
+#if 0 //ndef STARPU_SIMGRID
 	if (flags & STARPU_MALLOC_PINNED && disable_pinning <= 0 && STARPU_RUNNING_ON_VALGRIND == 0)
 	{
 		if (_starpu_can_submit_cuda_task())
@@ -437,7 +437,7 @@ int starpu_free_flags(void *A, size_t dim, int flags)
 	}
 #endif /* STARPU_SIMGRID */
 
-#ifdef STARPU_SIMGRID
+#if 1 //def STARPU_SIMGRID
 	if (flags & STARPU_MALLOC_SIMULATION_FOLDED)
 	{
 		munmap(A, dim);
@@ -794,7 +794,7 @@ _starpu_malloc_init(unsigned dst_node)
 	STARPU_PTHREAD_MUTEX_INIT(&chunk_mutex[dst_node], NULL);
 	disable_pinning = starpu_get_env_number("STARPU_DISABLE_PINNING");
 	malloc_on_node_default_flags[dst_node] = STARPU_MALLOC_PINNED | STARPU_MALLOC_COUNT;
-#ifdef STARPU_SIMGRID
+#if 1 //def STARPU_SIMGRID
 	/* Reasonably "costless" */
 	_starpu_malloc_simulation_fold = starpu_get_env_number_default("STARPU_MALLOC_SIMULATION_FOLD", 1) << 20;
 #endif

+ 1 - 1
tests/datawizard/acquire_cb_insert.c

@@ -111,7 +111,7 @@ int main(int argc, char **argv)
 			starpu_task_insert(&work, STARPU_W, starpu_data_get_sub_data(f_handle, 1, x), 0)
 			);
 #else
-	starpu_data_acquire_cb(x_handle, STARPU_W, callback, NULL);
+	starpu_data_acquire_cb(x_handle, STARPU_R, callback, NULL);
 #endif
 
 	ret = starpu_task_wait_for_all();