Variable Partially Present on the GPU Error

Does anyone know what this error might mean?

FATAL ERROR: variable data clause is partially present on the GPU: name=a
 file:C:\test.f line:258

Where the first line here is 258:

!$acc data copyin(a(269893641:337367040), b(53978729:67473408),
!$acc&                 c(53978729:67473408),    d(53978729:67473408),
!$acc&                 e(53978729:67473408),    f(53978729:67473408),
!$acc&                 g(53978729:67473408)) copy(h(53978729:67473408))

      do  idx= 1, n

         call abc(b(53978729), c(53978729), 
     $              d(53978729), e(53978729), 
     $              f(53978729), g(53978729), 
     $              h(53978729), i(53978729), 
     $              j(53978729), a(269893641),
     $             13494680, 13494680, 1, 1)

      end do

!$acc end data

Where function “abc” calls another function that has a kernels region in it. I do this in other parts of the code with lower regions of these arrays, but it only has trouble with this one which is right at the end of the allocated length of these arrays (a is length 337,367,040 and everything else is length 67,473,408). Sorry about the large numbers.

Hi Bones,

The data clauses use the form “variable name [ starting element : number of elements ]”. So if “a” has 337,367,040 elements, you either want to use “copyin(a(0:337367040)” or “copyin(a(269893641:67473399)”.

Though given the error, I’m assuming “a” is used in another data region higher up in the program (which is fine). Otherwise, if the run time were to copy this, you’d get a seg fault.

call abc(b(53978729), c(53978729),
     $              d(53978729), e(53978729),
     $              f(53978729), g(53978729),
     $              h(53978729), i(53978729),
     $              j(53978729), a(269893641),
     $             13494680, 13494680, 1, 1)

Are you just using scalars on the device? If so, you probably don’t need to copy the arrays over.

  • Mat

Thanks for the help.

That explains a lot – I was using the upper index instead of the length in the data range specifier. After I fixed this, I still ran into more problems, though; probably because this code is kind of a mess. When you were saying that I should use “copyin(a(0:337367040)”, does this mean that the starting index is zero based or 1 based? That may be what’s causing my other problems, but I need to clean this up a bit and look at it more carefully.

I am using “a” in previous sections because there’s not enough memory on the video card to copy the whole thing at once.

The variables are declared as arrays in the “abc” subroutine with a specific size, so it’s supposed to use all the data copied. It will make more sense when I label the inputs.

does this mean that the starting index is zero based or 1 based?

My fault, I’ve been working on some C code, so had C on the brain. In Fortran, it’s base 1.

The variables are declared as arrays in the “abc” subroutine with a specific size, so it’s supposed to use all the data copied. It will make more sense when I label the inputs.

Again, I was in C mode so was thinking that you were passing in a specific element, not Fortran pass by reference.

Sorry for the confusion,
Mat

I switched to using the length instead of the last index, and I get a different failure. Here is the program output:

 Section-1
 Section-2
FATAL ERROR: data in PRESENT clause was not found: name=g
 file:C:\test.f  line:216

And the code for the first 2 sections (which I want to eventually move into a loop once this gets working) is here below. Line 216 is the line after print “Section-2”.

print*,"Section-1"
!$acc data copyin(     a(0*sectsize+1:5*sectsize),
!$acc&                b(0*sectsize+1:sectsize),
!$acc&                c(0*sectsize+1:sectsize),
!$acc&                d(0*sectsize+1:sectsize),
!$acc&            e(0*sectsize+1:sectsize),
!$acc&             f(0*sectsize+1:sectsize),
!$acc&             g(0*sectsize+1:sectsize))
!$acc&     copy(      h(0*sectsize+1:sectsize))
      do  idx = 1, n

         call abc(g(0*sectsize+1), b(0*sectsize+1), 
     $            c(0*sectsize+1), d(0*sectsize+1), 
     $            e(0*sectsize+1), f(0*sectsize+1), 
     $            h(0*sectsize+1), i(0*sectsize+1), 
     $            j(0*sectsize+1), a(0*sectsize+1),
     $            sectsize, sectsize, 1, 1)

      end do
!$acc end data
      print*,"Section-2"
!$acc data copyin(     a(5*sectsize+1:5*sectsize),
!$acc&                b(1*sectsize+1:sectsize),
!$acc&                c(1*sectsize+1:sectsize),
!$acc&                d(1*sectsize+1:sectsize),
!$acc&                e(1*sectsize+1:sectsize),
!$acc&                f(1*sectsize+1:sectsize),
!$acc&                g(1*sectsize+1:sectsize))
!$acc&     copy(      h(1*sectsize+1:sectsize))
      do  idx = 1, n

         call abc(g(1*sectsize+1), b(1*sectsize+1), 
     $            c(1*sectsize+1), d(1*sectsize+1), 
     $            e(1*sectsize+1), f(1*sectsize+1), 
     $            h(1*sectsize+1), i(1*sectsize+1), 
     $            j(1*sectsize+1), a(5*sectsize+1),
     $            sectsize, sectsize, 1, 1)

      end do
!$acc end data

Hi Bones,

FATAL ERROR: data in PRESENT clause was not found: name=g

You should only get this error if you used a “present” clause, not a “copyin”. Maybe it’s coming from the “abc” routine?

Can you send the full code to PGI Customer Service (trs@pgroup.com) and ask them to forward it on to me? I should be able to get a better sense of what’s going on and if its a compiler or coding issue.

Thanks,
Mat

Thanks again for your help; I sent you those files. I suspect it may have something to do with dynamically allocating those variables with the allocate keyword. I had to do this because Windows doesn’t allow more than 2GB of stack space or something like that.