mcRUN(1)
๐ฆ 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 casemcrundoes 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 pathIto the McCode search path. this one implies-cbtw ๐--D1=D1โ set extra-Dargs. implies-cโจ--D2=D2โ set extra-Dargs. implies-cโจ--D3=D3โ set extra-Dargs. implies-cโจ-p FILE,--param=FILEโ read parameters from fileFILE. That file should consist of specifications of the formname =value, separated by spaces or line breaks. You can give multiple-poptions 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 parameterX, you assign it two values separated by a comma. For example, the commandmcrun sim.instr -N4 X=2,8 Y=1would run the simulation defined insim.instrfour times, withXhaving the values 2, 4, 6, and 8, respectively. After running, results get written to the filemccode.datby 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 overNB_CPUmachines 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 inFILE(defaults to:mccode.dat) ๐พ--no-cflagsโ disable optimising compiler flags for faster compilation ๐--no-mainโ do not generate amain(), e.g. for use withmcstas2vitess.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. Whenoptimize_tolis specified, the selected optimization algorithm sets some relevant solver-specific tolerance(s) equal tooptimize-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 methodmethod(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 directoryDIR. Additionally, the directory will have subdirectories1,2,3, . . . containing all data files output from the different simulations. nested folders, we love an organised queen ๐--format=FORMATโ output data files using formatFORMAT, usually McCode or NeXus (format list obtained from.out -h) ๐งพ--bufsiz=BUFSIZโ Monitor_nD list/buffer-size (defaults to1000000) ๐งฎ--vecsize=VECSIZEโ vector length in OpenACC parallel scenarios ๐งต--numgangs=NUMGANGSโ number ofgangsin OpenACC parallel scenarios ๐--gpu_innerloop=INNERLOOPโ maximum particles in an OpenACC kernel run. (IfINNERLOOPis smaller thanncountwe 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 ifcomponent:nameexists ๐--meta-type=META_TYPEโ print metadata type forcomponent:name๐ค--meta-data=META_DATAโ print metadata forcomponent:name๐ฆ
FILES ๐๏ธ
/usr/share/mcstas/resources/usr/share/mcstas/tools/Python/mccodelib/mccode_config.json~/.mcstas/mccode_config.jsonhttp://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
- debian trixie: mcstas-mcrun 3.5+3.5.19+ds5-2 ยท GPL-3.0-only
- ubuntu questing: mcstas-mcrun 3.5+3.5.19+ds5-2
- ubuntu resolute: mcstas-mcrun 3.5+3.5.19+ds5-2build1 ยท GPL-3.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms