浏览代码

new function starpu_data_partition_not_automatic() to disable automatic (un-)partitionning of data

(cherry picked from commit d1b9bd762a81f41a7c1672cd9d360041acd49716)
Nathalie Furmento 7 年之前
父节点
当前提交
255edba214

+ 1 - 0
include/starpu_data_filters.h

@@ -55,6 +55,7 @@ void starpu_data_partition_clean(starpu_data_handle_t root_data, unsigned nparts
 
 void starpu_data_partition_submit_sequential_consistency(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int sequential_consistency);
 void starpu_data_unpartition_submit_sequential_consistency(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int gathering_node, int sequential_consistency);
+void starpu_data_partition_not_automatic(starpu_data_handle_t handle);
 
 int starpu_data_get_nb_children(starpu_data_handle_t handle);
 starpu_data_handle_t starpu_data_get_child(starpu_data_handle_t handle, unsigned i);

+ 4 - 2
src/core/task.c

@@ -3,7 +3,7 @@
  * Copyright (C) 2011-2018                                Inria
  * Copyright (C) 2017                                     Erwan Leria
  * Copyright (C) 2009-2018                                Université de Bordeaux
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2018                                CNRS
  * Copyright (C) 2011                                     Télécom-SudParis
  * Copyright (C) 2016                                     Uppsala University
  *
@@ -597,7 +597,9 @@ static int _starpu_task_submit_head(struct starpu_task *task)
 			if (handle->home_node != -1)
 				_STARPU_TASK_SET_INTERFACE(task, starpu_data_get_interface_on_node(handle, handle->home_node), i);
 			if (!(task->cl->flags & STARPU_CODELET_NOPLANS) &&
-			    ((handle->nplans && !handle->nchildren) || handle->siblings))
+			    ((handle->nplans && !handle->nchildren) || handle->siblings)
+			    && handle->partition_automatic_disabled == 0
+			    )
 				/* This handle is involved with asynchronous
 				 * partitioning as a parent or a child, make
 				 * sure the right plan is active, submit

+ 3 - 1
src/datawizard/coherency.h

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2011,2014-2017                           Inria
  * Copyright (C) 2008-2018                                Université de Bordeaux
- * Copyright (C) 2010-2015,2017                           CNRS
+ * Copyright (C) 2010-2015,2017,2018                      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
@@ -277,6 +277,8 @@ struct _starpu_data_state
 	 * took it yet */
 	int last_locality;
 
+	int partition_automatic_disabled;
+
 	/* A generic pointer to data in the user land (could be anything and this
 	 * is not manage by StarPU) */
 	void *user_data;

+ 5 - 0
src/datawizard/filters.c

@@ -1040,3 +1040,8 @@ _starpu_filter_nparts_compute_chunk_size_and_offset(unsigned n, unsigned nparts,
 	if (offset != NULL)
 		*offset = (id *(n/nparts) + STARPU_MIN(remainder, id)) * ld * elemsize;
 }
+
+void starpu_data_partition_not_automatic(starpu_data_handle_t handle)
+{
+	handle->partition_automatic_disabled = 1;
+}

+ 1 - 0
src/datawizard/interfaces/data_interface.c

@@ -451,6 +451,7 @@ int _starpu_data_handle_init(starpu_data_handle_t handle, struct starpu_data_int
 	handle->ops = interface_ops;
 	handle->mf_node = mf_node;
 	handle->mpi_data = NULL;
+	handle->partition_automatic_disabled = 0;
 
 	size_t interfacesize = interface_ops->interface_size;