Commit 31bc6c8
committed
[OpenMP] Allocate depnodes on heap not stack in __kmpc_omp_taskwait_deps_51
This patch contains the fix for the work-stealing stack clobber with
task graph dependency nodes. A straightforward-seeming fix is to just
use heap allocation instead of stack allocation for the problematic
nodes in question. This also allows us to revert the fix from PR85963:
#85963
There may be some concern that despite fixing the issue, using heap rather
than stack allocation may have a negative performance impact. However
this does not appear to be the case: in fact I measured a small
performance boost with this patch, i.e. over 100 runs of the OpenMP_VV
test_taskwait_depend.c test with the iteration count N increased to
1024000, five times before & after the patch is applied:
pre-patch
=========
real 0m30.635s
user 45m55.276s
sys 1m24.537s
real 0m30.943s
user 47m5.018s
sys 1m19.218s
real 0m30.573s
user 45m56.023s
sys 1m21.273s
real 0m30.955s
user 47m6.567s
sys 1m25.121s
real 0m30.712s
user 46m51.830s
sys 1m22.085s
with patch
==========
real 0m28.245s
user 39m16.057s
sys 1m11.156s
real 0m28.385s
user 39m35.553s
sys 1m16.413s
real 0m28.421s
user 39m42.498s
sys 1m16.783s
real 0m29.207s
user 39m5.006s
sys 1m10.247s
real 0m29.118s
user 38m30.484s
sys 1m14.027s
(On an AMD system with 64 cores/256 hw threads.)
This is probably because we no longer need the wait loop in
__kmpc_omp_taskwait_deps_51.1 parent 812b492 commit 31bc6c8
1 file changed
+11
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
1016 | 1018 | | |
| 1019 | + | |
1017 | 1020 | | |
1018 | | - | |
| 1021 | + | |
1019 | 1022 | | |
1020 | 1023 | | |
1021 | 1024 | | |
| |||
1029 | 1032 | | |
1030 | 1033 | | |
1031 | 1034 | | |
1032 | | - | |
1033 | | - | |
| 1035 | + | |
| 1036 | + | |
1034 | 1037 | | |
1035 | 1038 | | |
1036 | 1039 | | |
1037 | 1040 | | |
1038 | 1041 | | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
| 1042 | + | |
1046 | 1043 | | |
1047 | 1044 | | |
1048 | 1045 | | |
| |||
0 commit comments