Running openacc -gfortran in cluster

Hey everyone!

I’m compiling and running a Fortran 90 program using OpenAcc. I was able to run the code with openacc directives in my local PC using PGI compiler. But now I’m trying to run the same program in a cluster (on a single node which has 4 GPUs - Volta 100) with GCC (compiler version 8.2) and I’m starting to face issues. I run the program 1st using the following command line:-

gfortran -fopenacc --gres=gpu:volta:1 test.f90

and it gives the following error “gfortran: error: unrecognized command line option ‘–gres=gpu:volta:1’”
then I try running it using following command lines; the code runs but the former takes 167 sec and the latter takes 137 sec, compared to the same code I ran in my local PC which took 3.67 sec (GTX 1050).

gfortran -fopenacc test.f90



gfortran -fopenacc -lcuda test.f90

I’m not if my program is utilizing the GPUs or the problem is related to the efficiency of the code with different compilers (as reported here https://www.openacc.org/sites/default/files/inline-images/UserGroupMeeting/OpenACC_Randy_allen_Usergroup.pdf). Any feedback would be helpful. Thank you in advance!

Hi abhi3,

I believe “–gres=gpu:volta:1” is a command when submitting jobs to SLURM and why it doesn’t work with gfortran.

As for the performance of their OpenACC implementation, I don’t have a lot experience with gfortran but know that they have trouble with the “kernels” construct, so you should be using “parallel” instead. Also, you might want to try GNU 9.2 which may have more improvements.

-Mat