Selaa lähdekoodia

new flag STARPU_TASK_END_DEP for starpu_task_insert & co

Nathalie Furmento 6 vuotta sitten
vanhempi
commit
f105f1cf84

+ 8 - 2
doc/doxygen/chapters/api/insert_task.doxy

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2018                                CNRS
+ * Copyright (C) 2010-2019                                CNRS
  * Copyright (C) 2009-2011,2014-2016,2018                 Université de Bordeaux
  * Copyright (C) 2011,2012                                Inria
  *
@@ -42,7 +42,8 @@ starpu_task::execute_on_a_specific_worker)
 <li> the specific values ::STARPU_VALUE, ::STARPU_CALLBACK,
 ::STARPU_CALLBACK_ARG, ::STARPU_CALLBACK_WITH_ARG, ::STARPU_PRIORITY,
 ::STARPU_TAG, ::STARPU_TAG_ONLY, ::STARPU_FLOPS, ::STARPU_SCHED_CTX, ::STARPU_CL_ARGS, ::STARPU_CL_ARGS_NFREE,
-::STARPU_TASK_DEPS_ARRAY, ::STARPU_TASK_COLOR, ::STARPU_HANDLES_SEQUENTIAL_CONSISTENCY, ::STARPU_TASK_SYNCHRONOUS
+::STARPU_TASK_DEPS_ARRAY, ::STARPU_TASK_COLOR,
+::STARPU_HANDLES_SEQUENTIAL_CONSISTENCY, ::STARPU_TASK_SYNCHRONOUS, ::STARPU_TASK_END_DEP
 followed by the appropriated objects as defined elsewhere.
 </ul>
 
@@ -179,6 +180,11 @@ Used when calling starpu_task_insert(), must be followed by an array
 of characters representing the sequential consistency for each buffer
 of the task.
 
+\def STARPU_TASK_END_DEP
+\ingroup API_Insert_Task
+Used when calling starpu_task_insert(), must be followed by an integer
+which will be given to starpu_task_end_dep_add()
+
 \fn void starpu_task_insert_data_make_room(struct starpu_codelet *cl, struct starpu_task *task, int *allocated_buffers, int current_buffer, int room)
 \ingroup API_Insert_Task
 Assuming that there are already \p current_buffer data handles passed to

+ 2 - 1
include/fstarpu_mod.f90

@@ -1,7 +1,7 @@
 ! StarPU --- Runtime system for heterogeneous multicore architectures.
 !
 ! Copyright (C) 2016,2017                                Inria
-! Copyright (C) 2017,2018                                CNRS
+! Copyright (C) 2017,2018,2019                           CNRS
 ! Copyright (C) 2016-2018                                Université de Bordeaux
 !
 ! StarPU is free software; you can redistribute it and/or modify
@@ -58,6 +58,7 @@ module fstarpu_mod
         type(c_ptr), bind(C) :: FSTARPU_TASK_COLOR
         type(c_ptr), bind(C) :: FSTARPU_TASK_SYNCHRONOUS
         type(c_ptr), bind(C) :: FSTARPU_HANDLES_SEQUENTIAL_CONSISTENCY
+        type(c_ptr), bind(C) :: FSTARPU_TASK_END_DEP
         type(c_ptr), bind(C) :: FSTARPU_NODE_SELECTION_POLICY
 
         type(c_ptr), bind(C) :: FSTARPU_VALUE

