Browse Source

Rename enforce_data_deps to access_data

enforce_data_deps was confusing. This is all not about STF data
dependencies, but concurrent write/read access to data (in the case
where STF coherency is disabled, or commute access, etc.)
Samuel Thibault 4 years ago
parent
commit
890fbb102e

+ 6 - 6
src/core/dependencies/data_concurrency.c

@@ -35,11 +35,11 @@
  * What we do here is implementing the Dijkstra solutions: handles are sorted
  * by pointer value order, and tasks call
  * _starpu_attempt_to_submit_data_request for each requested data in that order
- * (see _starpu_sort_task_handles call in _starpu_submit_job_enforce_data_deps).
+ * (see _starpu_sort_task_handles call in _starpu_concurrent_data_access).
  *
  * _starpu_attempt_to_submit_data_request will either:
  * - obtain access to the data, and thus the task can proceed with acquiring
- *   other data (see _submit_job_enforce_data_deps)
+ *   other data (see _submit_job_access_data)
  * - queue a request on the data handle
  *
  * When a task finishes, it calls _starpu_notify_data_dependencies for each
@@ -315,7 +315,7 @@ static unsigned attempt_to_submit_data_request_from_job(struct _starpu_job *j, u
 /* Try to acquire all data of the given job, one by one in handle pointer value order
  */
 /* No lock is held */
-static unsigned _submit_job_enforce_data_deps(struct _starpu_job *j, unsigned start_buffer_index)
+static unsigned _submit_job_access_data(struct _starpu_job *j, unsigned start_buffer_index)
 {
 	unsigned buf;
 
@@ -463,14 +463,14 @@ void _starpu_job_set_ordered_buffers(struct _starpu_job *j)
 /* Sort the data used by the given job by handle pointer value order, and
  * try to acquire them in that order */
 /* No  lock is held */
-unsigned _starpu_submit_job_enforce_data_deps(struct _starpu_job *j)
+unsigned _starpu_concurrent_data_access(struct _starpu_job *j)
 {
 	struct starpu_codelet *cl = j->task->cl;
 
 	if ((cl == NULL) || (STARPU_TASK_GET_NBUFFERS(j->task) == 0))
 		return 0;
 
-	return _submit_job_enforce_data_deps(j, 0);
+	return _submit_job_access_data(j, 0);
 }
 
 /* This request got fulfilled, continue with the other requests of the
@@ -484,7 +484,7 @@ static unsigned unlock_one_requester(struct _starpu_data_requester *r)
 
 	if (buffer_index + 1 < nbuffers)
 		/* not all buffers are protected yet */
-		return _submit_job_enforce_data_deps(j, buffer_index + 1);
+		return _submit_job_access_data(j, buffer_index + 1);
 	else
 		return 0;
 }

+ 1 - 1
src/core/dependencies/data_concurrency.h

@@ -25,7 +25,7 @@
 
 void _starpu_job_set_ordered_buffers(struct _starpu_job *j);
 
-unsigned _starpu_submit_job_enforce_data_deps(struct _starpu_job *j);
+unsigned _starpu_concurrent_data_access(struct _starpu_job *j);
 void _starpu_submit_job_enforce_arbitered_deps(struct _starpu_job *j, unsigned buf, unsigned nbuffers);
 void _starpu_submit_job_take_data_deps(struct _starpu_job *j);
 void _starpu_enforce_data_deps_notify_job_ready_soon(struct _starpu_job *j, _starpu_notify_job_start_data *data);

+ 4 - 4
src/core/jobs.c

@@ -689,10 +689,10 @@ unsigned _starpu_enforce_deps_and_schedule(struct _starpu_job *j)
 	}
 	STARPU_PTHREAD_MUTEX_UNLOCK(&j->sync_mutex);
 
-	/* enforce data dependencies */
-	if (_starpu_submit_job_enforce_data_deps(j))
+	/* respect data concurrent access */
+	if (_starpu_concurrent_data_access(j))
 	{
-		_STARPU_LOG_OUT_TAG("enforce_data_deps");
+		_STARPU_LOG_OUT_TAG("concurrent_data_access");
 		return 0;
 	}
 
@@ -716,7 +716,7 @@ unsigned _starpu_enforce_deps_starting_from_task(struct _starpu_job *j)
 	STARPU_PTHREAD_MUTEX_UNLOCK(&j->sync_mutex);
 
 	/* enforce data dependencies */
-	if (_starpu_submit_job_enforce_data_deps(j))
+	if (_starpu_concurrent_data_access(j))
 		return 0;
 
 	ret = _starpu_push_task(j);

+ 1 - 1
src/datawizard/sort_data_handles.c

@@ -72,7 +72,7 @@ static int _starpu_compar_handles(const struct _starpu_data_descr *descrA,
 	if (dataA == dataB)
 	{
 		/* Process write requests first, this is needed for proper
-		 * locking, see _submit_job_enforce_data_deps,
+		 * locking, see _submit_job_access_data,
 		 * _starpu_fetch_task_input, and _starpu_push_task_output  */
 		if (descrA->mode & STARPU_W)
 		{