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

mpi/tests: for ring apps, acquire data before changing its value, and fix datatype for cuda implementation

Nathalie Furmento 7 éve
szülő
commit
066d4db330

+ 2 - 0
mpi/tests/ring.c

@@ -118,8 +118,10 @@ int main(int argc, char **argv)
 
 		if (loop == 0 && rank == 0)
 		{
+			starpu_data_acquire(token_handle, RW);
 			token = 0;
 			FPRINTF(stdout, "Start with token value %d\n", token);
+			starpu_data_release(token_handle);
 		}
 		else
 		{

+ 2 - 0
mpi/tests/ring_async.c

@@ -118,8 +118,10 @@ int main(int argc, char **argv)
 
 		if (loop == 0 && rank == 0)
 		{
+			starpu_data_acquire(token_handle, RW);
 			token = 0;
 			FPRINTF(stdout, "Start with token value %d\n", token);
+			starpu_data_release(token_handle);
 		}
 		else
 		{

+ 3 - 1
mpi/tests/ring_async_implicit.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2015-2016  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2016  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2016, 2017  CNRS
  *
  * 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
@@ -111,8 +111,10 @@ int main(int argc, char **argv)
 
 		if (loop == 0 && rank == 0)
 		{
+			starpu_data_acquire(token_handle, RW);
 			token = 0;
 			FPRINTF(stdout, "Start with token value %d\n", token);
+			starpu_data_release(token_handle);
 		}
 		else
 		{

+ 3 - 3
mpi/tests/ring_kernel.cu

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux
- * Copyright (C) 2010, 2012  CNRS
+ * Copyright (C) 2010, 2012, 2017  CNRS
  *
  * 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
@@ -17,7 +17,7 @@
 
 #include <starpu.h>
 
-static __global__ void cuda_incrementer(unsigned *token)
+static __global__ void cuda_incrementer(int *token)
 {
 	(*token)++;
 }
@@ -25,7 +25,7 @@ static __global__ void cuda_incrementer(unsigned *token)
 extern "C" void increment_cuda(void *descr[], void *_args)
 {
 	(void) _args;
-	unsigned *tokenptr = (unsigned *)STARPU_VECTOR_GET_PTR(descr[0]);
+	int *tokenptr = (int *)STARPU_VECTOR_GET_PTR(descr[0]);
 
 	cuda_incrementer<<<1,1, 0, starpu_cuda_get_local_stream()>>>(tokenptr);
 	cudaStreamSynchronize(starpu_cuda_get_local_stream());

+ 2 - 0
mpi/tests/ring_sync.c

@@ -118,8 +118,10 @@ int main(int argc, char **argv)
 
 		if (loop == 0 && rank == 0)
 		{
+			starpu_data_acquire(token_handle, RW);
 			token = 0;
 			FPRINTF(stdout, "Start with token value %d\n", token);
+			starpu_data_release(token_handle);
 		}
 		else
 		{

+ 2 - 0
mpi/tests/ring_sync_detached.c

@@ -130,8 +130,10 @@ int main(int argc, char **argv)
 
 		if (loop == 0 && rank == 0)
 		{
+			starpu_data_acquire(token_handle, RW);
 			token = 0;
 			FPRINTF_MPI(stderr, "Start with token value %d\n", token);
+			starpu_data_release(token_handle);
 		}
 		else
 		{