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

Data race in Kokkos OpenMP initialization #131

Closed
PGXavier opened this issue Nov 13, 2015 · 1 comment
Closed

Data race in Kokkos OpenMP initialization #131

PGXavier opened this issue Nov 13, 2015 · 1 comment
Assignees
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)

Comments

@PGXavier
Copy link
Contributor

Singletons are initialized in a parallel region in Kokkos_OpenMPExec.cpp, line 145+. A critical region fixes that. (Found with Intel Thread Inspector, Intel 15. Debugged with Christian Trott.)

 #pragma omp parallel
    {
      const int rank_rev = m_map_rank[ omp_get_thread_num() ];
      const int rank     = pool_size - ( rank_rev + 1 );
#pragma omp critical
      {
          m_pool.at(rank_rev) = HostSpace::allocate_and_track( "openmp_scratch", alloc_size );
      }
      new ( m_pool[ rank_rev ] ) OpenMPexec( rank , ALLOC_EXEC , reduce_size , thread_size );
    }
/* END #pragma omp parallel */
@crtrott crtrott added the Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) label Nov 13, 2015
@hcedwar hcedwar added this to the Pre Christmas Push milestone Nov 23, 2015
@crtrott
Copy link
Member

crtrott commented Nov 30, 2015

Should be done now.

@crtrott crtrott closed this as completed Nov 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Projects
None yet
Development

No branches or pull requests

3 participants