0

I am tring to parallelize a do loop in Fortran. Using OMP parallel do (and converted to standard do loop) it works nicely (using both gfortran and nvfortran), but when compiling it with nvfortran -stdpar=gpu it compiles, but running it, it crashes with:

0 Current file: xxx/pi.f90 function: pi line: 15 This file was compiled: -acc=gpu -gpu=cc35 -gpu=cc50 -gpu=cc60 -gpu=cc60 -gpu=cc70 -gpu=cc75 -gpu=cc80 -

Here is the code:

program pi
  implicit none
  integer :: count, n, i
  real :: r
  real, dimension(10000) :: x,y
  logical , dimension(10000) :: c
  c = .false.
  n=size(x,1)
  print*,count(c)
  call RANDOM_SEED
  call random_number(x)
  call random_number(y)

  do concurrent (i = 1: n)
    if (x(i)**2 + y(i)**2 <1.0) c(i)=.true.
  end do

  r = 4 * real(count(c))/n
  print *, r
end program pi
francescalus
  • 30,576
  • 16
  • 61
  • 96
fpl
  • 1
  • 2
  • The error seems to indicate that there's an issue with the runtime detecting what NVIDIA GPU you're running. What's the output from the commands: "nvidia-smi" and "nvaccelinfo"? – Mat Colgrove Jan 09 '23 at 17:02
  • That was the right hint! There was a driver problem on my machine. Now its working as expected, Thanks. – fpl Jan 10 '23 at 19:31

0 Answers0