Software Archive
Read-only legacy content

Runtime Error

saluki
Beginner
921 Views
I am working with one model written in Fortran 77. When I compile it on my PC (P-III, 64MB, Win98) using Compaq Fortran 6 and run it, there is a runtime error "M6201: Math -Sqrt: Domain Error". However, when I run the executable file for the same source code compiled and sent to me from the developers, it runs well. Is it a compatibility or some setup problem? Any help is greatly appreciated. Tibebe.
0 Kudos
8 Replies
Steven_L_Intel1
Employee
921 Views
What version of Visual Fortran are the developers using? Have you tried updating to at least 6.1A to see if anything changes? I doubt it's a "compatibility" or "setup" problem. May be a compiler bug, may be an error in your source code. Impossible to say without an example.

Steve
0 Kudos
Intel_C_Intel
Employee
921 Views
Tibebe,

You need to find out what compiler settings were used by the developers and use these when you are compiling the code. Depending upon the options used, you can obtain vastly different results for code that the developers have not explicitly initialized all the variables. For certain options, unintialized variables will take on zero values, and for other options, unitialized variables will take on the values from the stack or registers. Most likely, you are accessing an uninitialized variable with the SQRT function that is somehow takes on a negative value as its initial value during runtime. If you want to debug the program, you will probably have to resort to print statements in the code around every SQRT function call to track down the error as the problem will probably disappear if you use the debug compilation options.

Tom
0 Kudos
Intel_C_Intel
Employee
921 Views
Thanks Steve & Tom. The Fortran Version the developers are using is 5.0A. I upgraded the compiler I am using from 6 to 6.5 but there is still problem. The compiler settings used by the developers agree with my settings (Compatibility and Fortran Language settings). What more do you think crucial? I checked the values of the variables in the computation prior the program crashed. I don't see any variable with negative value. As the developers are compiling and running the same source code I have without any error, it seems that there is no error in the program. Any help is greatly appreciated.

Thanks Tibebe.
0 Kudos
Intel_C_Intel
Employee
921 Views
Tibebe,

My experience with CVF has invariably shown that there is indeed an error or bug in the code when getting different results from an executable compiled by someone else and one compiled by myself, it is just difficult to track down.

Try compiling it with the debug options and see if the error is reproduced. If so, then it will be relatively easy to find out what is causing the error. If not, then you will have to resort to print statements for the compiler options that reproduce the error.

Tom
0 Kudos
Intel_C_Intel
Employee
921 Views
Thanks Tom.

As you suggested I compiled the source code using the debug option. The same error is appearing. On the line where the error occurred, it was attempting to make computation involving (+,-,* and Sqrt) operations with six variables. Out of the six variables three of them had NaN as a value. What could cause such different results compiling the same source code on different versions of CVF (5.0A and 6.5).

Thanks Tibebe.
0 Kudos
Steven_L_Intel1
Employee
921 Views
Uninitialized variables. Other coding errors.

Try compiling with /fpe:0 (Project..Settings..Fortran..Floating Point..Floating Point Exception Handling..0 That will tend to give errors when "exceptional" floating point values are computed and may give you a clue as to what is going wrong.

Steve
0 Kudos
Intel_C_Intel
Employee
921 Views
Thanks Steve. If uninitialized variables or other coding errors exist why don't they show up when compiled by CVF 5.0A (the compiler the developers are using)?

I compiled with the option you suggested and located where the "exceptional" floating point values computed. But my question is, how can a source code which is compiling and running smooth on CVF version 5.0A gives such error when compiled with CVF 6.5? Is there a possibility to send the source code to you so that you may compile it in different version of CVF to see the result.

Thanks Tibebe.
0 Kudos
Steven_L_Intel1
Employee
921 Views
There could be many reasons for the difference, including more optimization. CVF 6.5 (or even 6.1) is a long way away from 5.0, technologically.

If you think there is a problem with CVF 6.5, then send a ZIP archive of the project, and any data files needed, to us at vf-support@compaq.com with a description of the problem. However, if it's that CVF 6.5 found a program bug that 5.0 didn't, then there's not much for us to do other than say "you're welcome!"

Steve
0 Kudos
Reply