source: sans/XOP_Dev/MonteCarlo/MonteCarlo.r @ 553

Last change on this file since 553 was 458, checked in by srkline, 14 years ago

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 size: 1.6 KB
Line 
1#include "XOPStandardHeaders.r"
2
3resource 'vers' (1) {                                           /* XOP version info */
4        0x01, 0x00, final, 0x00, 0,                             /* version bytes and country integer */
5        "1.00",
6        "1.00, © 1993 WaveMetrics, Inc., all rights reserved."
7};
8
9resource 'vers' (2) {                                           /* Igor version info */
10        0x05, 0x00, release, 0x00, 0,                   /* version bytes and country integer */
11        "5.00",
12        "(for Igor 5.00 or later)"
13};
14
15resource 'STR#' (1100) {                                        /* custom error messages */
16        {
17                /* [1] */
18                "WaveAccess requires Igor Pro 5.0 or later.",
19                /* [2] */
20                "Wave does not exist.",
21                /* [3] */
22                "This function requires a 3D wave.",
23        }
24};
25
26/* no menu item */
27
28resource 'XOPI' (1100) {
29        XOP_VERSION,                                                    // XOP protocol version.
30        DEV_SYS_CODE,                                                   // Development system information.
31        0,                                                                              // Obsolete - set to zero.
32        0,                                                                              // Obsolete - set to zero.
33        XOP_TOOLKIT_VERSION,                                    // XOP Toolkit version.
34};
35
36resource 'XOPF' (1100) {
37        {
38                "Monte_SANSX",          /* function name */
39                F_UTIL | F_THREADSAFE | F_EXTERNAL,                                     /* function category == UTILITY */
40                NT_FP64,                                                        /* return value type */                 
41                {
42                        NT_FP64 + WAVE_TYPE,
43                        NT_FP64 + WAVE_TYPE,
44                        NT_FP64 + WAVE_TYPE,
45                        NT_FP64 + WAVE_TYPE,
46                        NT_FP64 + WAVE_TYPE,
47                        NT_FP64 + WAVE_TYPE,
48                        NT_FP64 + WAVE_TYPE,
49                        NT_FP64 + WAVE_TYPE,
50                },
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                },
64               
65        }
66};
Note: See TracBrowser for help on using the repository browser.