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

thrdpvt.cpp failing #34

Open
tianyizhangcs opened this issue Oct 1, 2018 · 0 comments
Open

thrdpvt.cpp failing #34

tianyizhangcs opened this issue Oct 1, 2018 · 0 comments

Comments

@tianyizhangcs
Copy link
Member

Not generating proper behavior

// Copyright (c) 2018 Tianyi Zhang
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <iostream>
#include <omp.h>

int thread_num, val;
#pragma omp threadprivate(thread_num,val)

int main() {

#pragma omp parallel
    {
        thread_num = omp_get_thread_num();
    }

#pragma omp parallel
    {
        if(omp_get_thread_num() != thread_num)
            throw "not correct !";
    }
    return 0;
}
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