Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26758 Discussions

compiler default on # of open files allowed

Scott_L_
New Contributor I
158 Views

Is there some configuration setting on the intel Fortran (version 17.1 on Linux) installation setting some limit on the number of open files allowed for executables built with the compiler?   We just had the ifort installation we'd been using get deleted;  we switched to another installation in another location.   Now we have the executables built with this compiler install executing an open statement returning iostat=603 running the same code on Linux.   The same code and input data runs fine on windows x64 also with ifort 17.1.  The file in question does exist and looks like it should.  

 

thanks

scott

 

0 Kudos
5 Replies
Steve_Lionel
Black Belt Retired Employee
158 Views

There is no limit in Intel Fortran - it's the OS doing this, though it is interesting that you are seeing a difference depending on compiler version. I'll note that you've asked about Linux in the Windows forum.

The first thing I'd do is follow the OPEN call with code that, if the OPEN fails, calls ERRSNS and look at the value returned in the sys_err argument. That will be an errno(2) value which you can look up. 

It might also be interesting to temporarily remove the IOSTAT and let the error be signaled with the displayed message - it might have some more info.

Scott_L_
New Contributor I
158 Views

Is there a module that must be included to access errsns?  ifport didnt' find it.  I did not find a note about how to make it visible.

sorry, this should be linux

Steve_Lionel
Black Belt Retired Employee
158 Views

It's an intrinsic in recent versions. Make sure you are passing it valid arguments.

Scott_L_
New Contributor I
158 Views

I am using version 17.0.5.  on Linux.  We had been using 17.1.  18.0 works.

I copied this from the documentation

CALL ERRSNS (SYS_ERR=I1, STAT=I2, UNIT=I4)

 

it is not recognized.

 

 

 

declared integer(kind=4) i1,i2,i4

Is or was there an issue with getcwd?    I ran strace and get tons of messages

getcwd("/pw/data/DDS/m313133/acsys/v_mapstart/at/BA_1B/working_1_iter", 4096) = 62
stat("/pw/data/DDS/m313133/acsys/v_mapstart/at/BA_1B/working_1_iter/ch.MAP", {st_mode=S_IFREG|0770, st_size=11457, ...}) = 0
open(".", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EMFILE (Too many open files)
open(".", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EMFILE (Too many open files)
getcwd("/pw/data/DDS/m313133/acsys/v_mapstart/at/BA_1B/working_1_iter", 4096) = 62

 

where getcwd seems to open but not close

 

This seems vaguely familiar when we first ported to Linux.

Steve_Lionel
Black Belt Retired Employee
158 Views

It looks as if the documentation is wrong about the keywords. I will report this to Intel. You can just pass two arguments without a keyword.

At this point I suggest you come up with a small reproducer and send it to Intel support

Reply