Re: Debugging stochastic programs



On 23 Jan 2006 04:40:13 -0800, AN O'Nymous <a_n_onymous80@xxxxxxxxxxx>
wrote in <1138020013.152560.292130@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>:

> Dr Ivan D. Reid wrote:

>> Turn on bounds checking, and look very carefully for mismatched
>> sub-program parameters (esp. if sections are compiled separately).

> It is one program compiled as a whole, using Intel FC 8.0 for Linux.
> How do I turn on bounds checking?

I looked at the on-line documentation for V9.0; probably -CB or
-check bounds in your compiler flags. If you are using arrays heavily, this
can significantly increase run times, unfortunately.

> I don't have such a line in my code but an example of what I'm saying
> would be:
> Call rng(random,seed)

> temp = 1.0/random

> The above code would be fine for all values except for a particular
> random value of 0.

Yes, of course your documentation should note whether the RNG
returns [0,1) (the usual) or (0,1] or [0,1] (less usual). I had to change
my logic once in a MC for just this reason, tho' it was log(0.0) rather than
dividing by zero.

If you think it's some particular value and you can isolate it to
one particular routine, you could try excercising that routine with all
possible random numbers in sequence (typically (0 to 2^24-1)/2^24 for single
precision).

> How do people normally debug a stochastic program that only crashes
> after 1 day and is otherwise fine in 99.9% of the other runs?

With great care and patience.

--
Ivan Reid, Electronic & Computer Engineering, ___ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".
.



Relevant Pages

  • Re: Looking for a free basic compiler for DOS
    ... BC for 7.1 had a lot of compiler switchable options, ... NEVER compile from the ide. ... One trivial example: I have a routine declared as: ... were no manuals, just a readme file. ...
    (comp.lang.basic.misc)
  • Re: SAMBA for VMS (The saga continues!)
    ... > callee (substitute function) code seems small to me. ... determine that the OS routine is now available. ... >>instructions and also disabling the compiler optimizer that you can rely ... they upgrade VMS and then try to install an existing package. ...
    (comp.os.vms)
  • Generic Maze Program Example 1
    ... This is the DOS DPMI version of the compiler in Rick van Norman's ... The original code for this was done by Larry Myers, ... routine that Larry used. ... press the #5 key on the numeric keypad. ...
    (comp.lang.forth)
  • Re: SAMBA for VMS (The saga continues!)
    ... Because it is the only way to prevent conflicts with the compiler ... optimizer and with shared images that may be loaded on any platform. ... This is the case on some modern UNIX platforms and especially on OpenVMS ... they were reserved names as far as global routine names are concerned. ...
    (comp.os.vms)
  • Re: Problem with Return Value from a Function
    ... It was always possible to write an assembly language routine that could be called from PL/I as a function and the location to receive the returned value was passed by reference as an n+1st argument. ... Function references to assembler routines were only possible if the ASSEMBLER option was *not* used, thus the compiler was unaware the the routine being called was an assembler routine and perforce must have compiled the same linkage it would compile when it was calling a routine written in PL/I. ... but I agree that not assigning at all would ...
    (comp.lang.pl1)