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

Maximum number of Fortran units

ferrad01
Beginner
1,100 Views

Is there a maximum for the number of Fortran units? I am doing an INQUIRE on units 7-99, and the inquire on unit 39 gives:

forrtl: severe (157): Program Exception - access violation

0 Kudos
5 Replies
Les_Neilson
Valued Contributor II
1,100 Views
Quoting - ferrad01

Is there a maximum for the number of Fortran units? I am doing an INQUIRE on units 7-99, and the inquire on unit 39 gives:

forrtl: severe (157): Program Exception - access violation

From the help on Unit Specifier [UNIT=]io-unit:

"The integer is in the range 0 through 2,147,483,643"
So there must be something else wrong with your code.

Can you post the code?

Les

0 Kudos
garylscott1
Beginner
1,100 Views
Quoting - Les Neilson

From the help on Unit Specifier [UNIT=]io-unit:

"The integer is in the range 0 through 2,147,483,643"
So there must be something else wrong with your code.

Can you post the code?

Les


There are operating system limits to the number of simultaneously open files. Unix ulimit -n (?) I think. MS C runtime may have a limit of 512 or 2048...http://msdn.microsoft.com/en-us/library/6e3b887c(VS.71).aspx

0 Kudos
Steven_L_Intel1
Employee
1,100 Views

In any event I would not expect an access violation. Please post an example that shows this problem.

0 Kudos
ferrad01
Beginner
1,100 Views

In any event I would not expect an access violation. Please post an example that shows this problem.


do i=7,99
inquire(i,opened=is_open, named=has_name, name=fff, iostat=ierr)
if(is_open .and. has_name) then
close(i)
endif
enddo

It is not reproduceable in a small code snippet, so I'm guessing the problem must lie elsewhere in our code, but only gets manifested at the end of the run when the units are closed.

When i is 39, I get this on the inquire call:

forrtl: severe (157): Program Exception - access violation
Image PC Routine Line Source
ntdll.dll 7C9369AA Unknown Unknown Unknown
MSVCRT.dll 77C2C3C9 Unknown Unknown Unknown
MSVCRT.dll 77C2C3E7 Unknown Unknown Unknown
MSVCRT.dll 77C2C42E Unknown Unknown Unknown
libifcoremd.dll 00284C18 Unknown Unknown Unknown
libifcoremd.dll 002863C5 Unknown Unknown Unknown
libifcoremd.dll 002861C8 Unknown Unknown Unknown
libifcoremd.dll 002DCE27 Unknown Unknown Unknown
PNet.dll 103B47D5 _NWINSTOP 234 nstop.f90
PNet.dll 103B2763 _NSTOP 64 nstop.f90
PNet.dll 100736DC _MAINPNET 607 mainpnet.f90
pnetstub_ilmpi.ex 0040105E Unknown Unknown Unknown
pnetstub_ilmpi.ex 00401DA9 Unknown Unknown Unknown
pnetstub_ilmpi.ex 00401408 Unknown Unknown Unknown
pnetstub_ilmpi.ex 0040124F Unknown Unknown Unknown
kernel32.dll 7C817067 Unknown Unknown Unknown

0 Kudos
Steven_L_Intel1
Employee
1,100 Views

I see that you have reported this issue to Intel Premier Support. Please work with us there to resolve the problem. My guess is that somewhere else in your program you are corrupting memory used by the run-time library.

0 Kudos
Reply