Andra Hugo 12 rokov pred
rodič
commit
df39e83da5

+ 0 - 5
src/Makefile.am

@@ -206,10 +206,6 @@ libstarpu_@STARPU_EFFECTIVE_VERSION@_la_SOURCES = 						\
 	debug/traces/starpu_fxt_mpi.c				\
 	debug/traces/starpu_fxt_dag.c				\
 	debug/traces/starpu_paje.c				\
-	debug/traces/starpu_fxt.c				\
-	debug/traces/starpu_fxt_mpi.c				\
-	debug/traces/starpu_fxt_dag.c				\
-	debug/traces/starpu_paje.c				\
 	debug/latency.c						\
 	debug/structures_size.c					\
 	profiling/profiling.c					\
@@ -242,4 +238,3 @@ endif
 
 showcheck:
 	-cat /dev/null
-

+ 0 - 1
src/debug/traces/starpu_fxt.c

@@ -1346,4 +1346,3 @@ void starpu_fxt_generate_trace(struct starpu_fxt_options *options)
 	options->nworkers = nworkers;
 }
 #endif // STARPU_USE_FXT
-

+ 0 - 1
src/debug/traces/starpu_paje.c

@@ -246,4 +246,3 @@ void _starpu_fxt_write_paje_header(FILE *file)
 }
 
 #endif
-

+ 2 - 5
src/drivers/cpu/driver_cpu.c

@@ -4,7 +4,6 @@
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
- * Copyright (C) 2011  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
@@ -29,7 +28,6 @@
 #include <core/debug.h>
 #include "driver_cpu.h"
 #include <core/sched_policy.h>
-#include <core/sched_ctx.h>
 
 #ifdef STARPU_HAVE_HWLOC
 #include <hwloc.h>
@@ -226,7 +224,7 @@ int _starpu_cpu_driver_run_once(struct starpu_driver *d STARPU_ATTRIBUTE_UNUSED)
 
 	j = _starpu_get_job_associated_to_task(task);
 
- 	/* can a cpu perform that task ? */
+	/* can a cpu perform that task ? */
 	if (!_STARPU_CPU_MAY_PERFORM(j))
 	{
 		/* put it and the end of the queue ... XXX */
@@ -246,7 +244,6 @@ int _starpu_cpu_driver_run_once(struct starpu_driver *d STARPU_ATTRIBUTE_UNUSED)
 		rank = j->active_task_alias_count++;
 		_STARPU_PTHREAD_MUTEX_UNLOCK(&j->sync_mutex);
 
-
 		struct _starpu_combined_worker *combined_worker;
 		combined_worker = _starpu_get_combined_worker_struct(j->combined_workerid);
 
@@ -293,7 +290,7 @@ int _starpu_cpu_driver_run_once(struct starpu_driver *d STARPU_ATTRIBUTE_UNUSED)
 	}
 
 	if (rank == 0)
-		_starpu_handle_job_termination(j);
+		_starpu_handle_job_termination(j, workerid);
 	return 0;
 }
 

+ 3 - 3
src/drivers/cuda/driver_cuda.c

@@ -4,7 +4,6 @@
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
- * Copyright (C) 2011  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
@@ -27,7 +26,6 @@
 #include <drivers/driver_common/driver_common.h>
 #include "driver_cuda.h"
 #include <core/sched_policy.h>
-#include <core/sched_ctx.h>
 #ifdef HAVE_CUDA_GL_INTEROP_H
 #include <cuda_gl_interop.h>
 #endif
@@ -188,6 +186,7 @@ static void init_context(unsigned devid)
 		}
 	}
 #endif
+
 	/* force CUDA to initialize the context for real */
 	cures = cudaFree(0);
 	if (STARPU_UNLIKELY(cures)) {
@@ -389,6 +388,7 @@ int _starpu_cuda_driver_run_once(struct starpu_driver *d)
 	struct _starpu_job *j = NULL;
 
 	task = _starpu_get_worker_task(args, workerid, memnode);
+
 	if (!task)
 		return 0;
 
@@ -423,7 +423,7 @@ int _starpu_cuda_driver_run_once(struct starpu_driver *d)
 		}
 	}
 
-	_starpu_handle_job_termination(j);
+	_starpu_handle_job_termination(j, workerid);
 
 	return 0;
 }

+ 1 - 2
src/drivers/driver_common/driver_common.c

@@ -131,9 +131,8 @@ void _starpu_driver_update_job_feedback(struct _starpu_job *j, struct _starpu_wo
 		}
 
 		if (calibrate_model)
