Re: CVF compiler question, program giving inconsistent results
- From: bmurphy@xxxxxxxxxxx
- Date: 24 Jun 2006 22:24:41 -0700
Thank you for the incredibly quick reply, Brooks.
Run time error checking for "Array and string bounds" is turned on.
There is no Monte Carlo stuff in this code. Although there is a
routine in a support library (not mine) that generates a "random"
starting vector for some iterative calculations. An earlier version of
this program compiled with Powerstation 4.0 does return identical
results on repeated calls.
I've done some more digging, and I think it might be that random vector
generator. In the generator routine a hardcoded seed is used only when
a logical "INITS" variable is TRUE. This is a local variable - not an
argument passed in. Right after the LOGICAL INITS declaration there is
SAVE INITS line.
At this point I'm fairly confident this explains what is happening.
I'm going to have to be very careful, however, about changing this
because it is buried deep in a support library, but there are some
reasons why I need to change this.
So I guess the mystery here is why did Powerstation evidently run this
code differently. I may or may not dig into it to verify that is the
precise reason for the difference.
Cheers,
Brian
Brooks Moses wrote:
bmurphy@xxxxxxxxxxx wrote:
I am using Compaq Visual Fortran 6.0. (CVF).
I have a routine that returns slightly different numerical results when
I call it repeatedly with indentical inputs.
Is it doing a Monte Carlo routine or something that involves random
numbers? (I assume not, but it's the "is it plugged in?" question....)
If not, this is definitely something going wrong.
Are there any compiler switches that might have something to do with
this?
I have the compiler set to generate warnings for the use of
unintialized variables, and I don't get any such warnings.
In general (though I don't know about CVF6 in particular), these don't
always catch everything. Arrays are particularly tricky, because it
could be that you've initialized most of the array but missed one or two
spaces.
Another check that you should definitely enable is the check for
out-of-range array accesses.
- Brooks
--
The "bmoses-nospam" address is valid; no unmunging needed.
.
- Follow-Ups:
- Re: CVF compiler question, program giving inconsistent results
- From: Kevin G. Rhoads
- Re: CVF compiler question, program giving inconsistent results
- From: Steven G. Kargl
- Re: CVF compiler question, program giving inconsistent results
- References:
- CVF compiler question, program giving inconsistent results
- From: bmurphy
- Re: CVF compiler question, program giving inconsistent results
- From: Brooks Moses
- CVF compiler question, program giving inconsistent results
- Prev by Date: Re: CVF compiler question, program giving inconsistent results
- Next by Date: Re: CVF compiler question, program giving inconsistent results
- Previous by thread: Re: CVF compiler question, program giving inconsistent results
- Next by thread: Re: CVF compiler question, program giving inconsistent results
- Index(es):
Relevant Pages
|
Loading