ソースを参照

Always use j->cl_start instead of a local variable, to make debugging easier

Samuel Thibault 8 年 前
コミット
454637e88d

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

@@ -55,10 +55,9 @@ static int execute_job_on_cpu(struct _starpu_job *j, struct starpu_task *worker_
 {
 	int is_parallel_task = (j->task_size > 1);
 	int profiling = starpu_profiling_status_get();
-	/* start/end timestamp are only conditionnally measured in
-	 * _starpu_driver_start_job/_end_job, thus make sure that they are
+	/* end timestamp is only conditionnally measured in
+	 * _starpu_driver_end_job, thus make sure that it is
 	 * always initialized */
-	struct timespec codelet_start = {0,0};
 	struct timespec codelet_end = {0,0};
 
 	struct starpu_task *task = j->task;
@@ -76,7 +75,7 @@ static int execute_job_on_cpu(struct _starpu_job *j, struct starpu_task *worker_
 	}
 
 	/* Give profiling variable */
-	_starpu_driver_start_job(cpu_args, j, perf_arch, &codelet_start, rank, profiling);
+	_starpu_driver_start_job(cpu_args, j, perf_arch, rank, profiling);
 
 	/* In case this is a Fork-join parallel task, the worker does not
 	 * execute the kernel at all. */
@@ -145,7 +144,7 @@ static int execute_job_on_cpu(struct _starpu_job *j, struct starpu_task *worker_
 	if (rank == 0)
 	{
 		_starpu_driver_update_job_feedback(j, cpu_args,
-				perf_arch, &codelet_start, &codelet_end, profiling);
+				perf_arch, &j->cl_start, &codelet_end, profiling);
 #ifdef STARPU_OPENMP
 		if (!j->continuation)
 #endif

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

@@ -489,7 +489,7 @@ static int start_job_on_cuda(struct _starpu_job *j, struct _starpu_worker *worke
 	if (worker->ntasks == 1)
 	{
 		/* We are alone in the pipeline, the kernel will start now, record it */
-		_starpu_driver_start_job(worker, j, &worker->perf_arch, &j->cl_start, 0, profiling);
+		_starpu_driver_start_job(worker, j, &worker->perf_arch, 0, profiling);
 	}
 
 #if defined(HAVE_CUDA_MEMCPY_PEER) && !defined(STARPU_SIMGRID)
@@ -831,7 +831,7 @@ int _starpu_cuda_driver_run_once(struct _starpu_worker_set *worker_set)
 				{
 					/* An asynchronous task, it was already
 					 * queued, it's now running, record its start time.  */
-					_starpu_driver_start_job(worker, j, &worker->perf_arch, &j->cl_start, 0, starpu_profiling_status_get());
+					_starpu_driver_start_job(worker, j, &worker->perf_arch, 0, starpu_profiling_status_get());
 				}
 				else
 				{

+ 5 - 5
src/drivers/driver_common/driver_common.c

@@ -34,7 +34,7 @@
 #define BACKOFF_MAX 32  /* TODO : use parameter to define them */
 #define BACKOFF_MIN 1
 
-void _starpu_driver_start_job(struct _starpu_worker *worker, struct _starpu_job *j, struct starpu_perfmodel_arch* perf_arch STARPU_ATTRIBUTE_UNUSED, struct timespec *codelet_start, int rank, int profiling)
+void _starpu_driver_start_job(struct _starpu_worker *worker, struct _starpu_job *j, struct starpu_perfmodel_arch* perf_arch STARPU_ATTRIBUTE_UNUSED, int rank, int profiling)
 {
 	struct starpu_task *task = j->task;
 	struct starpu_codelet *cl = task->cl;
@@ -63,13 +63,13 @@ void _starpu_driver_start_job(struct _starpu_worker *worker, struct _starpu_job
 
 		if ((profiling && profiling_info) || calibrate_model || starpu_top)
 		{
-			_starpu_clock_gettime(codelet_start);
-			_starpu_worker_register_executing_start_date(workerid, codelet_start);
+			_starpu_clock_gettime(&j->cl_start);
+			_starpu_worker_register_executing_start_date(workerid, &j->cl_start);
 		}
 	}
 
 	if (starpu_top)
-		_starpu_top_task_started(task,workerid,codelet_start);
+		_starpu_top_task_started(task,workerid,&j->cl_start);
 
 
 	// Find out if the worker is the master of a parallel context
@@ -94,7 +94,7 @@ void _starpu_driver_start_job(struct _starpu_worker *worker, struct _starpu_job
 				{
 					new_rank++;
 					struct _starpu_worker *_worker = _starpu_get_worker_struct(_workerid);
-					_starpu_driver_start_job(_worker, j, &_worker->perf_arch, codelet_start, new_rank, profiling);
+					_starpu_driver_start_job(_worker, j, &_worker->perf_arch, new_rank, profiling);
 				}
 			}
 		}

+ 2 - 2
src/drivers/driver_common/driver_common.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2012, 2014  Université de Bordeaux
+ * Copyright (C) 2010-2012, 2014, 2017  Université de Bordeaux
  * Copyright (C) 2010, 2011  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -24,7 +24,7 @@
 #include <common/utils.h>
 
 void _starpu_driver_start_job(struct _starpu_worker *args, struct _starpu_job *j, struct starpu_perfmodel_arch* perf_arch,
-			      struct timespec *codelet_start, int rank, int profiling);
+			      int rank, int profiling);
 void _starpu_driver_end_job(struct _starpu_worker *args, struct _starpu_job *j, struct starpu_perfmodel_arch* perf_arch,
 			    struct timespec *codelet_end, int rank, int profiling);
 void _starpu_driver_update_job_feedback(struct _starpu_job *j, struct _starpu_worker *worker_args,

+ 1 - 1
src/drivers/mp_common/source_common.c

@@ -512,7 +512,7 @@ static int _starpu_src_common_execute(struct _starpu_job *j,
 
 	void (*kernel)(void)  = node->get_kernel_from_job(node,j);
 
-	_starpu_driver_start_job(worker, j, &worker->perf_arch, &j->cl_start, 0, profiling);
+	_starpu_driver_start_job(worker, j, &worker->perf_arch, 0, profiling);
 
 	//_STARPU_DEBUG("\nworkerid:%d, rank:%d, type:%d,	cb_workerid:%d, task_size:%d\n\n",worker->devid,worker->current_rank,task->cl->type,j->combined_workerid,j->task_size);
 

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

@@ -753,7 +753,7 @@ int _starpu_opencl_driver_run_once(struct _starpu_worker *worker)
 				{
 					/* An asynchronous task, it was already queued,
 					 * it's now running, record its start time.  */
-					_starpu_driver_start_job(worker, j, &worker->perf_arch, &j->cl_start, 0, starpu_profiling_status_get());
+					_starpu_driver_start_job(worker, j, &worker->perf_arch, 0, starpu_profiling_status_get());
 				}
 				else
 				{
@@ -925,7 +925,7 @@ static int _starpu_opencl_start_job(struct _starpu_job *j, struct _starpu_worker
 	if (worker->ntasks == 1)
 	{
 		/* We are alone in the pipeline, the kernel will start now, record it */
-		_starpu_driver_start_job(worker, j, &worker->perf_arch, &j->cl_start, 0, profiling);
+		_starpu_driver_start_job(worker, j, &worker->perf_arch, 0, profiling);
 	}
 
 	starpu_opencl_func_t func = _starpu_task_get_opencl_nth_implementation(cl, j->nimpl);