From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,cf4ba3d07912d446 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1094ba,cf4ba3d07912d446 X-Google-Attributes: gid1094ba,public From: robk@nntp.ucs.ubc.ca (Rob Komar) Subject: Re: Mysterious data corruption in Fortran with -automatic Date: 1998/06/06 Message-ID: <6la9hl$bfj$3@nntp.ucs.ubc.ca>#1/1 X-Deja-AN: 360021196 References: <01bd9013$76f09aa0$6f242499@stupidwin95> <35774C1A.2985A59E@rhea.umd.edu> <01bd9039$7d242ba0$LocalHost@stupidwin95> <35780D53.849F9C05@ibm.net> <35783CAA.C0907F50@rhea.umd.edu> Followup-To: comp.sys.dec,comp.lang.fortran Organization: The University of British Columbia Newsgroups: comp.sys.dec,comp.lang.fortran Jeffrey J. Potoff (jpotoff@rhea.umd.edu) wrote: : : I write code in Fortran 90 for the Monte Carlo simulation of a : variety of fluids. Most of my work is in the critical behavior : of mixtures. The codes are not terribly complex (at least not to : me), but can be quite long. They all compile with whatever : optimization I choose and give me the exact same answers regardless : of optimization level. All the codes I have written have always : done that. If they didn't, I knew there was a bug (almost always : in memory allocation) in the code. Hi, if you run your code on x86 machines and always get the same answer regardless of optimization level, then I'd like to hear from you on how you accomplish that. I work on particle physics Monte Carlo simulations on x86 machines, and have a devil of a time getting the results to be the same at different levels of optimization. The transcendental functions built into the 387 FPU always return the result in double extended precision, and I find that I can get different results depending on whether the compiler stores the result in a memory location first, or uses it directly in a calculation. Which it chooses to do can depend on the level of optimization. If you know how to get around this, please E-mail me at the address below. Cheers, Robert Komar Physics Dept., Univ. of British Columbia, Canada (stationed at the Sudbury Neutrino Observatory) My mail address can be got from the following Unix command: echo 'robkviaphysicsZubcZca' | tr 'Z' '.' | sed 's/via/@/'