-		{
+
 			_starpu_update_perfmodel_history(j, j->task->cl->model,  perf_arch, worker_args->devid, measured,j->nimpl);
-		}
 
 
 	}

+ 1 - 2
src/drivers/opencl/driver_opencl.c

@@ -4,7 +4,6 @@
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
- * Copyright (C) 2011  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
@@ -529,7 +528,7 @@ int _starpu_opencl_driver_run_once(struct starpu_driver *d)
 		}
 	}
 
-	_starpu_handle_job_termination(j);
+	_starpu_handle_job_termination(j, workerid);
 	return 0;
 }
 

+ 1 - 1
src/starpu_parameters.h

@@ -33,7 +33,7 @@
 
 /* How many executions a codelet will have to be measured before we
  * consider that calibration will provide a value good enough for scheduling */
-#define _STARPU_CALIBRATION_MINIMUM 5
+#define _STARPU_CALIBRATION_MINIMUM 10
 
 /* Assumed relative performance ratios */
 /* TODO: benchmark a bit instead */

+ 2 - 3
src/util/starpu_insert_task_utils.c

@@ -276,7 +276,7 @@ int _starpu_insert_task_create_and_submit(char *arg_buffer, size_t arg_buffer_si
 		{
 			(void)va_arg(varg_list, starpu_data_handle_t);
 		}
-<<<<<<< .working
+
 		else if (arg_type==STARPU_HYPERVISOR_TAG) 
 		{
 			int hypervisor_tag = va_arg(varg_list, int);
@@ -288,14 +288,13 @@ int _starpu_insert_task_create_and_submit(char *arg_buffer, size_t arg_buffer_si
 			(*task)->flops = flops;
 		}
 
-=======
+
 		else if (arg_type==STARPU_TAG)
 		{
 			starpu_tag_t tag = va_arg(varg_list, starpu_tag_t);
 			(*task)->tag_id = tag;
 			(*task)->use_tag = 1;
 		}
->>>>>>> .merge-right.r7640
 	}
 
 	va_end(varg_list);

+ 4 - 5
tests/datawizard/write_only_tmp_buffer.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010-2012  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -28,8 +28,6 @@
 starpu_data_handle_t v_handle;
 
 #ifdef STARPU_USE_OPENCL
-#include <starpu_opencl.h>
-
 static void opencl_codelet_null(void *descr[], __attribute__ ((unused)) void *_args)
 {
 	STARPU_SKIP_IF_VALGRIND;
@@ -53,7 +51,8 @@ static void cuda_codelet_null(void *descr[], __attribute__ ((unused)) void *_arg
 
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 
-	cudaMemset(buf, 42, 1);
+	cudaMemsetAsync(buf, 42, 1, starpu_cuda_get_local_stream());
+	cudaStreamSynchronize(starpu_cuda_get_local_stream());
 }
 #endif
 
@@ -73,7 +72,7 @@ static void display_var(void *descr[], __attribute__ ((unused)) void *_args)
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 	if (*buf != 42)
 	{
-		FPRINTF(stderr, "Value = '%c' (should be '%c')\n", *buf, 42);
+		FPRINTF(stderr, "Value = <%c> (should be <%c>)\n", *buf, 42);
 		exit(-1);
 	}
 }

+ 1 - 1
tests/parallel_tasks/explicit_combined_worker.c

@@ -85,7 +85,7 @@ int main(int argc, char **argv)
 			task->execute_on_a_specific_worker = 1;
 			task->workerid = worker;
 
-			int ret = starpu_task_submit(task);
+			ret = starpu_task_submit(task);
 			if (ret == -ENODEV) goto enodev;
 			STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
 		}

+ 1 - 1
tests/parallel_tasks/parallel_kernels.c

@@ -89,7 +89,7 @@ int main(int argc, char **argv)
 
 			task->handles[0] = v_handle;
 
-			int ret = starpu_task_submit(task);
+			ret = starpu_task_submit(task);
 			if (ret == -ENODEV) goto enodev;
 			STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
 		}

+ 1 - 1
tests/parallel_tasks/parallel_kernels_spmd.c

@@ -91,7 +91,7 @@ int main(int argc, char **argv)
 
 			task->handles[0] = v_handle;
 
-			int ret = starpu_task_submit(task);
+			ret = starpu_task_submit(task);
 			if (ret == -ENODEV) goto enodev;
 			STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
 		}

+ 35 - 19
tests/parallel_tasks/spmd_pgreedy.c

