Strange run-time error: variable data clause is partially...

Hi all,
I’m using PGI 12.6 and OpenACC.
I have a strange run-time error message with immediate stop of the program:
“FATAL ERROR: variable data clause is partially present on the GPU: name=xxx”
where xxx is an allocatable array which I have allocated on the CPU and on the GPU with a data create directive.
I don’t understand what “partially” means and how I can avoid the errror.
Thanks
Tiziano

Hi Tiziano,

The “present” data directive does a run time look-up for the device copy of the variable. This allows for various pointers and sub-arrays to point into the same device memory. The “partially present” error means that variable that is being looked-up is larger than the device copy of the variable.

Can you post the create and present clauses you are using as well as how the variable is declared and allocated?

  • Mat

Hi again,
I solved the problem.
Schematically the code I was working on, was like this:

  • allocate arrays on the CPU (they all are declared as fortran allocatable arrays, and they are declared in a module)
  • !$acc data present_or_create(arrays just allocated so the size is known)
  • loop with many routines using the arrays with present_or_copy
  • deallocate all on the CPU
  • !$acc end data
    This is a routine itself and for the moment (to be optimized) the allocation and deallocation is performed every time, so everything starts again from the beginning.
    The problem lied in the last 2 phases, switching them solved the problem, I guess ending the data region after deallocating on the CPU is confusing for the compiler, probably not a good practice anyway.
    Best regards
    Tiziano