- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
About 12 years ago, I was asked to port Linux Fortran (gfortran) code to Windows. Back then, the Intel Fortran compiler was ifort. It took some time to get it working with a bunch of help from Steve, but now I am having some issues getting the code to run. We stopped working on this after one month that we had it working, and we did not revisit this project until now. The main concern is the shared memory. I already took a look at the notes on:
Porting Guide for ifort Users to ifx
But I did not find anything about changes on how to set shared memory. For example, I have the following variables that need to be shared between multiple processes:
c <datcol_globals> module defines/exports data defined by the "Data Collection" process to be shared between the parent and child process(es).
c The "Data Collection" process data is built into <datcol_globals.dll> and linked into the application.
c
c In order for the data to be read-write shared, the following must be done:
c
c 1. The variables must be initialized to a non-zero value so that they are placed
c in the .data image section.
c
c 2. The linker command line options are modified to add: /section:.data,RWS
c
c This tells the linker to make the .data section of the DLL read-write shared.
c If this isn't done, then each process will have its own copy of the data.
module data_collection_globals
use ifwin, only: DWORD
use simulation_globals
implicit none
INTEGER(DWORD),DIMENSION(numdcbuf,maxsizedcbuf) :: dc_buffers=999
INTEGER(DWORD),DIMENSION(max_msgtyp,max_tasks) :: last_flushed=99
INTEGER(DWORD),DIMENSION(numdcbuf) :: buff_swap = 999
INTEGER(DWORD),DIMENSION(numdcbuf) :: write_to_point = 999
logical(4),DIMENSION(numdcbuf) :: buf_full = .TRUE.
logical(4) :: dcshutdown = .TRUE.
!dec$ attributes dllexport :: buf_full
!dec$ attributes dllexport :: buff_swap
!dec$ attributes dllexport :: dc_buffers
!dec$ attributes dllexport :: dcshutdown
!dec$ attributes dllexport :: last_flushed
!dec$ attributes dllexport :: write_to_point
end module data_collection_globals
Initially, I was getting the control process to start one of the other processes using the CreateProcess() function, and it was successfully starting the process, but once I noticed that the data was not being shared between the processes, I noticed the note about recompiling the module using /section:.data,RWS. Once I did that, the process is no longer created.
I know this is a loaded question with not much information but does setting up the shared memory between processes still the same with the new compiler. Mind that I had this working 12 years ago, and I know many things might have changed. Sorry, I am very naive in Windows as much of our projects have been done in Linux with the GNU compiler. We are not trying to port the code for good to Windows. Please let me know if you have any questions.
I am using Visual Studio 2022 with the Intel Windows Fortran compiler 2025.1
Any comments/suggestions will be greatly appreciated
Thanks you
Aldo L.
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
John,
Sorry! I think I figured it out.
Thanks again for everybody's help.
Aldo L.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »