Acc set device_num and omp_set_default_device when supplying values greater than number of GPUs?

Hi,

We’re using OpenACC directives to select which device our offloaded do concurrent loops run on in a multi-node/gpu context. what’s the behaviour of !$acc set device_num(n) where n is greater than the available devices on the machine? OpenACC standard says this behaviour is “implementation defined”, but I couldn’t find any NVIDIA documentation explaining the implemented behaviour. Does omp_set_default_device behave similarly?

It round-robins. For example if you have two GPUs, but set n=4, then device 0 will be used. If n=5, then 1 will be used.

I believe OpenMP is the same but haven’t personally tested this.

-Mat

Thanks Mat!