Explorar o código

Add new property for insert_task which is used in the MPI interface to specify the task which is going to execute the codelet

Nathalie Furmento %!s(int64=14) %!d(string=hai) anos
pai
achega
8a5fabb3f2
Modificáronse 2 ficheiros con 8 adicións e 1 borrados
  1. 2 1
      include/starpu_util.h
  2. 6 0
      src/util/starpu_insert_task_utils.c

+ 2 - 1
include/starpu_util.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * 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
@@ -175,6 +175,7 @@ int starpu_data_cpy(starpu_data_handle dst_handle, starpu_data_handle src_handle
 #define STARPU_CALLBACK		(1<<4)	/* Callback function */
 #define STARPU_CALLBACK_ARG	(1<<5)	/* Argument of the callback function (of type void *) */
 #define STARPU_PRIORITY		(1<<6)	/* Priority associated to the task */
+#define STARPU_EXECUTE		(1<<7)	/* Used by MPI to define which task is going to execute the codelet */
 
 /* Wrapper to create a task. TODO document this interface */
 void starpu_insert_task(starpu_codelet *cl, ...);

+ 6 - 0
src/util/starpu_insert_task_utils.c

@@ -68,6 +68,9 @@ size_t starpu_insert_task_get_arg_size(va_list varg_list)
 		else if (arg_type==STARPU_PRIORITY) {
 			va_arg(varg_list, int);
 		}
+		else if (arg_type==STARPU_EXECUTE) {
+			va_arg(varg_list, int);
+		}
 	}
 
 	va_end(varg_list);
@@ -139,6 +142,9 @@ int starpu_insert_task_create_and_submit(size_t arg_buffer_size, starpu_codelet
 			int prio = va_arg(varg_list, int); 
 			(*task)->priority = prio;
 		}
+		else if (arg_type==STARPU_EXECUTE) {
+			va_arg(varg_list, int);
+		}
 	}
 
 	va_end(varg_list);