Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

OpenMP Collapse

fah10
New Contributor I
522 Views
Hi,
I'm trying to parallelize 3 nested loops with OpenMP. I use
the collapse(3) statement. The code works, but the collapse
statement has no effect. If the size of the outermost loop is 1,
the program runs with only one thread.
Is this a bug? Is there a way to get it working with the collapse
statement? Merging the loops 'by-hand' is unfortunately no option.

Cheers, Fabian
0 Kudos
2 Replies
TimP
Honored Contributor III
522 Views
The current compilers have always warned me when they ignored collapse. If an outer loop of length 1 were suitable for collapse(), I don't see why you wouldn't remove it yourself.
0 Kudos
fah10
New Contributor I
522 Views
Quoting - tim18
The current compilers have always warned me when they ignored collapse. If an outer loop of length 1 were suitable for collapse(), I don't see why you wouldn't remove it yourself.

I don't get any warnings. Even if the outer loop has a length >1, the collapse does not produce the expected speedup. The collapse feature would make life much easier and I just don't understand why it's not working.

0 Kudos
Reply