+ 3 - 2
include/starpu_task_util.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2012-2014                                Inria
- * Copyright (C) 2010-2018                                CNRS
+ * Copyright (C) 2010-2019                                CNRS
  * Copyright (C) 2010-2015,2018                           Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -67,8 +67,9 @@ void starpu_create_sync_task(starpu_tag_t sync_tag, unsigned ndeps, starpu_tag_t
 #define STARPU_HANDLES_SEQUENTIAL_CONSISTENCY (29<<STARPU_MODE_SHIFT)
 #define STARPU_TASK_SYNCHRONOUS (30<<STARPU_MODE_SHIFT)
 #define STARPU_TASK_END_DEPS_ARRAY	(31<<STARPU_MODE_SHIFT)
+#define STARPU_TASK_END_DEP	(32<<STARPU_MODE_SHIFT)
 
-#define STARPU_SHIFTED_MODE_MAX (32<<STARPU_MODE_SHIFT)
+#define STARPU_SHIFTED_MODE_MAX (33<<STARPU_MODE_SHIFT)
 
 int starpu_task_set(struct starpu_task *task, struct starpu_codelet *cl, ...);
 struct starpu_task *starpu_task_build(struct starpu_codelet *cl, ...);

+ 5 - 1
mpi/src/starpu_mpi_task_insert.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2012,2014,2016,2017                      Inria
- * Copyright (C) 2011-2018                                CNRS
+ * Copyright (C) 2011-2019                                CNRS
  * Copyright (C) 2011-2018                                Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -465,6 +465,10 @@ int _starpu_mpi_task_decode_v(struct starpu_codelet *codelet, int me, int nb_nod
                 {
                         (void)va_arg(varg_list_copy, char *);
                 }
+		else if (arg_type==STARPU_TASK_END_DEP)
+		{
+			(void)va_arg(varg_list_copy, int);
+		}
 		else
 		{
 			STARPU_ABORT_MSG("Unrecognized argument %d, did you perhaps forget to end arguments with 0?\n", arg_type);

+ 6 - 1
mpi/src/starpu_mpi_task_insert_fortran.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2016-2018                                CNRS
+ * Copyright (C) 2016-2019                                CNRS
  * Copyright (C) 2017,2018                                Université de Bordeaux
  * Copyright (C) 2016                                     Inria
  *
@@ -315,6 +315,11 @@ int _fstarpu_mpi_task_decode_v(struct starpu_codelet *codelet, int me, int nb_no
 			arg_i++;
 			/* char* */
 		}
+		else if (arg_type==STARPU_TASK_END_DEP)
+		{
+			arg_i++;
+			/* int */
+		}
 		else
 		{
 			STARPU_ABORT_MSG("Unrecognized argument %d, did you perhaps forget to end arguments with 0?\n", arg_type);

+ 3 - 1
src/util/fstarpu.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2016,2017                                Inria
- * Copyright (C) 2016-2018                                CNRS
+ * Copyright (C) 2016-2019                                CNRS
  * Copyright (C) 2016-2018                                Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -60,6 +60,7 @@ static const intptr_t fstarpu_tag_only	= STARPU_TAG_ONLY;
 static const intptr_t fstarpu_name	= STARPU_NAME;
 static const intptr_t fstarpu_task_color	= STARPU_TASK_COLOR;
 static const intptr_t fstarpu_handles_sequential_consistency	= STARPU_HANDLES_SEQUENTIAL_CONSISTENCY;
+static const intptr_t fstarpu_task_end_dep	= STARPU_TASK_END_DEP;
 static const intptr_t fstarpu_task_synchronous	= STARPU_TASK_SYNCHRONOUS;
 static const intptr_t fstarpu_node_selection_policy	= STARPU_NODE_SELECTION_POLICY;
 
@@ -140,6 +141,7 @@ intptr_t fstarpu_get_constant(char *s)
 	else if (!strcmp(s, "FSTARPU_SCHED_CTX"))	{ return fstarpu_sched_ctx; }
 	else if (!strcmp(s, "FSTARPU_TASK_COLOR"))	{ return fstarpu_task_color; }
 	else if (!strcmp(s, "FSTARPU_HANDLES_SEQUENTIAL_CONSISTENCY"))	{ return fstarpu_handles_sequential_consistency; }
+	else if (!strcmp(s, "FSTARPU_TASK_END_DEP"))	{ return fstarpu_task_end_dep; }
 	else if (!strcmp(s, "FSTARPU_TASK_SYNCHRONOUS"))	{ return fstarpu_task_synchronous; }
 
 	else if (!strcmp(s, "FSTARPU_CPU_WORKER"))	{ return fstarpu_cpu_worker; }

+ 15 - 1
src/util/starpu_task_insert_utils.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2014,2016,2017                      Inria
- * Copyright (C) 2011-2018                                CNRS
+ * Copyright (C) 2011-2019                                CNRS
  * Copyright (C) 2011-2018                                Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -209,6 +209,10 @@ int _starpu_codelet_pack_args(void **arg_buffer, size_t *arg_buffer_size, va_lis
                 {
                         (void)va_arg(varg_list, unsigned char *);
                 }
+		else if (arg_type==STARPU_TASK_END_DEP)
+		{
+			(void)va_arg(varg_list, int);
+		}
 		else
 		{
 			STARPU_ABORT_MSG("Unrecognized argument %d, did you perhaps forget to end arguments with 0?\n", arg_type);
@@ -519,6 +523,11 @@ int _starpu_task_insert_create(struct starpu_codelet *cl, struct starpu_task *ta
                 {
                         task->handles_sequential_consistency = va_arg(varg_list, unsigned char *);
                 }
+		else if (arg_type==STARPU_TASK_END_DEP)
+		{
+			int end_dep = va_arg(varg_list, int);
+			starpu_task_end_dep_add(task, end_dep);
+		}
 		else
 		{
 			STARPU_ABORT_MSG("Unrecognized argument %d, did you perhaps forget to end arguments with 0?\n", arg_type);
@@ -782,6 +791,11 @@ int _fstarpu_task_insert_create(struct starpu_codelet *cl, struct starpu_task *t
                 {
                         task->handles_sequential_consistency = (unsigned char *)arglist[arg_i];
                 }
+		else if (arg_type==STARPU_TASK_END_DEP)
+		{
+			arg_i++;
+			starpu_task_end_dep_add(task, (int)arglist[arg_i]);
+		}
 		else
 		{
 			STARPU_ABORT_MSG("unknown/unsupported argument %d, did you perhaps forget to end arguments with 0?", arg_type);