Hi! I am modifying a simple SWE (Shallow Water Equations) 1D in order to use PGI Accelerator 11.6 (and Visual Studio 2008) on a nVidia Tesla C2050.
The code has a structure like this:
CALL sub1 CALL sub2 DO i = 1,N CALL sub3 ... CALL subM END DO
I have used “!$acc reflected” and “!$acc region do” in every subroutine inside the DO loop (since those subroutines consist essentially of one or more DO loops):
MODULE mod3 CONTAINS SUBROUTINE sub3 ... !$ acc reflected(arr1,...) !$acc region do DO i = 1,N ... END DO !$acc end region
Then I created a “!$acc data region copy” outside the main program DO loop to avoid continuos data transfer between the host and the device:
CALL sub1 CALL sub2 !$acc data region copy(arr1,...) DO i = 1,N CALL sub3 ... CALL subM END DO !$acc end data region
The results I obtain with the accelerated code are different from the non-accelerated code. It looks like values in the arrays are not being updated correctly. I also tried “mirror” and “update device” (bedore entering the main program’s DO loop) combination, but i get an error (about copying datas from host to device).
I’ve uploaded the zipped VS 2008 project on MediaFire since it’s a little bit long and it would have appeared as a mess on this post:
Thanks in advance for the help,