mcRUN(1)

๐Ÿ“ฆ
version 3.5+3.5.19 ยท 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute

๐Ÿฆ‹ mcRUN, the manual page (but make it cute) โœจ

okay bestie, welcome to mcRUN(1) โ€” that's the manual name right there, we're just folding it in at the top like a little name tag ๐ŸŽ€. This is the whole page, every last flag, no skips, no cap.


NAME ๐Ÿ’–

mcrun โ€” running mcstas simulations from the command-line ๐ŸŒˆ


SYNOPSIS ๐Ÿงš

mcrun [-cpnN] INSTR [-sndftgahi] params={val|min,max|min,guess,max}...
[-hB][-c CMD][-f FROM][-n NAME][-o DIR][-s SCRIPT]

like, look at her. the way she has so many letters. iconic. ๐Ÿ‘‘


DESCRIPTION ๐ŸŒธ

So the mcrun front-end is your little bestie that gives you a convenient command-line interface for running simulations with the same automatic compilation features. She doesn't just run stuff either โ€” she also hands you a facility for running a series of simulations while varying an input parameter, plus a multiparameter non-linear optimisation. obsessed. ๐Ÿ˜Œ

The command mcrun sim args ... will compile the instrument definition INSTR โ€” like sim.instr for example โ€” (if necessary, bestie, only if necessary) into an executable simulation sim.out. Then she runs sim.out, passing along the argument list args, which is usually a whole lil series of param=value pairs. ๐Ÿ’…

And if you ever forget all this? The -h option will list valid options. she's got you fr fr.


OPTIONS โœจ

  • --version โ€” show the program's version number and then dip out. bye! ๐Ÿ‘‹
  • -h, --help โ€” show this help message and exit ๐Ÿซถ
  • -c, --force-compile โ€” force a rebuild of the instrument. You might need this if any component definitions changed (because in that case mcrun does not automatically recompile, and she will simply not know), or if a new version of mcstas has been installed. rude but valid.
  • -I I โ€” append path I to the McCode search path. this one implies -c btw ๐Ÿ’…
  • --D1=D1 โ€” set extra -D args. implies -c โœจ
  • --D2=D2 โ€” set extra -D args. implies -c โœจ
  • --D3=D3 โ€” set extra -D args. implies -c โœจ
  • -p FILE, --param=FILE โ€” read parameters from file FILE. That file should consist of specifications of the form name =value, separated by spaces or line breaks. You can give multiple -p options together with direct parameter specifications on the command line, no gatekeeping. And if a parameter gets assigned multiple times, later assignments override previous ones โ€” last one in wins, periodt.
  • -N NP, --numpoints=NP โ€” set the number of scan points, varying one or more parameters within specified intervals. A series of simulations like this is called a scan. To specify an interval for a parameter X, you assign it two values separated by a comma. For example, the command mcrun sim.instr -N4 X=2,8 Y=1 would run the simulation defined in sim.instr four times, with X having the values 2, 4, 6, and 8, respectively. After running, results get written to the file mccode.dat by default. That file has one line for each simulation run, giving the values of the scanned input variables along with the integrated intensity and estimated error in all monitors. so much data. so pretty. ๐Ÿ“Š
  • -L, --list โ€” use a fixed list of points for linear scanning ๐Ÿ“‹
  • -M, --multi โ€” run a multi-dimensional scan ๐ŸŒ€
  • --autoplot โ€” open plotter on the generated dataset ๐ŸŽจ
  • --autoplotter=AUTOPLOTTER โ€” specify the plotter used with --autoplot ๐Ÿ’…
  • --embed โ€” store a copy of the instrument file in the output directory ๐Ÿ“ฆ
  • --mpi=NB_CPU โ€” spread the simulation over NB_CPU machines using MPI ๐ŸŒ
  • --openacc โ€” parallelize using openacc โšก
  • --funnel โ€” funneling simulation flow, e.g. for mixed CPU/GPU ๐Ÿ•ณ๏ธ
  • --machines=machines โ€” defines path of MPI machinefile to use in parallel mode ๐Ÿ–ฅ๏ธ
  • --optimise-file=FILE โ€” store scan results in FILE (defaults to: mccode.dat) ๐Ÿ’พ
  • --no-cflags โ€” disable optimising compiler flags for faster compilation ๐Ÿƒ
  • --no-main โ€” do not generate a main(), e.g. for use with mcstas2vitess.pl. Implies -c ๐Ÿšซ
  • --verbose โ€” enable verbose output ๐Ÿ—ฃ๏ธ
  • --write-user-config โ€” generate a user config file ๐Ÿ“
  • --override-config=PATH โ€” load config file from a specific dir ๐Ÿ”€
  • --optimize โ€” optimize instrument variable parameters to maximize monitors ๐Ÿ“ˆ
  • --optimize-maxiter=optimize_maxiter โ€” maximum number of optimization iterations to perform ๐Ÿ”
  • --optimize-tol=optimize_tol โ€” tolerance for optimization termination. When optimize_tol is specified, the selected optimization algorithm sets some relevant solver-specific tolerance(s) equal to optimize-tol. the algorithm is doing its best okay ๐Ÿ˜ญ
  • --optimize-method=optimize_method โ€” optimization solver in ['powell', 'nelder-mead', 'cg', 'bfgs', 'newton-cg', 'l-bfgs-b', 'tnc', 'cobyla', 'slsqp', 'trust-constr', 'dogleg', 'trust-ncg', 'trust-exact', 'trust-krylov'] (default: powell). You can use your custom method method(fun, x0, args, **kwargs, **options). Please refer to scipy documentation for proper use of it: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html?highlight=minimize ๐Ÿ“š
  • --optimize-minimize โ€” choose to minimize the monitors instead of maximize ๐Ÿ”ฝ
  • --optimize-monitor=optimize_monitor โ€” name of a single monitor to optimize (default is to use all) ๐Ÿ‘€
  • --showcfg=ITEM โ€” print selected cfg item and exit (paths are resolved and absolute). Allowed values are "bindir", "libdir", "resourcedir", and "tooldir" ๐Ÿ—‚๏ธ

