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

ifort 17 beta: access to the file system from coarray images

Michael_S_17
New Contributor I
177 Views

Hi,

I am currently testing some of ifort's coarray capabilities with the Intel Parallel Studio XE 2017 Beta for Linux (initial release, as well as update 2) on a shared memory computer. From my current experiences, access to the file system does only work on image 1 by now. From other coarray images, I am getting an IOSTAT integer value of 2 (positive) when executing an OPEN statement for a file. Can anyone else also confirm that file access from an ifort 17 coarray program is limited to image 1 only by now? And if so, is this behaviour intentionally?

From my current understanding, access to the file system can't be granted on all coarray images, especially with distributed memory machines. Thus, it would make sense to limit file access to only few coarray images to prevent people from writing coarray programs that can't be successfully executed on a different machine. Since we can't directly access the file system from the other coarray images, we do 'read and write' to (remote) PGAS memory instead.

 

Best Regards

Michael

0 Kudos
4 Replies
Steven_L_Intel1
Employee
177 Views

You should be able to open a file from any image. Standard input is preconnected only on image 1. Standard output is preconnected on all images, and our implementation merges the output into image 1's stream. All units are independent per image.

As you say, accessing files in a distributed application can be a problem, but there's nothing inherent in our coarray support to block you. Got a test program that shows the problem?

0 Kudos
Michael_S_17
New Contributor I
177 Views

Hi Steve,
thanks for the clarification. Then it could be a bug with the ifort 17 beta. I used some rather complex test programs which do work with ifort 15 (and ifort 16 as far as I remember) as well as with gfortran/OpenCoarrays, for example at: https://github.com/MichaelSiehl/MPMD-with-Fortran-2008-Coarrays .
I also tried to reproduce the error with some small example program, but without success so far, the following does work on every image (you must provide the test.txt file):
PROGRAM Main
IMPLICIT NONE
INTEGER :: FileAccessStatus = 0
  !
IF (THIS_IMAGE() == 2) THEN
  !
  OPEN (UNIT=0, IOSTAT=FileAccessStatus, FILE='test.txt', &
      STATUS='OLD', ACCESS='SEQUENTIAL', FORM='FORMATTED', &
      POSITION='REWIND', ACTION='READ', &
      BLANK='NULL', DELIM='APOSTROPHE')
  !
  WRITE(*,*) 'IOSTAT:', FileAccessStatus
  IF (FileAccessStatus .NE. 0) ERROR STOP
  !
  CLOSE (UNIT=0, IOSTAT=FileAccessStatus, STATUS='KEEP')
  !
END IF
  !
END PROGRAM Main
I will do some further investigation to try to figure out the cause of the problem and will give you further information shortly.
Note: I did use two different Linux setups for the ifort 17 beta initial release and the update2 release, so the problem may not be related to my Linux system.
cheers
Michael

0 Kudos
Michael_S_17
New Contributor I
177 Views

I just figured out what the problem is: it is NOT THE FILE ACCESS from coarray images but rather the image-to-image data transfer of character coarray variables. I will set up a small test program shortly and open a new topic for this. This current topic on file access should be closed.
best regards
Michael

0 Kudos
Michael_S_17
New Contributor I
177 Views

Just a brief update: the bug seems to be a very subtle one. In most cases the image-to-image data transfer of character coarray variables (or character components of derived type coarrays) does work. I will try to shorten the problematic code as much as possible to make it easier to survey the cause of the error.

0 Kudos
Reply