Intel® oneAPI HPC Toolkit
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
1829 Discussions

Can't terminate openmp-offload programs with Ctrl-C.

MehdiChinoune
New Contributor I
329 Views

Can't terminate programs built for OpenMP-Offloading using Ctrl-C.

Hardware:

  CPU: Intel Xeon E3-1505m v6

  GPU: Intel HD Graphics P630

Software:

  OS: Windows 10 Pro 20H2 and Ubuntu 20.04 and Ubuntu 20.10

  Toolkit:

      - Windows: Intel OneAPI HPC Toolkit / Intel Fortran Compiler 2021.1 (ifx)

      - Ubuntu: intel-oneapi-compiler-fortran from intel apt repositories.

  GPU driver version:

      - Windows: 27.20.100.9030

      - Ubuntu: preinstalled + intel-opencl-icd

Labels (2)
0 Kudos
5 Replies
AbhishekD_Intel
Moderator
299 Views

Hi,


In which environment you are getting this issue? Are you are using OpenMP offload on Windows or Ubuntu?

Also, try to set LIBOMPTARGET_PLUGIN=LEVEL0 before running executable if you are on Windows, or try to export LIBOMPTARGET_PLUGIN=LEVEL0 before running executable if you are using Ubuntu.

If you still face any issues while using OpenMP offload do let us know and send us a small reproducer so that we will get more insight into your issues.


Warm Regards,

Abhishek


MehdiChinoune
New Contributor I
289 Views

As you have mentioned in another post openmp-offloading with LEVEL0 plugin doesn't run on Windows.

The same applies for Ubuntu with packages installed from default repositories.

This is a reproducer.

program main
  implicit none
  integer, parameter :: sp = selected_real_kind(6,37)
  integer :: i, j, k
  integer :: n
  character(len=5) :: var
  real(sp), allocatable :: a(:,:), b(:,:), c(:,:), cc(:,:)
  integer :: t1, t2, t3
  real(sp) :: tic
  !
  call get_command_argument( 1, var )
  read( var, '(i5.3)') n
  print*, n
  !
  allocate( a(n,n), b(n,n), c(n,n), cc(n,n) )
  call random_number(a)
  call random_number(b)
  c = 0._sp
  !
  call system_clock(t1, tic)
  cc = 0._sp
  do j = 1, n
    do k = 1, n
      do i = 1, n
	cc(i,j) = a(i,k)*b(k,j) + cc(i,j)
      end do
    end do
  end do
  call system_clock( t2 )
  print*, "T1 = ", (t2-t1)/tic
  !$omp target teams distribute parallel do collapse(3) map( to:a,b) map( tofrom:c )
  do j = 1, n
    do k = 1, n
      do i = 1, n
	    c(i,j) = a(i,k)*b(k,j) + c(i,j)
      end do
    end do
  end do
  call system_clock(t3)
  print*, "T2 = ", (t3-t2)/tic
  !
  print*, "Max(|C2-C1|) = ", maxval( abs(cc-c) )
  !
end program main

 After building using "ifx /Qiopenmp /Qopenmp-targets=spir64 matmul.f90", and running ".\matmul.exe 1024". it doesn't terminate while it's running when I press "Ctrl-C".

MehdiChinoune
New Contributor I
278 Views

After setting LIBOMPTARGET_PLUGIN=OPENCL on Windows and Installing intel-opencl-icd on Ubuntu, I don't see that behavior.

AbhishekD_Intel
Moderator
264 Views

Hi,


This OpenMP offload issue with level-zero is with both Windows as well as Linux, whereas if you tried the above workaround your code will work run on Intel GPU.


Please let us know if you have any other issues and also give us confirmation if this issue is resolved.


Warm Regards,

Abhishek


AbhishekD_Intel
Moderator
236 Views

Hi,


As your issue is resolved we will no longer monitor this thread. Please post a new thread if you have any issues.


Warm Regards,

Abhishek


Reply