[Openmp-commits] [PATCH] D23116: Do not block on explicit task depending on proxy task
Jonas Hahnfeld via Openmp-commits
openmp-commits at lists.llvm.org
Wed Aug 3 04:15:29 PDT 2016
Hahnfeld created this revision.
Hahnfeld added reviewers: jlpeyton, AndreyChurbanov.
Hahnfeld added a subscriber: openmp-commits.
Consider the following code:
```
int dep;
#pragma omp target nowait depend(out: dep)
{
sleep(1);
}
#pragma omp task depend(in: dep)
{
printf("Task with dependency\n");
}
printf("Doing some work...\n");
```
In its current state the runtime will block on the second task and not
continue execution.
https://reviews.llvm.org/D23116
Files:
runtime/src/kmp_taskdeps.cpp
Index: runtime/src/kmp_taskdeps.cpp
===================================================================
--- runtime/src/kmp_taskdeps.cpp
+++ runtime/src/kmp_taskdeps.cpp
@@ -480,7 +480,8 @@
bool serial = current_task->td_flags.team_serial || current_task->td_flags.tasking_ser || current_task->td_flags.final;
#if OMP_45_ENABLED
- serial = serial && !(new_taskdata->td_flags.proxy == TASK_PROXY);
+ kmp_task_team_t * task_team = thread->th.th_task_team;
+ serial = serial && !(task_team && task_team->tt.tt_found_proxy_tasks);
#endif
if ( !serial && ( ndeps > 0 || ndeps_noalias > 0 )) {
@@ -505,14 +506,8 @@
return TASK_CURRENT_NOT_QUEUED;
}
} else {
-#if OMP_45_ENABLED
- kmp_task_team_t * task_team = thread->th.th_task_team;
- if ( task_team && task_team->tt.tt_found_proxy_tasks )
- __kmpc_omp_wait_deps ( loc_ref, gtid, ndeps, dep_list, ndeps_noalias, noalias_dep_list );
- else
-#endif
- KA_TRACE(10, ("__kmpc_omp_task_with_deps(exit): T#%d ignored dependencies for task (serialized)"
- "loc=%p task=%p\n", gtid, loc_ref, new_taskdata ) );
+ KA_TRACE(10, ("__kmpc_omp_task_with_deps(exit): T#%d ignored dependencies for task (serialized)"
+ "loc=%p task=%p\n", gtid, loc_ref, new_taskdata ) );
}
KA_TRACE(10, ("__kmpc_omp_task_with_deps(exit): T#%d task had no blocking dependencies : "
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23116.66643.patch
Type: text/x-patch
Size: 1453 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20160803/074cda15/attachment-0001.bin>
More information about the Openmp-commits
mailing list