- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am redirecting the thread to Fortran Forum.
Thanks and Regards
Anoop
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page