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

OpenMP Compilation issue in a Fortran C code - OpenMP - Intel Parallel Studio XE 2016

Noemi_Gonzalez
Beginner
317 Views

Hello

I have a Fortran code that communicates with a C code using a DLL.

OpenMP directives was developed for a couple of do loops in the Fortran code and the OpenMP compilation was turn on using the following properties:

OpenMP Conditional Compilation: YES

Process Open MP Directives: Generate Parallel Code (/Qopenmp)

When the compilation is complete  turning on the OpenMP directives, the characters that are passed through the DLL are erroneous . The following example can clarify the issue:

   FORTRAN:

  SUBROUTINE LANDO

!$OMP PARALLEL PRIVATE(I,NQ,II,KII,LETTUCE,KMUD,JJCAL,III,K,KJ,KL)       

!$OMP D

      DO J=1,NSIDG

      END DO  !...END OF LOOP

!$OMP END DO    

!$OMP END PARALLEL  

  END SUBROUTINE LANDO

SUBROUTINE SWFL

CALL DLL_run(PATH1,PATH2,PATH3, step,refreshsw,Stime, timestep, dischin)

END SUBROUTINE SWFL

  C:

__declspec(dllexport) int run(char* f1,char* f2, char* f3, int *sstep, int *refreshsw, double *Stimef, double *ftimestep, double swmm_dischin[10000])

The issue:

Without OpenMP

PATH1=  'C:\ Models\Test\REV 2nd ON\SFRC.IN'

PATH2= 'C:\ Models\Test\REV 2nd ON\SFRC.OUT''

PATH3= 'C:\ Models\Test\REV 2nd ON\SFRC.ERR '

f1= 'C:\ Models\Test\REV 2nd ON\SFRC.IN'

f2= 'C:\ Models\Test\REV 2nd ON\SFRC.OUT''

f3= 'C:\ Models\Test\REV 2nd ON\SFRC.ERR '

 

With OpenMP

TH1=  'C:\ Models\Test\REV 2nd ON\SFRC.IN'

PATH2= 'C:\ Models\Test\REV 2nd ON\SFRC.OUT''

PATH3= 'C:\ Models\Test\REV 2nd ON\SFRC.ERR '

f1= 'C:\ Models\Test\REV 2nd ON\SFRC.IN   C:\ Models\Test\REV 2nd ON\SFRC.OUT    C:\ Models\Test\REV 2nd ON\SFRC.ERR '

f2= 'C:\ Models\Test\REV 2nd ON\SFRC.OUT    C:\ Models\Test\REV 2nd ON\SFRC.ERR ''

f3= 'C:\ Models\Test\REV 2nd ON\SFRC.ERR '

I am completely lost here, this sounds like a compilation issue. Thanks for any help.

GR

0 Kudos
2 Replies
jimdempseyatthecove
Honored Contributor III
317 Views

You are not showing enough of your Fortran code. When posting code samples use the {...}code button.

The output implies that you are not appending a null character to the text of the Fortran string.

Jim Dempsey

0 Kudos
Anoop_M_Intel
Employee
317 Views

I am redirecting the thread to Fortran Forum.

Thanks and Regards
Anoop

0 Kudos
Reply