@@ -14,52 +14,63 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
 #include <starpu.h>
 #include <limits.h>
 #include <unistd.h>
+#include "../helper.h"
 
 #define N	1000
 #define VECTORSIZE	1024
 
-starpu_data_handle v_handle;
+starpu_data_handle_t v_handle;
 static unsigned *v;
 
 static void codelet_null(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int worker_size = starpu_combined_worker_get_size();
-	assert(worker_size > 0);
+	STARPU_ASSERT(worker_size > 0);
 
-//	fprintf(stderr, "WORKERSIZE : %d\n", worker_size);
+//	FPRINTF(stderr, "WORKERSIZE : %d\n", worker_size);
 
 	usleep(1000/worker_size);
 #if 0
 	int id = starpu_worker_get_id();
 	int combined_id = starpu_combined_worker_get_id();
 	int rank = starpu_combined_worker_get_rank();
-	fprintf(stderr, "worker id %d - combined id %d - worker size %d - SPMD rank %d\n", id, combined_id, worker_size, rank);
+	FPRINTF(stderr, "worker id %d - combined id %d - worker size %d - SPMD rank %d\n", id, combined_id, worker_size, rank);
 #endif
 }
 
-static starpu_codelet cl = {
+static struct starpu_codelet cl =
+{
 	.where = STARPU_CPU|STARPU_CUDA|STARPU_OPENCL,
 	.type = STARPU_SPMD,
 	.max_parallelism = INT_MAX,
-	.cpu_func = codelet_null,
-	.cuda_func = codelet_null,
-        .opencl_func = codelet_null,
-	.nbuffers = 1
+	.cpu_funcs = {codelet_null, NULL},
+	.cuda_funcs = {codelet_null, NULL},
+        .opencl_funcs = {codelet_null, NULL},
+	.nbuffers = 1,
+	.modes = {STARPU_R}
 };
 
 
 int main(int argc, char **argv)
 {
+	int ret;
+
         struct starpu_conf conf;
 	starpu_conf_init(&conf);
-        conf.sched_policy_name = "pgreedy",
+        conf.sched_policy_name = "pgreedy";
 
-	starpu_init(&conf);
+	ret = starpu_init(&conf);
+	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_data_malloc_pinned_if_possible((void **)&v, VECTORSIZE*sizeof(unsigned));
+	ret = starpu_malloc((void **)&v, VECTORSIZE*sizeof(unsigned));
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_malloc");
 	starpu_vector_data_register(&v_handle, 0, (uintptr_t)v, VECTORSIZE, sizeof(unsigned));
 
 	unsigned iter;//, worker;
@@ -69,23 +80,28 @@ int main(int argc, char **argv)
 		struct starpu_task *task = starpu_task_create();
 		task->cl = &cl;
 
-		task->buffers[0].handle = v_handle;
-		task->buffers[0].mode = STARPU_R;
+		task->handles[0] = v_handle;
 
 		int ret = starpu_task_submit(task);
-		if (ret == -ENODEV)
-			goto enodev;
+		if (ret == -ENODEV) goto enodev;
+		STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
 	}
 
-	starpu_task_wait_for_all();
+	ret = starpu_task_wait_for_all();
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_wait_for_all");
 
+	starpu_data_unregister(v_handle);
+	starpu_free(v);
 	starpu_shutdown();
 
-	return 0;
+	return EXIT_SUCCESS;
 
 enodev:
+	starpu_data_unregister(v_handle);
+	starpu_free(v);
 	fprintf(stderr, "WARNING: No one can execute this task\n");
 	/* 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 */
-	return 0;
+	starpu_shutdown();
+	return STARPU_TEST_SKIPPED;
 }

+ 19 - 19
tools/starpu_perfmodel_plot.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012  Université de Bordeaux 1
- * Copyright (C) 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -24,8 +24,6 @@
 #include <limits.h>
 
 #include <starpu.h>
-#include <starpu_perfmodel.h>
-#include <starpu_fxt.h>
 #include <core/perfmodel/perfmodel.h> // we need to browse the list associated to history-based models
 
 #ifdef __MINGW32__
@@ -74,6 +72,7 @@ given perfmodel\n");
 	fprintf(stderr, "   -h, --help          display this help and exit\n");
 	fprintf(stderr, "   -v, --version       output version information and exit\n\n");
         fprintf(stderr, "Report bugs to <%s>.", PACKAGE_BUGREPORT);
+        fprintf(stderr, "\n");
 }
 
 static void parse_args(int argc, char **argv)
