openacc seq directive overridden by parallel directive


I have a pretty simple program has a “for loop” coupled with openacc “seq” directive. However, the -Minfo output “Loop is parallelizable” for that code region tagged with “seq” which indicates that this code is scheduled in parallel rather than sequentially.

Here is my code:

#pragma acc for seq
        for(int i = 0; i < NUM; i++){
                float a = 1.0;

Here is my OpenACC Flag in Makefile

ACCFLAGS = -Msafeptr -fast -ta=nvidia,time -Minfo=acc -Minline=levels:3 -acc

Please let me know if I did something wrong.

Thank you,

I don’t think you did anything wrong. I tried a small experiment using your code and the compiler emitted the following messages:

     9, Loop is parallelizable
         Accelerator kernel generated

I then ran the resultant executable, first setting the environment variable ACC_NOTIFY

  • export ACC_NOTIFY=1

I got the following output:

  • launch kernel file=x.c function=foo line=9 device=0 grid=1 block=1 queue=0

It does appear that it ran the kernel sequentially(block=1), even though the compiler output messages don’t seem to suggest this. I will follow up and see about getting the correct message emitted from the compiler.