How to debug the FORTRAN+OPENACC source code

I want to use OPENACC to accelarate FORTRAN code, but i don’t know how to debug the OPENACC program. Does the PGI debugger can debug it? If so, How to do it?

Hi Kingpo,

You can use cuda-gdb to debug the device code. However, you’d be debugging optimized code, so using a debugger isn’t always very useful.

To debug OpenACC enabled programs, I typically start by making sure that the serial (non-OpenACC) code works correctly. Then enable OpenACC targeting Multicore (-ta=multicore), then finally target the GPU.

The exact strategy for debugging will depend on the type of error you’re seeing. So if you do get an error, let me know I can suggest strategies.

-Mat

Hi Mat

For now, I haven’t a special error. I just want to learn how to debug the OpenACC enabled programs. I will send to you when i meet a error.

Does this command(-ta=multicore) make the code parallelled on CPU.
Does it running on CPU when compiled the code using -ta=multicore. It will running on GPU if i used the -ta=tesla. is my understanding correct?

Does this command(-ta=multicore) make the code parallelled on CPU.
Does it running on CPU when compiled the code using -ta=multicore.

Correct. The flag “-ta” stands for “Target Accelerator”. Hence, “-ta=multicore” says to use a Multicore CPU as the accelerator.

It will running on GPU if i used the -ta=tesla. is my understanding correct?

Correct. “tesla” targets an NVIDIA Tesla device as the accelerator.

-Mat