Browse Source

Use memset to initialize most members of jobs

Samuel Thibault 12 years ago
parent
commit
04e37ae944
1 changed files with 4 additions and 16 deletions
  1. 4 16
      src/core/jobs.c

+ 4 - 16
src/core/jobs.c

@@ -68,34 +68,22 @@ struct _starpu_job* __attribute__((malloc)) _starpu_job_create(struct starpu_tas
 
 
 	job = _starpu_job_new();
 	job = _starpu_job_new();
 
 
-	job->nimpl =0; /* best implementation */
-	job->task = task;
+	/* As most of the fields must be initialized at NULL, let's put 0
+	 * everywhere */
+	memset(job, 0, sizeof(*job));
 
 
-	job->footprint_is_computed = 0;
-	job->submitted = 0;
-	job->terminated = 0;
+	job->task = task;
 
 
 #ifndef STARPU_USE_FXT
 #ifndef STARPU_USE_FXT
 	if (_starpu_bound_recording || _starpu_top_status_get())
 	if (_starpu_bound_recording || _starpu_top_status_get())
 #endif
 #endif
 		job->job_id = STARPU_ATOMIC_ADD(&job_cnt, 1);
 		job->job_id = STARPU_ATOMIC_ADD(&job_cnt, 1);
-#ifdef STARPU_USE_FXT
-	/* display all tasks by default */
-        job->model_name = NULL;
-#endif
-	job->exclude_from_dag = 0;
-
-	job->reduction_task = 0;
 
 
 	_starpu_cg_list_init(&job->job_successors);
 	_starpu_cg_list_init(&job->job_successors);
 
 
-	job->implicit_dep_handle = NULL;
-
 	_STARPU_PTHREAD_MUTEX_INIT(&job->sync_mutex, NULL);
 	_STARPU_PTHREAD_MUTEX_INIT(&job->sync_mutex, NULL);
 	_STARPU_PTHREAD_COND_INIT(&job->sync_cond, NULL);
 	_STARPU_PTHREAD_COND_INIT(&job->sync_cond, NULL);
 
 
-	job->bound_task = NULL;
-
 	/* By default we have sequential tasks */
 	/* By default we have sequential tasks */
 	job->task_size = 1;
 	job->task_size = 1;