@@ -145,6 +144,14 @@ static void parse_args(int argc, char **argv)
 			continue;
 		}
 	}
+
+	if (!symbol && !list)
+	{
+		fprintf(stderr, "Incorrect usage, aborting\n");
+                usage(argv);
+		exit(-1);
+	}
+
 }
 
 static void print_comma(FILE *gnuplot_file, int *first)
@@ -163,7 +170,7 @@ static void display_perf_model(FILE *gnuplot_file, struct starpu_perfmodel *mode
 	char arch_name[256];
 	starpu_perfmodel_get_arch_name(arch, arch_name, 256, nimpl);
 
-	struct starpu_per_arch_perfmodel *arch_model =
+	struct starpu_perfmodel_per_arch *arch_model =
 		&model->per_arch[arch][nimpl];
 
 	if (arch_model->regression.valid || arch_model->regression.nl_valid)
@@ -209,7 +216,7 @@ static void display_history_based_perf_models(FILE *gnuplot_file, struct starpu_
 	char *command;
 	FILE *datafile;
 	unsigned arch;
-	struct starpu_history_list *ptr;
+	struct starpu_perfmodel_history_list *ptr;
 	char archname[32];
 	int col;
 	int len;
@@ -224,7 +231,7 @@ static void display_history_based_perf_models(FILE *gnuplot_file, struct starpu_
 	unsigned implid;
 	for (arch = arch1; arch < arch2; arch++) {
 		for (implid = 0; implid < STARPU_MAXIMPLEMENTATIONS; implid++) {
-			struct starpu_per_arch_perfmodel *arch_model = &model->per_arch[arch][implid];
+			struct starpu_perfmodel_per_arch *arch_model = &model->per_arch[arch][implid];
 			starpu_perfmodel_get_arch_name((enum starpu_perf_archtype) arch, archname, 32, implid);
 
 			//ptrs[arch-arch1][implid] = ptr[arch-arch1][implid] = arch_model->list;
@@ -244,7 +251,7 @@ static void display_history_based_perf_models(FILE *gnuplot_file, struct starpu_
 		/* Get the next minimum */
 		for (arch = arch1; arch < arch2; arch++)
 			for (implid = 0; implid < STARPU_MAXIMPLEMENTATIONS; implid++) {
-				struct starpu_per_arch_perfmodel *arch_model = &model->per_arch[arch][implid];
+				struct starpu_perfmodel_per_arch *arch_model = &model->per_arch[arch][implid];
 				for (ptr = arch_model->list; ptr; ptr = ptr->next) {
 					unsigned long size = ptr->entry->size;
 					if (size > last && size < minimum)
@@ -258,9 +265,9 @@ static void display_history_based_perf_models(FILE *gnuplot_file, struct starpu_
 		fprintf(datafile, "%-15lu ", minimum);
 		for (arch = arch1; arch < arch2; arch++) {
 			for (implid = 0; implid < STARPU_MAXIMPLEMENTATIONS; implid++) {
-				struct starpu_per_arch_perfmodel *arch_model = &model->per_arch[arch][implid];
+				struct starpu_perfmodel_per_arch *arch_model = &model->per_arch[arch][implid];
 				for (ptr = arch_model->list; ptr; ptr = ptr->next) {
-					struct starpu_history_entry *entry = ptr->entry;
+					struct starpu_perfmodel_history_entry *entry = ptr->entry;
 					if (entry->size == minimum) {
 						fprintf(datafile, "\t%-15le\t%-15le", 0.001*entry->mean, 0.001*entry->deviation);
 						break;
@@ -403,7 +410,7 @@ int main(int argc, char **argv)
 	parse_args(argc, argv);
 
         if (list) {
-                int ret = starpu_list_models(stdout);
+                int ret = starpu_perfmodel_list(stdout);
                 if (ret) {
                         fprintf(stderr, "The performance model directory is invalid\n");
                         return 1;
@@ -411,18 +418,11 @@ int main(int argc, char **argv)
 		return 0;
         }
 
-	/* We need at least a symbol name */
-	if (!symbol)
-	{
-		fprintf(stderr, "No symbol was specified\n");
-		return 1;
-	}
-
 	/* Load the performance model associated to the symbol */
-	ret = starpu_load_history_debug(symbol, &model);
+	ret = starpu_perfmodel_load_symbol(symbol, &model);
 	if (ret == 1)
 	{
-		fprintf(stderr, "The performance model could not be loaded\n");
+		fprintf(stderr, "The performance model for the symbol <%s> could not be loaded\n", symbol);
 		return 1;
 	}