[PATCH] D91879: [Flang][OpenMP 4.5] Add semantic check for OpenMP Schedule Clause - chunk size

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 14:04:34 PST 2020


kiranchandramohan added subscribers: Meinersbur, huntergr.
kiranchandramohan added a comment.

I will provide my understanding below. Can also check with @huntergr @Meinersbur.

Team is a set of threads executing a parallel region. This restriction is that the chunk size (which can be a variable but only needs to be positive) should not be different for different threads in the team.
 So I think code like the following are disallowed. Not sure whether we can catch these during semantic checks.

  subroutine fn(a,b,c,N)
    integer :: i
    integer :: a(:), b(:), c(:)
    integer :: chunk
    !$omp parallel
    chunk = 1 + omp_get_thread_num()
    !$omp do schedule(static, chunk)
    do i=1,N
      a(i) = b(i) + c(i)
    end do
    !$omp end do
    !$omp end parallel
  end subroutine


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91879/new/

https://reviews.llvm.org/D91879



More information about the llvm-commits mailing list