Skip to content

[flang][OpenMP] Interaction of STOP with runtime I/O calls in parallel region causes runtime exception #73104

Open
@NimishMishra

Description

@NimishMishra

The following reproducer causes a RUNTIME_CHECK(length_ >= n) failed at /home/user1/.llvm/main/flang/runtime/buffer.h(165)

program sample
    implicit none
    integer i
    integer, parameter :: N = 8
    integer :: M = 99

    !$omp parallel do
        do i = 1, N
             print *, "some string"
             stop 1
        end do
    !$omp end parallel do
end program sample

Enclosing the runtime calls in a critical section causes the runtime failure to no longer be observed, hinting that maybe parallelization is the issue here.

        do i = 1, N
             !$omp critical
             print *, "some string"
             stop 1
             !$omp end critical
        end do

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions