Browse Source

Merge branch 'master' into python-test

HE Kun 4 years ago
parent
commit
1c157c0cf8

+ 10 - 0
contrib/gitlab/build.sh

@@ -17,5 +17,15 @@
 
 ./contrib/ci.inria.fr/job-0-tarball.sh
 
+tarball=$(ls -tr starpu-*.tar.gz | tail -1)
+
+if test -z "$tarball"
+then
+    echo Error. No tar.gz file
+    ls
+    pwd
+    exit 1
+fi
+
 
 

+ 1 - 1
doc/doxygen/chapters/310_data_management.doxy

@@ -1194,7 +1194,7 @@ static int complex_unpack_data(starpu_data_handle_t handle, unsigned node, void
 
 	return 0;
 }
-\encode
+\endcode
 
 And complex_unpack_data() just calls complex_peek_data() and releases the bytes array.
 

+ 1 - 1
examples/filters/fmultiple_manual.c

@@ -124,7 +124,7 @@ struct starpu_codelet cl_switch =
 
 int main(void)
 {
-	unsigned j, n=1;
+	unsigned n=1;
 	int matrix[NX][NY];
 	int ret, i;
 

+ 1 - 1
examples/filters/fmultiple_submit.c

@@ -98,7 +98,7 @@ struct starpu_codelet cl_check_scale =
 
 int main(void)
 {
-	unsigned j, n=1;
+	unsigned n=1;
 	int matrix[NX][NY];
 	int ret, i;
 

+ 1 - 1
examples/filters/fmultiple_submit_implicit.c

@@ -145,7 +145,7 @@ struct starpu_codelet cl_check =
 int main(void)
 {
 	int start, factor;
-	unsigned j, n=1;
+	unsigned n=1;
 	int matrix[NX][NY];
 	int ret, i;
 

+ 1 - 1
examples/filters/fplan_notautomatic.c

@@ -45,7 +45,7 @@ void task_cpu(void *descr[], void *args)
 
 void split_callback(void *arg)
 {
-	(arg);
+	(void)arg;
 	struct starpu_task *task = starpu_task_get_current();
 	starpu_data_handle_t value_handle, sub_handles[PARTS];
 

+ 2 - 2
examples/filters/frecursive.c

@@ -41,9 +41,9 @@ void cpu_codelet(void *buffers[], void *cl_arg)
 
 static struct starpu_codelet cl =
 {
-        .cpu_funcs[0] = cpu_codelet,
+        .cpu_funcs = {cpu_codelet},
         .nbuffers = 1,
-	.modes[0] = STARPU_RW,
+	.modes = {STARPU_RW},
 };
 
 #define NX 400

+ 2 - 4
examples/matvecmult/matvecmult.c

@@ -127,13 +127,11 @@ static struct starpu_perfmodel starpu_matvecmult_model =
 static struct starpu_codelet cl =
 {
 #ifdef STARPU_USE_OPENCL
-        .opencl_funcs[0] = opencl_codelet,
+        .opencl_funcs = {opencl_codelet},
 	.opencl_flags = {STARPU_OPENCL_ASYNC},
 #endif
         .nbuffers = 3,
-	.modes[0] = STARPU_R,
-	.modes[1] = STARPU_R,
-	.modes[2] = STARPU_RW,
+	.modes = {STARPU_R, STARPU_R, STARPU_RW},
 	.model = &starpu_matvecmult_model
 };
 

+ 0 - 2
examples/reductions/dot_product.c

@@ -186,7 +186,6 @@ void redux_opencl_func(void *buffers[], void *args)
 	{
 		size_t global=1;
                 size_t local=1;
-                size_t s;
                 cl_device_id device;
 
                 starpu_opencl_get_device(devid, &device);
@@ -301,7 +300,6 @@ void dot_opencl_func(void *buffers[], void *cl_arg)
 	{
 		size_t global=1;
                 size_t local=1;
-                size_t s;
                 cl_device_id device;
 
                 starpu_opencl_get_device(devid, &device);

+ 2 - 2
examples/sched_ctx/parallel_tasks_reuse_handle.c

@@ -172,7 +172,7 @@ static struct starpu_codelet sum_cl =
 int main(void)
 {
 	int ntasks = NTASKS;
-	int ret, j, k;
+	int ret;
 	unsigned ncpus = 0;
 
 	ret = starpu_init(NULL);
@@ -207,7 +207,7 @@ int main(void)
 
 	for (i = 0; i < ntasks; i++)
 	{
-		struct starpu_task * t;
+		struct starpu_task *t;
 		t=starpu_task_build(&sum_cl,
 				    STARPU_RW,handle1,
 				    STARPU_R,handle2,

+ 4 - 4
mpi/examples/benchs/bcast_bench.c

@@ -122,7 +122,7 @@ static int time_index(int size, int bench, int node)
 
 static void dummy_loop(int nb_dest_nodes, starpu_data_handle_t data_handle, int nb_nodes_id, int size_id, int bench_id)
 {
-	double t_end;
+	double t_end = 0.0;
 	int i;
 	starpu_data_handle_t time_handle;
 
@@ -146,7 +146,7 @@ static void dummy_loop(int nb_dest_nodes, starpu_data_handle_t data_handle, int
 			starpu_mpi_wait(&reqs[i], MPI_STATUS_IGNORE);
 		}
 
-		for (int i = 1; i <= nb_dest_nodes; i++)
+		for (i = 1; i <= nb_dest_nodes; i++)
 		{
 			starpu_variable_data_register(&time_handle, STARPU_MAIN_RAM, (uintptr_t) &t_end, sizeof(double));
 			starpu_mpi_recv(time_handle, i, time_tag, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
@@ -217,8 +217,8 @@ static inline void man()
 int main(int argc, char **argv)
 {
 	int pause_workers = 0;
-	int nb_nodes_id = 0;
-	int size_id = 0;
+	int nb_nodes_id;
+	int size_id;
 	int ret, method, nb_dest_nodes, s, b, i, array_size;
 	starpu_data_handle_t data_handle;
 	float* msg;

+ 2 - 2
mpi/examples/benchs/bench_helper.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2020       Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
+ * Copyright (C) 2020-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  *
  * 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
@@ -46,7 +46,7 @@ uint64_t bench_nb_iterations(int iterations, uint64_t len)
 {
 	const uint64_t max_data = NX_MAX;
 
-	if(len <= 0)
+	if(len == 0)
 		len = 1;
 
 	uint64_t data_size = ((uint64_t)iterations * (uint64_t)len);

+ 2 - 2
mpi/examples/benchs/burst.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2020       Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
+ * Copyright (C) 2020-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  *
  * 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
@@ -49,7 +49,7 @@ void parse_args(int argc, char **argv)
 
 int main(int argc, char **argv)
 {
-	int ret, rank, other_rank;
+	int ret, rank;
 
 	parse_args(argc, argv);
 

+ 4 - 5
mpi/examples/benchs/burst_helper.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2020       Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
+ * Copyright (C) 2020-2021  Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  *
  * 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
@@ -86,7 +86,7 @@ void burst_free_data(int rank)
 void burst_bidir(int rank)
 {
 	int other_rank = (rank == 0) ? 1 : 0;
-	int i = 0;
+	int i;
 
 	FPRINTF(stderr, "Simultaneous....start (rank %d)\n", rank);
 
@@ -123,7 +123,7 @@ void burst_bidir(int rank)
 void burst_unidir(int sender, int receiver, int rank)
 {
 	FPRINTF(stderr, "%d -> %d... start (rank %d)\n", sender, receiver, rank);
-	int i = 0;
+	int i;
 
 	if (rank == receiver)
 	{
@@ -163,8 +163,7 @@ void burst_unidir(int sender, int receiver, int rank)
 void burst_bidir_half_postponed(int rank)
 {
 	int other_rank = (rank == 0) ? 1 : 0;
-	int received = 0;
-	int i = 0;
+	int i;
 
 	FPRINTF(stderr, "Half/half burst...start (rank %d)\n", rank);
 

+ 4 - 4
mpi/examples/benchs/gemm_helper.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2020       Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
+ * Copyright (C) 2020-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  *
  * 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
@@ -292,9 +292,9 @@ void gemm_add_polling_dependencies()
 {
 	starpu_tag_t nb_tasks = (starpu_tag_t) nslices * (starpu_tag_t) nslices;
 	unsigned nb_workers = starpu_worker_get_count();
-	starpu_tag_t synchro_tag = 0;
-	starpu_tag_t previous_tag = 0;
-	starpu_tag_t next_tag = 0;
+	starpu_tag_t synchro_tag;
+	starpu_tag_t previous_tag;
+	starpu_tag_t next_tag;
 
 	for (synchro_tag = nb_workers+1; synchro_tag <= nb_tasks; synchro_tag += (nb_workers+1))
 	{

+ 1 - 1
mpi/examples/cache/cache.c

@@ -73,7 +73,7 @@ void test(struct starpu_codelet *codelet, enum starpu_data_access_mode mode, sta
 
 int main(int argc, char **argv)
 {
-	int rank, n;
+	int rank;
 	int ret;
 	unsigned val = 42;
 	starpu_data_handle_t data;

+ 1 - 1
mpi/examples/cache/cache_disable.c

@@ -34,7 +34,7 @@ struct starpu_codelet mycodelet_r =
 
 int main(int argc, char **argv)
 {
-	int rank, n;
+	int rank;
 	int ret;
 	unsigned *val;
 	starpu_data_handle_t data;

+ 3 - 0
src/datawizard/filters.c

@@ -635,7 +635,10 @@ void starpu_data_partition_clean(starpu_data_handle_t root_handle, unsigned npar
 	free(children[0]->siblings);
 
 	for (i = 0; i < nparts; i++)
+	{
+		children[i]->siblings = NULL;
 		starpu_data_unregister_submit(children[i]);
+	}
 
 	_starpu_spin_lock(&root_handle->header_lock);
 	root_handle->nplans--;

+ 6 - 0
src/datawizard/user_interactions.c

@@ -29,6 +29,12 @@ static void _starpu_data_check_initialized(starpu_data_handle_t handle, enum sta
 	if (!(mode & STARPU_R))
 		return;
 
+	if (((handle->nplans && !handle->nchildren) || handle->siblings)
+		&& handle->partition_automatic_disabled == 0)
+	{
+		_starpu_data_partition_access_submit(handle, (mode & STARPU_W) != 0);
+	}
+
 	if (!handle->initialized && handle->init_cl)
 	{
 		int ret = starpu_task_insert(handle->init_cl, STARPU_W, handle, 0);

+ 1 - 0
tests/Makefile.am

@@ -339,6 +339,7 @@ myPROGRAMS +=				\
 	datawizard/test_arbiter			\
 	datawizard/invalidate_pending_requests	\
 	datawizard/temporary_partition		\
+	datawizard/partitioned_initialization	\
 	datawizard/temporary_partition_implicit	\
 	datawizard/redux_acquire		\
 	disk/disk_copy				\

+ 104 - 0
tests/datawizard/partitioned_initialization.c

@@ -0,0 +1,104 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2010-2021  Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
+ *
+ * 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
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+#include <starpu.h>
+#include "../helper.h"
+
+#define SIZE (1<<20)
+#define NPARTS 16
+
+/*
+ * Test asynchronous partitioning on a temporary data.
+ */
+
+static void codelet(void *descr[], void *_args)
+{
+	(void)descr;
+	(void)_args;
+}
+
+static struct starpu_codelet clw =
+{
+	.where = STARPU_CPU,
+	.cpu_funcs = {codelet},
+	.nbuffers = 1,
+	.modes = {STARPU_W}
+};
+
+static struct starpu_codelet clr =
+{
+	.where = STARPU_CPU,
+	.cpu_funcs = {codelet},
+	.nbuffers = 1,
+	.modes = {STARPU_R}
+};
+
+int main(void)
+{
+	int ret;
+	starpu_data_handle_t handle, handles[NPARTS];
+	int i;
+	char d[SIZE];
+
+	ret = starpu_init(NULL);
+	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
+
+	starpu_vector_data_register(&handle, STARPU_MAIN_RAM, (uintptr_t) &d, SIZE, sizeof(char));
+	starpu_data_invalidate(handle);
+
+	/* Fork */
+	struct starpu_data_filter f =
+	{
+		.filter_func = starpu_vector_filter_block,
+		.nchildren = NPARTS
+	};
+	starpu_data_partition_plan(handle, &f, handles);
+
+	/* Process in parallel */
+	for (i = 0; i < NPARTS; i++)
+	{
+		ret = starpu_task_insert(&clw,
+					 STARPU_W, handles[i],
+					 0);
+		if (ret == -ENODEV) goto enodev;
+		STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_insert");
+	}
+
+	starpu_data_acquire(handle, STARPU_R);
+	starpu_data_release(handle);
+
+	/* Read result */
+	starpu_task_insert(&clr, STARPU_R, handle, 0);
+
+	/* Clean */
+	starpu_data_partition_clean(handle, NPARTS, handles);
+
+	starpu_data_unregister(handle);
+
+	starpu_shutdown();
+
+	return 0;
+
+enodev:
+	starpu_data_partition_clean(handle, NPARTS, handles);
+	starpu_data_unregister(handle);
+	starpu_shutdown();
+	/* yes, we do not perform the computation but we did detect that no one
+	 * could perform the kernel, so this is not an error from StarPU */
+	fprintf(stderr, "WARNING: No one can execute this task\n");
+	return STARPU_TEST_SKIPPED;
+}

+ 1 - 5
tests/main/insert_task.c

@@ -121,11 +121,7 @@ enodev:
 
 int main(void)
 {
-        int x; float f;
-        int i, ret;
-	int ifactor=12;
-	float ffactor=10.0;
-        starpu_data_handle_t data_handles[2];
+        int ret;
 
 	ret = starpu_init(NULL);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;

+ 1 - 0
tools/dev/cppcheck/suppressions.txt

@@ -21,6 +21,7 @@ unusedFunction
 unmatchedSuppression
 unusedStructMember
 missingInclude
+constArgument
 
 *:starpufft/*
 *:min-dgels/*