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

Compiler code parsing error

David_DiLaura1
New Contributor I
750 Views

Steve,

I use /Qopenmp_stubs for my debug compiles and /Qopenmp for my release compiles. I have thought that this would allow me to leave the source otherwise unmodified. But my OpenMP parallel loop declaration(s) usually span several lines and I use ampersands to indicate source line continuations. The compiler throws a syntax error for /Qopenmp_stubs but doe NOT for /Qopenmp.

Example bit of code:

CALL OMP_SET_NUM_THREADS(4)
MemForEachStack = 16000000
call kmp_set_stacksize_s(MemForEachStack)
NumChunk = NumX/100
!$omp parallel do																																		&
					default(private),																													&
					firstprivate( NumX, NumY, NumSurf, NumLum),																							&
					shared( DeltaX, DeltaY, Xmin, Ymin, A, B, C, Alum, Blum, Clum, normals, LumNormals, V, Vlum, Vmax, VmaxLum, Vmin, VminLum, 			&
					LumQuadrantBlockerList,	NumSurfLum, ConfigFactor, pi, EmitterExitance, EmitterBlockerDividerPlanes, NumEmitterBlockerDividerPlanes,	&
					SeparationDimsToUse),																												&
					schedule(dynamic, NumChunk)

The syntax error is:

error #5082: Syntax error, found 'DEFAULT' when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK PROGRAM BLOCKDATA MODULE INTEGER REAL COMPLEX ...

This syntax error is not generated when I compiler /Qopenmp. The only way I can avoid this difference in behavior is to abuse free-format Fortran and place the entire parallel loop declaration on a single line, however long. Nothing fatal, but certainly annoying. Can you put this in the queue for things to fix?

David

0 Kudos
2 Replies
Steven_L_Intel1
Employee
750 Views

You aren't continuing the directives correctly. The manual says (emphasis mine):

In free form, the initial line of the directive ends with an ampersand followed by an optional comment beginning with an exclamation point. Each continued line of the directive has the directive prefix optionally preceded by blanks or tabs, followed by an ampersand optionally preceded by blanks or tabs. 

So what you want is this (I removed many tabs):

!$omp parallel do	&
!$omp &		default(private),	&
!$omp &		firstprivate( NumX, NumY, NumSurf, NumLum),	&
!$omp &		shared( DeltaX, DeltaY, Xmin, Ymin, A, B, C, Alum, Blum, Clum, normals, LumNormals, V, Vlum, Vmax, VmaxLum, Vmin, VminLum, 			&
!$omp &		LumQuadrantBlockerList,	NumSurfLum, ConfigFactor, pi, EmitterExitance, EmitterBlockerDividerPlanes, NumEmitterBlockerDividerPlanes,	&
!$omp &		SeparationDimsToUse),	&
!$omp &		schedule(dynamic, NumChunk)

 

0 Kudos
David_DiLaura1
New Contributor I
750 Views

 

 . . . well I'll be!

D

0 Kudos
Reply