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

FORTRAN Code converges slow in Intel Fortran Compiler as Compared to the Digital visual FORTRAN

Qaiser_Bozdar
초보자
1,379 조회수

I have a code that compiles smoothly in Microsoft Visual Developer using Digital visual FORTRAN Professional Edition 5.0A compiler in Win-XP in a virtual box (Oracle) in a INTEL I7 computer having (RAM 16GB). All arrays are declared for example as A(100),B(100),etc. The code executable file converges within 4 minutes. The Code output is correct as per scientific literature and calculations.

I have updated the code as per FORTRAN 90/95. I declared arrays as A(0:100), B(0:100), due to the upper bound error which is 1. Now code takes relatively large time to converge, it takes around 35 minutes, and also have a difference in output as compared to previous version of the code. I am using MVS-2022 and Intel FORTRAN compiler (2024 latest) in an intel I7 computer having (RAM 16GB).

I just changed the array format from A(100) to A(0:100). All of the arrays.

Both codes take 636 iterations to converge to a certain result.

I have also tested the code (old version executable file) in my personal computer, it takes around 11 minutes to converge with correct results. I have a Intel core m3 (8GB RAM). I have tested it again then it converged in 14 minutes.

Qaiser_Bozdar_3-1721244432167.png

Qaiser_Bozdar_0-1721161032199.png

Qaiser_Bozdar_4-1721244474937.png

Qaiser_Bozdar_5-1721244501832.png

 

Look at the following variable declaration (Old code)

Qaiser_Bozdar_0-1721244032859.png

Look at the following variable declaration (New code)

Qaiser_Bozdar_1-1721244303420.png

My task is to converge the code within less time as compared to the old version which converges within 4-mintues with correct results.

0 포인트
4 응답
andrew_4619
명예로운 기여자 III
1,325 조회수
I would suggest showing your compile options. We can only make wild guesses from the information given.
0 포인트
Qaiser_Bozdar
초보자
1,223 조회수

Qaiser_Bozdar_0-1721323582281.pngQaiser_Bozdar_1-1721323607114.png

I suppose this is the debug configuration.

 

0 포인트
andrew_4619
명예로운 기여자 III
1,192 조회수

debug has all optimisation disabled and has additional code checking, it is much slower than release builds. look at the project properties page also.

 

andrew_4619_0-1721341857825.png

 

0 포인트
jimdempseyatthecove
명예로운 기여자 III
1,136 조회수

If your old code used static arrays A(100), B(100), your test code should ALLOCATE(A(100), B(100)...), or if you wish to be more specific, ALLOCATE(A(1:100), B(1:100), ...), .NOT. A(0:100)

Not doing so can result in:

CALL FOO(A)

...

SUBROUTINE FOO(A)

   REAL A(100)

   REAL SUMPTN

   SUMPTN = A(1) ! this references the 1st location of the dummy argument A, which is the caller's actual argument A(0).

 

This may be the cause of your different results.

 

If you need to rearrange your code to use zero based arrays, then you need to check for and correct such errors in programming.

 

Jim Dempsey

0 포인트
응답