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

Inter-process communication

Lei_T_
Einsteiger
1.003Aufrufe

Hello,

I saw some postings in this forum about using Pipe for inter-process communication. I try to write a Fortran code to implement this idea but ifort does not recognize CreatePipe. What do I miss here? Any hint is highly appreciated,

0 Kudos
4 Antworten
mecej4
Geehrter Beitragender III
1.003Aufrufe

If you wish to make calls to the Windows API/OS from Fortran, you need to do so through an interface library designed for that purpose. Fortran is a high level language and does not "know" about OS-specific functions/subroutines.

jimdempseyatthecove
Geehrter Beitragender III
1.003Aufrufe

Are the processes residing on the same node (SMP)?

If so, do some research on memory mapped files. The is a relatively easy way for two processes to have a shared memory buffer between them.

Jim Dempsey

Anthony_Richards
Neuer Beitragender I
1.003Aufrufe

Do a forum search for 'pipe' and you will get some help from previous posts.

For example, try this one:

https://software.intel.com/en-us/forums/topic/299693

Steven_L_Intel1
Mitarbeiter
1.003Aufrufe

CreatePipe is defined in module KERNEL32. You would need to add:

use kernel32

to make that declaration visible. But as it creates an anonymous pipe, you'd need to use Windows API routines to read and write it. You could alternatively use CreateNamedPipe and then open it using the \\.\pipe\pipename filename syntax (I think this works.)

Antworten