Browse Source

Note that manual partition needs to have its switch codelet go through the main ram

Samuel Thibault 3 years ago
parent
commit
a681917f63

+ 9 - 4
doc/doxygen/chapters/310_data_management.doxy

@@ -529,12 +529,12 @@ When we want to switch to the vertical slice view, all we need to do is bring
 coherency between them by running an empty task on the home node of the data:
 
 \code{.c}
-void empty(void *buffers[], void *cl_arg)
-{ }
 struct starpu_codelet cl_switch =
 {
-	.cpu_funcs = {empty},
-	.nbuffers = STARPU_VARIABLE_NBUFFERS,
+	.where = STARPU_NOWHERE,
+	.nbuffers = 3,
+	.specific_nodes = 1,
+	.nodes = { STARPU_MAIN_RAM, STARPU_MAIN_RAM, STARPU_MAIN_RAM },
 };
 
 ret = starpu_task_insert(&cl_switch, STARPU_RW, handle,
@@ -552,6 +552,11 @@ Again, we prefer to make sure that we don't accidentally access the matrix throu
 starpu_data_invalidate_submit(handle);
 \endcode
 
+Note: when enabling a set of handles in this way, the set must not have any
+overlapping, i.e. the handles of the set must not have any part of data in
+common, otherwise StarPU will not properly handle concurrent accesses between
+them.
+
 And now we can start using vertical slices, etc.
 
 \section DataPointers Handles data buffer pointers

+ 7 - 1
examples/filters/fmultiple_manual.c

@@ -117,9 +117,15 @@ void empty(void *buffers[], void *cl_arg)
 
 struct starpu_codelet cl_switch =
 {
+#if 1
+	/* Check for the values */
 	.cpu_funcs = {empty},
+#else
+	/* For production code: we do not need to actually execute anything */
+	.where = STARPU_NOWHERE,
+#endif
 	.nbuffers = STARPU_VARIABLE_NBUFFERS,
-	.name = "switch"
+	.name = "switch",
 };
 
 int main(void)