FATAL ERROR: data in PRESENT clause was not found on device

I am working on a project that can be found here: https://github.com/albdum/test/blob/master/CloverLeaf_ref-1_1_3d_OpenACC2
and I am trying to port it into OpenACC. However when I use the PRESENT clause the program cannot find the data. For example on start.f90 I explicitly COPY the needed files into the accelerator, but then on ideal_gas_kernel.f90 when I use present it doesn’t find it. Any ideas of what I am doing wrong or how I can get more valuable information in cases like this?

Hi ilias,

My quick look at the code shows that “ideal_gas” gets called from 5 different spots in the code, some inside an OpenACC data region, some outside. This is most likely causing the differences.

My first step would be to use “PCOPY” in place of the “COPY” and “PRESENT” clauses in “ideal_gas_kernel”. That way your data is copied when called from outside the data region and present when inside.

Next, I’d try moving the data region before the “do” loop in the “hydro” routine. Also add “update” directives to the spots where you need synchronize the data between host and device.

Hope this helps,

Hi Mat

I will try your suggestion, thank you!

Mat it worked like a charm!