Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#pragma omp task depend hangs with num_threads=1 #27

Open
tianyizhangcs opened this issue Sep 13, 2018 · 0 comments
Open

#pragma omp task depend hangs with num_threads=1 #27

tianyizhangcs opened this issue Sep 13, 2018 · 0 comments

Comments

@tianyizhangcs
Copy link
Member

Code:

#include <stdio.h>

int foo() {
    return 42;
}

int bar(int in) {
    return in + 11;
}

int main(int argc, char **argv) {
    int x = 5, y = 1, z = 0;
    printf("&x = %p\n", &x);
#pragma omp parallel num_threads(1)
    {
#pragma omp single
        {
#pragma omp task depend(out: x)
            x = foo();

#pragma omp task depend(in: x) depend(out : y)
            y = bar(x);

#pragma omp task depend(in: y)
            z = bar(y);
        }
    }
    printf("x = %d\n",x);
    printf("y = %d\n",y);
    printf("z = %d\n",z);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant