- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Intel Fortran users,
I come today with a really strange issue with IFORT 11.1.065.
I am used to work with Visual Studio 2008 (C# language)and Intel Fortran 10using pipes. I always found it is a very simple way (and quite robust) to make them communicate without coding wrappers from managed to unmanaged code.
Principle is as following (working this Ifort 10):
1: C# open pipes using "NamedPipeServerStream" type.
public NamedPipes(string pipeName, PipeDirection dir)
{
this.pipeStream = new NamedPipeServerStream(pipeName, dir, 254,
PipeTransmissionMode.Byte, PipeOptions.None,1000000000,1000000000);
this.pipeName = pipeName;
}
2: C# launch Fortran executable and gives arguments to open C# pipe
3: Fortran Executable open pipe (I must connect pipe both way before i can write in it)
C OPEN INPUT MASTER PIPE
OPEN(XPIP1,FILE=ARGV(2),STATUS='UNKNOWN',
* FORM='FORMATTED',ACTION='READ', ERR=998)
4: Fortran Executable proceed a blocking read, waiting C# writing in pipe
READ(XPIP1,'(A100)') YORDER
5: I proceed with a write in C# and the blocking read in Fortran react once pipe contains something
public void FillPipe(string aMessage)
{
StreamWriter sw = new StreamWriter(this.pipeStream);
sw.AutoFlush = true;
sw.WriteLine(aMessage);
}
... and so on.
Problem description
I compiled Fortran 10code with the IFORT 11.1.065 and step 4 in above procedure don't work anymore. When i fill pipe using a C# streamWriter, fortran READ doesn't react.
I tried the same principle using a C++ "writefile". In that case, there is no problem.
Could you help me understand this behaviour?
Thank you for your precious help.
Franois-Xavier Bouchez
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is just a trick with the EOF detection.
Sincerely yours,
F-Xavier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will report a bug to the support and I will post the solution.
Sincerely yours,
F-Xavier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
that is working differently than you expect?
I have little experience with C#, but I would suspect something is going wrong with flushing. What
happens if you explicitly flsuh the pipe, instead of relying on "auto-flush"?
(I recently had a very similar problem, but that was with a Fortran program, compiled with gfortran sending
data over TCP/IP - by sending CRLF things were send to the other side. I still have to figure out what behaviour is to be expected)
Regards,
Arjen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No need to report a seperate bug report to premier.intel.com. I can this this thread private and you can add the test case along with details how to build it here. Its fine if you have already reported it to premier.intel.com.
------
Wendy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Instead of limited the solution to be "private", I would like to request you to consider posting a part of the solution that can be shared with others as well. A "general procedure" may be useful for everyone.
Abhi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
------
Wendy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Intel Fortran forum,
Sorry for reopening this topic but we have kept the 10.1 compiler for this executable for 3 years due to priorities. Now that we have time, we would like to upgrade to Intel XE 2011 compiler. Problem with Intel XE2011 is the same as with 11.1. As a reminder, my code works with Intel 10.
THis time, I have made a lots of experiments and found that, if I add caracters in the pipe (> 1000), the READ statement (100 caracters) unblocks. I remind that the pipe is written by C# executable with a streamwriter and that there is an autoflush.
So, clearly, there is a Intel Fortran compiler behaviour which is different since Intel 11.1.
If my feeling is good, maybe the problem C# - Fortran could also be with Fortran - Fortran, but have not tried.
Are these information sufficient, or do I need to reproduce on a dummy case?
Sincerely yours and thank you so much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What happens when you try to read the C# data through the pipe....
using a C# program?
What happens if (or should I ask are) you supply what would ordinarily be a record terminator for FORTRAN console input (i.e. the RETURN character)?
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What happens when you try to read the C# data through the pipe....
using a C# program?
What happens if (or should I ask are) you supply what would ordinarily be a record terminator for FORTRAN console input (i.e. the RETURN character)?
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page