[Openmp-dev] Question about implementation of task dependencies

Hahnfeld, Jonas via Openmp-dev openmp-dev at lists.llvm.org
Wed Aug 3 04:37:17 PDT 2016


Dear all,

I'm currently doing some tests with task dependencies and have found a
behavior which I would have at least not expected. I'm possibly missing
something and there is not much documentation in the code so maybe the Intel
folks or someone else can enlighten me here.

With the following code snippet, the runtime will currently add a dependence
from task #3 to task #2:

    #pragma omp parallel num_threads(4)
    #pragma omp single
    {
        int dep;
        #pragma omp task depend(out: dep)
        {
            sleep(1);
            printf("task #1\n");
        }
        #pragma omp task depend(in: dep)
        {
            sleep(1);
            printf("task #2\n");
        }
        #pragma omp task depend(out: dep)
        {
            sleep(1);
            printf("task #3\n");
        }
    }

As out means the same as inout per the current standard, I would expect a
dependence to task #1 which specifies out on the same variable. (Note: The
dependence from #2 to task #1 is not questioned.)

I have attached a patch which then fulfills my expectations. However I don't
want to officially put it to review until I fully understand the reasoning
behind the current code.

Thanks,
Jonas


--
Jonas Hahnfeld, MATSE-Auszubildender

IT Center
Group: High Performance Computing
Division: Computational Science and Engineering
RWTH Aachen University
Seffenter Weg 23
D 52074  Aachen (Germany)
Hahnfeld at itc.rwth-aachen.de
www.itc.rwth-aachen.de


-------------- next part --------------
A non-text attachment was scrubbed...
Name: task-dependencies.patch
Type: application/octet-stream
Size: 5131 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20160803/3ed262a2/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20160803/3ed262a2/attachment.bin>


More information about the Openmp-dev mailing list