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

WriteConsoleInput -> read

jansson
Beginner
768 Views
Dear Fortran friends,

I try to get my program to work with "11.1 build 51" as it did in "11.0.072" and a few earlier compilers.

In one thread I use
--
WriteConsoleInput()
--
to write to the console, while another thread wait in a
--
READ(i,20,END=10)strtmp
20 FORMAT(A)
--
to receive the command as a text string.

This used to work well... but then I try with 11.1 and there the fun ends.

Prior to 11.1 the READ exits when WriteConsoleInput() returned and strtmp variable then contain the text message.

The problem I experience is that READ newer exits and hands me the string as it did before I started to use ifort 11.1.
I made sure there is a char(13)(CR) at the end of the "string" in the other (thread) end of the message.
(I also had problems of VS2005 crashing debugging this, but it was solved by adding /debug:parallel to each projekt in my solution and recompiling all.)

I searched the Fortran forum and found a earlier post about a similar design.
http://software.intel.com/en-us/forums/showthread.php?t=39092

Was the behavior of the read intrinsic changed in 11.1 ?

Do you have any idea for how to get READ to finish and get my program to work with version 11.1 of the Windows Fortran compiler?

Cheers,
Magnus

0 Kudos
1 Reply
Steven_L_Intel1
Employee
768 Views
Can you provide a small but complete test case for this problem?
0 Kudos
Reply