INSTRUMENT OPTIONS ๐ŸŽ€

  • -s SEED, --seed=SEED โ€” set random seed (must be: SEED != 0). no zero, bestie, she said what she said ๐Ÿšซ
  • -n COUNT, --ncount=COUNT โ€” set number of neutron to simulate ๐Ÿ”ฌ
  • -t trace, --trace=trace โ€” enable trace of neutron through instrument ๐Ÿ‘ฃ
  • -d DIR, --dir=DIR โ€” put all data files in directory DIR. Additionally, the directory will have subdirectories 1, 2, 3, . . . containing all data files output from the different simulations. nested folders, we love an organised queen ๐Ÿ“
  • --format=FORMAT โ€” output data files using format FORMAT, usually McCode or NeXus (format list obtained from .out -h) ๐Ÿงพ
  • --bufsiz=BUFSIZ โ€” Monitor_nD list/buffer-size (defaults to 1000000) ๐Ÿงฎ
  • --vecsize=VECSIZE โ€” vector length in OpenACC parallel scenarios ๐Ÿงต
  • --numgangs=NUMGANGS โ€” number of gangs in OpenACC parallel scenarios ๐Ÿš—
  • --gpu_innerloop=INNERLOOP โ€” maximum particles in an OpenACC kernel run. (If INNERLOOP is smaller than ncount we repeat) ๐Ÿ”„
  • --no-output-files โ€” do not write any data files ๐Ÿšซ๐Ÿ“„
  • -i, --info โ€” detailed instrument information โ„น๏ธ
  • --list-parameters โ€” print the instrument parameters to standard out ๐Ÿ–จ๏ธ
  • --meta-list โ€” print all metadata defining component names ๐Ÿท๏ธ
  • --meta-defined=META_DEFINED โ€” print metadata names for component, or indicate if component:name exists ๐Ÿ”
  • --meta-type=META_TYPE โ€” print metadata type for component:name ๐Ÿ”ค
  • --meta-data=META_DATA โ€” print metadata for component:name ๐Ÿ“ฆ

FILES ๐Ÿ—ƒ๏ธ

  • /usr/share/mcstas/resources
  • /usr/share/mcstas/tools/Python/mccodelib/mccode_config.json
  • ~/.mcstas/mccode_config.json
  • http://www.mcstas.org

the whole file family tree, slay ๐ŸŒณ


EXAMPLES ๐ŸŒŸ

Run the Test_SX example (Single crystal diffraction) ๐Ÿ’Ž

  • mcrun Test_SX.instr -d output_dir -n 1e7 TTH=13.4

look at that. one line. ate. ๐Ÿ”ฅ


AUTHORS ๐Ÿซถ

mcstas Team (mcstas.org)


SEE ALSO ๐ŸŒˆ

mcstas(1), mcdoc(1), mcplot(1), mcrun(1), mcgui(1), mcdisplay(1)

(she's in her own SEE ALSO list btw. main character energy, honestly ๐Ÿ’…)


AUTHORS (yes, again) ๐Ÿ‘‘

MCSTAS neutron Ray Tracing Team.


and that's the whole page, bestie ๐Ÿ’– this one came out of the git source with the mcRUN(1) footer tag on the bottom, so that's the version and the page identity right there โ€” no date on this one, she's timeless like that. go run some simulations, you're gonna do great. periodt โœจ๐Ÿฆ‹๐ŸŽ€

๐Ÿ“ฆ where this page comes from