| 1 | .TH mcrun 1 "" "McStas X.Y.Z, Month Day, Year" "USER COMMANDS" |
|---|
| 2 | .SH NAME |
|---|
| 3 | mcrun \- Command-line simulator of the McStas neutron ray-trace simulation package |
|---|
| 4 | .SH SYNOPSIS |
|---|
| 5 | .B mcrun |
|---|
| 6 | [\-cpnN] file.instr [\-sndftgahi] param1={val|min,max} ... |
|---|
| 7 | .SH DESCRIPTION |
|---|
| 8 | The |
|---|
| 9 | .B mcrun |
|---|
| 10 | command is the instrument builder and launcher of the McStas package. |
|---|
| 11 | .PP |
|---|
| 12 | .B McStas |
|---|
| 13 | is a general tool for simulating neutron scattering instruments and experiments. It is actively supported by |
|---|
| 14 | .I Risoe National Laboratory |
|---|
| 15 | and |
|---|
| 16 | .I ILL |
|---|
| 17 | |
|---|
| 18 | .PP |
|---|
| 19 | McStas is based on a compiler [mcstas(1)] that reads a high-level specification language defining the instrument to be simulated and produces C code that performs the Monte Carlo Simulation. The system is very fast in use, both when setting up the instrument definition and when doing calculations. |
|---|
| 20 | .PP |
|---|
| 21 | McStas supports triple-axis, time-of-flight instruments, and polarised neutrons. It comes with a comprehensive manual and a library of well-tested components that include most standard elements of neutron scattering instruments, including steady-state and pulsed sources, monochromators/analysers, guides, collimators, vanadium and powder samples, velocity selectors and choppers, and a variety of detectors. |
|---|
| 22 | .PP |
|---|
| 23 | The package consists of the following user commands: |
|---|
| 24 | .TP |
|---|
| 25 | mcgui(1) |
|---|
| 26 | is the graphical user interface. Then use the |
|---|
| 27 | .I Neutron Site |
|---|
| 28 | menu to select an example instrument, and access the whole documentation for the |
|---|
| 29 | .I Help |
|---|
| 30 | menu. It contains an instrument editor, methods to plot simulation results, and much more |
|---|
| 31 | .TP |
|---|
| 32 | .B mcrun(1) |
|---|
| 33 | is the command-line tool for building and running simulations |
|---|
| 34 | .TP |
|---|
| 35 | mcplot(1) |
|---|
| 36 | is the simulation results plotting tool |
|---|
| 37 | .TP |
|---|
| 38 | mcdisplay(1) |
|---|
| 39 | is the instrument geometry and neutron trajectory viewer |
|---|
| 40 | .TP |
|---|
| 41 | mcdoc(1) |
|---|
| 42 | is the documentation tool |
|---|
| 43 | .TP |
|---|
| 44 | mcstas(1) |
|---|
| 45 | is the instrument compiler |
|---|
| 46 | .TP |
|---|
| 47 | mcconvert(1) |
|---|
| 48 | can convert Matlab data files into Scilab data files, and vice-versa. It also handles data sets with binary encoding. It also handles parameter scan results. |
|---|
| 49 | .TP |
|---|
| 50 | mcformat(1) |
|---|
| 51 | can transform any text data set from one format to an other. It does not support conversion from binary data sets. It can also merge equivalent results. |
|---|
| 52 | .PP |
|---|
| 53 | We encourage users to refer to the User and Component Manuals, which are available with the command |
|---|
| 54 | .B |
|---|
| 55 | mcdoc |
|---|
| 56 | .P |
|---|
| 57 | .SH OPTIONS |
|---|
| 58 | .TP |
|---|
| 59 | \-h | \-\-help |
|---|
| 60 | displays the command help |
|---|
| 61 | .TP |
|---|
| 62 | \-N NP | \-\-numpoints=NP |
|---|
| 63 | Set number of scan points or maximum iteration number for optimization |
|---|
| 64 | .TP |
|---|
| 65 | \-\-mpi=NB_CPU |
|---|
| 66 | Spread simulation over NB_CPU machines using MPI (when MPICH has been installed) |
|---|
| 67 | .TP |
|---|
| 68 | \-\-machines=MACHINES |
|---|
| 69 | Read machine names from file MACHINES (MPI/grid) |
|---|
| 70 | .TP |
|---|
| 71 | \-\-optim=COMP |
|---|
| 72 | Add COMP to the list of monitors to maximize (optimization criteria) |
|---|
| 73 | .TP |
|---|
| 74 | \-\-optim |
|---|
| 75 | Maximize all monitors |
|---|
| 76 | .TP |
|---|
| 77 | \-\-optim-prec=PREC |
|---|
| 78 | Relative requested accuracy of criteria for optimization (1e-3) |
|---|
| 79 | .TP |
|---|
| 80 | \-\-test |
|---|
| 81 | Execute McStas selftest and generate report |
|---|
| 82 | .SH INSTRUMENT OPTIONS |
|---|
| 83 | These options apply to the generated instrument code (foo.c and foo.out) |
|---|
| 84 | .TP |
|---|
| 85 | \-s SEED | \-\-seed=SEED |
|---|
| 86 | Set random seed (must be non zero) |
|---|
| 87 | .TP |
|---|
| 88 | \-n COUNT | \-\-ncount=COUNT |
|---|
| 89 | Set number of neutrons to simulate |
|---|
| 90 | .TP |
|---|
| 91 | \-d DIR | \-\-dir=DIR |
|---|
| 92 | Put all data files in directory DIR |
|---|
| 93 | .TP |
|---|
| 94 | \-f FILE | \-\-file=FILE |
|---|
| 95 | Put all data in a single file |
|---|
| 96 | .TP |
|---|
| 97 | \-t | \-\-trace |
|---|
| 98 | Enable trace of neutron through instrument (must have been set during code generation with mcstas(1)). This is necessary for mcdisplay(1) to run |
|---|
| 99 | .TP |
|---|
| 100 | \-g | \-\-gravitation |
|---|
| 101 | Enable gravitation for all trajectories |
|---|
| 102 | .TP |
|---|
| 103 | \-a | \-\-data-only |
|---|
| 104 | Do not put any headers in the data files |
|---|
| 105 | .TP |
|---|
| 106 | \-\-no-output-files |
|---|
| 107 | Do not write any data files |
|---|
| 108 | .TP |
|---|
| 109 | \-h | \-\-help |
|---|
| 110 | Show help message for the instrument |
|---|
| 111 | .TP |
|---|
| 112 | \-i | \-\-info |
|---|
| 113 | Detailed instrument information, including valid parameters |
|---|
| 114 | .TP |
|---|
| 115 | \-\-format=FORMAT |
|---|
| 116 | Output data files using format FORMAT (format list obtained from foo.out -h, e.g. Matlab, Scilab, PGPLOT, HTML, XML, Octave) |
|---|
| 117 | .SH EXAMPLES |
|---|
| 118 | The three following examples are equivalent to the single command: |
|---|
| 119 | mcrun -c foo.instr param1=value1 ... |
|---|
| 120 | .TP |
|---|
| 121 | Typical usage (forcing to recompile instrument) |
|---|
| 122 | .B mcrun |
|---|
| 123 | -c foo.instr param1=value1 ... |
|---|
| 124 | .SH ENVIRONMENT |
|---|
| 125 | The |
|---|
| 126 | .B MCSTAS |
|---|
| 127 | environment variable may be set to define the McStas library location. This is /usr/local/lib/mcstas on Linux systems. Executables are usually located in /usr/local/bin. |
|---|
| 128 | The McStas configuration file is MCSTAS/tools/perl/mcstas_config.perl |
|---|
| 129 | .P |
|---|
| 130 | The |
|---|
| 131 | .B MCSTAS_FORMAT |
|---|
| 132 | environment variable may be set to define the default data format used for storing results. This is usually 'PGPLOT', 'Matlab', or 'Scilab'. |
|---|
| 133 | .P |
|---|
| 134 | The |
|---|
| 135 | .B |
|---|
| 136 | MCSTAS_CC |
|---|
| 137 | environment variable may be set to define the compiler to use (e.g. gcc) |
|---|
| 138 | .P |
|---|
| 139 | The |
|---|
| 140 | .B |
|---|
| 141 | MCSTAS_CFLAGS |
|---|
| 142 | environment variable may be set to define the options for compilation (e.g. -O2) |
|---|
| 143 | .SH BUGS |
|---|
| 144 | Some implementations of Perl for Windows do not support background execution. This may hang mcrun (and mcgui). |
|---|
| 145 | McStas is a large package, and bugs might be found. If so, please report to |
|---|
| 146 | .B http://mcstas.org/McZilla/ |
|---|
| 147 | and the mailing list |
|---|
| 148 | .B neutron-mc@risoe.dk |
|---|
| 149 | .SH EXIT STATUS |
|---|
| 150 | mcrun returns 1 in case of error, 0 when all went fine |
|---|
| 151 | .SH AUTHOR |
|---|
| 152 | Peter Kjaer Willendrup, Emmanuel FARHI, Kim Lefmann, and Klaus Lieutenant |
|---|
| 153 | .SH SEE ALSO |
|---|
| 154 | mcstas(1), mcrun(1), mcdisplay(1), mcplot(1), mcgui(1), mcdoc(1), mcformat(1), mcconvert(1) |
|---|
| 155 | .P |
|---|
| 156 | web site: <http://www.mcstas.org> |
|---|
| 157 | .P |
|---|
| 158 | mailing list: <mailto:neutron-mc@risoe.dk> |
|---|
| 159 | .P |
|---|
| 160 | matlab(1), idl(1), scilab(1), octave(1), vitess(1), NISP(1), restrax(1), mcnp(1), tripoli(1) |
|---|