Ignore:
Timestamp:
Nov 26, 2008 2:56:05 PM (14 years ago)
Author:
srkline
Message:

Added poor man's threading to the MonteCarlo? calculation.

My guess is that the ran() function from NR is not thread safe (it is non-reentrant). So I simply duplicated Monte_SANSX to Monte_SANSX2, where each incarnation uses a different random number generator, either ran1() or ran3(). This means that currently only two processors are supported. Not a big deal. At least it works.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/XOP_Dev/MonteCarlo/MonteCarlo.r

    r435 r458  
    4949                        NT_FP64 + WAVE_TYPE, 
    5050                }, 
     51                "Monte_SANSX2",         /* function name */ 
     52                F_UTIL | F_THREADSAFE | F_EXTERNAL,                                     /* function category == UTILITY */ 
     53                NT_FP64,                                                        /* return value type */                  
     54                { 
     55                        NT_FP64 + WAVE_TYPE, 
     56                        NT_FP64 + WAVE_TYPE, 
     57                        NT_FP64 + WAVE_TYPE, 
     58                        NT_FP64 + WAVE_TYPE, 
     59                        NT_FP64 + WAVE_TYPE, 
     60                        NT_FP64 + WAVE_TYPE, 
     61                        NT_FP64 + WAVE_TYPE, 
     62                        NT_FP64 + WAVE_TYPE, 
     63                }, 
    5164                 
    5265        } 
Note: See TracChangeset for help on using the changeset viewer.