McStas logo McStas - A neutron ray-trace simulation package ILL; PSI; ESS Niels Bohr Institute DTU Physics NEXMAP


About McStas
 Conditions of use
 Project funding

 Other Downloads (share)

Mailing list

Search web/mailinglist

 McStas manual
 Known problems



Links <- UPDATED!

Report bugs


McStas - A neutron ray-trace simulation package

McStas is a general tool for simulating neutron scattering instruments and experiments. It is actively supported by DTU Physics, NBI KU, ESS, PSI and ILL

Simulated scattering from a hollow-cylinder vanadium sample.

The plot shows the intensity of scattered neutrons (red is highest intensity). The sample is at the center of the sphere with the neutron beam coming from the left. Clearly seen is the shadowing effect of the sample causing a lower intensity opposite the beam. Also seen is the effect of the non-symmetric geometry of the sample, causing lower intensity directly above and to the side of the sample.

Recent news

October 2nd, 2020: McStas presentation from the 2020 OpenACC summit now online

Dear all,

The McStas presentation from the OpenACC summit is now online on YouTube.

OpenACC (see is a high-level, compiler-driven approach to GPU-acceleration, and in the video McStas team tech-lead Peter Willendrup gives an overview about neutron scattering, McStas and how the team is porting the code to Nvidia GPU's.

Have a look at

September 10th, 2020: Multi-GPU support in McStas 3 code tree

For Linux systems with multiple Nvidia GPU's the McStas team now has a solution, based on MPI and OpenACC. The images below show 8 NVIDIA GeForce 1080 running BNL_H8 in parallel and profiling-output in NVIDIA Nsight Systems:

8 gpus shown running using nvidia-smi8-gpu profiling output

The plan is to release either another beta or the first "real" McStas 3.0 before the end of 2020.

August 24th, 2020: macOS 11.0 Big Sur beta, hold your horses...

The McStas team has tested the current 2.6.1 release on the beta, and lots of stuff is broken on Big Sur...

We are aware that getting the freshest or forthcoming version of macOS can be tempting, but please wait for an updated McStas release if you aim to do any work with McStas... :-)

May 26th, 2020: Experimental McStas 2.6.1 and McXtrace 1.5 dockers

The combined McStas and McXtrace team have started experimenting with using Docker's for deployment. The advantage is simplified installation and a uniform look and feel / functionality across platforms.

If you feel like giving our experimental docker solutions a spin, have a look at

May 4th, 2020: McStas 2.6.1 released

Dear all,

A new minor-release of McStas, v. 2.6.1 has been built and is ready for download!

Download and installation instructions are available via our GitHub download pages.

The release adresses a few bugs found in the 2.6 release, see the related issue list at GitHub, but is in terms of features and functionality almost identical to 2.6.

Peter Willendrup

April 28th, 2020: McStas 2.6 on Ubuntu 20.04

Dear all,

I have tried out the McStas 2.6 release on the fresh Ubuntu 20.04 release, and my findings are these:

  • Generally, the release works as expected - all of the python tools seem to function well.
  • For the legacy perl tools we have the issue that the OS-provided PDL no longer comes with a PGPLOT plotting-bridge, which affects and
    Can't locate PDL/Graphics/ in @INC (you may need to install the PDL::Graphics::PGPLOT module)
    (@INC contains: /usr/share/mcstas/2.6/tools/Perl/perl/modules /usr/share/mcstas/2.6/tools/Perl/perl /etc/perl
    /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30
    /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl
    /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/mcstas/2.6/tools/Perl/perl/ line 23,  line 207.
    BEGIN failed--compilation aborted at /usr/share/mcstas/2.6/tools/Perl/perl/ line 23,  line 207.
    Compilation failed in require at /usr/bin/ line 2181,  line 207.
  • Of course the recommendation is to simply move to the Python tools, but if you insist to stay with perl, please do a local CPAN-based PDL installation like this:
    sudo cpan install PDL
  • Since a few releases, the default PGPLOT implementation on Ubuntu changed to Giza. Giza seems to now be getting better, see the April 30th 2018 hint if you want the legacy PGPLOT instead.
A new minor release 2.6.1 is on the way, implementing a few bugfixes, see our GitHub issue tracker for more information.

Best regards,
Peter Willendrup

February 27th, 2020: McStas 3.0beta bugfixes etc

  • As we move along with the development on the mcstas-3.0 branch, you may find patched versions of components in the Updates folder found next to the distribution binaries at
  • A first bug with fix: Unfortunately, a buggy last-minute change to the PowderN component before mcstas-3.0beta was built introduced an error which makes it produce 0 scattered intensity. Please find an improved version in the above-mentioned Updates folder. Further bugfixes to this component are expected since the component produces scattering but has certain edge-case issues on GPU, especially at high ncount rates.
  • At any time, know bugs will be listed as issues on GitHub marked with the label of "mcstas-3.0beta"
  • Please do submit issues to GitHub as you find them: This will help in the process toward a stable, official 3.0 release!

February 25th, 2020: McStas 3.0beta technology preview available!

Dear all,

A technology preview for the forthcoming McStas 3.x series is now available for testing!

Main highlights of the release are:

  • New code-generation scheme based on functions instead of #defines
  • Much improved compilation-times, the code is better suited for modern compilers
  • In most cases a speed-up of order 20% on CPU
  • Limited, experimental support for OpenACC acceleration on NVIDIA GPU's
  • Speedups measured using top-notch NVIDIA V100 datacenter cards are in the range of 10-600 with respect to a single-core CPU
  • In essence, you will need a Linux machine with an NVIDIA card and the PGI compiler to make use of the GPU-support

For more details and instructions, please refer to this document on our Wiki

Thanks to:

  • Thanks to all members of the joint McStas-McXtrace team, you guys ROCK!
  • Thanks to Guido Juckeland (HZDR,DE) and Sebastian Alfthan (CSC,FI) who were behind the GPU Hackathons we participated in
  • Thanks to our NVIDIA mentors Vishal Metha, Christian Hundt and Alexey Romanenko

January 24th, 2020: McStas 2.6 release!

Dear all,

A new release of McStas, v. 2.6 has been built and is ready for download!

Download and installation instructions are available via our GitHub download pages.

Selected highligts from the release are listed below. The full list of changes is also available at

Changes in McStas v.2.6, January 24th, 2020

  • McStas 2.6 is the eight release in the 2.x series and fixes various issues with McStas 2.5, plus new developments.
  • Thanks to all contributors of components, instruments etc.! This is what Open Source and McStas is all about!
  • Installation:
  • Fixes of issues from last release:
  • Plus lots of work in general, see the relevant GitHub issues
  • Tools
    • Contribution from Tobias Weber ILL: Python-version of mcresplot.
  • Libraries:
    • Updated version 1.0.0 NCrystal library from T. Kittelmann (ESS) and X.X. Cai (CSNS), distributed with McStas on Unix platforms only. See the CHANGES document for full detail.
    • MCPL library from the same authors now included at v. 1.3.0. See the CHANGES document for full detail.
    • Updated version of the NXS lib from Mirko Boin HZB.
  • Components:
    • Updated Union library from Mads Bertelsen, ESS DMSC including
      • New geometries, mesh (for stl file input in Union setups) and cone (e.g. relevant for describing anvils in pressure cells.
      • New AF_HB_1D_process for modelling 1D antiferromagnetic Heisenberg chains and PhononSimple_process for modelling single-branchg acoustic phonons ala Phonon_simple
    • New SINE2020-developed Union physics processes from Victor Laliena, Uni Zaragoza: Texture_process.comp and IncoherentPhonon_process.comp. See DOI:10.3233/JNR-190117.
    • Shieldinglogger-components from Rodion Kolevatov, IFE for estimating gamma-production in guides:
      • Contributions Dose_calculator and Shielding_calculator
      • Patched versions of optics-components: Elliptic_guide_gravity_shieldinglogger, Guide_channeled_shieldinglogger, Guide_curved_shieldinglogger, Guide_gravity_shieldinglogger, Guide_shieldinglogger
      • Components patched / derived from the "scatterlogger" framework to model Ni and Ti layers seperately: Shielding_log_iterator_Ni_new, Shielding_log_iterator_Ti_new, Shielding_log_iterator_stop, Shielding_log_iterator_total, Shielding_logger.comp, Shielding_logger_stop.comp.
      • See DOI:10.3233/JNR-190123, DOI:10.1016/j.nima.2018.12.069 and DOI:10.3233/JNR-180088.
      • Please note that the included Shielding- and Dose- calculators will only give sensible for guides with borosilicate glass substrate. If the substrate is, e.g. copper, the dose rates from neutrons transmitted through the coating and captured in the substrate will overshoot the coating contribution significantly, so that shielding has to be enforced by few tens of centimeters of concrete.
    • Guide_anyshape_r additions from Peter Link MLZ. Allows describing geometry in OFF format with reflectivity "per" face. Test instrument is Test_guides which has been updated to include this modified component.
    • Vertical_Bender from Andrew Jackson ESS and Richard Heenan STFC. Allows modelling a multi-channel bender that curves vertically down.
    • SANS_spheres2 by Peter Willendrup, derived from Henrich Frilinghaus' SANS_benchmark2. More realistic cross-section calculations than from e.g. Sans_spheres. templateSANS2.instr is the related test instrument.
    • Updated version of Sample_nxs from Mirko Boin HZB.
    • Single_magnetic_crystal.comp is an experimental magnetic csingle crystal model. Its operational model is based on that of Single_crystal.comp but supports SF and NSF magnetic scattering. The present model only supports the SF-NSF paradigm along a given reference vector.
    • PSD_monitor_4PI_spin.comp is a version of PSD_monitor_4PI but with separate SF- and NSF-channels
  • Instruments:
    • Union_test_texture.instr demonstrates use of Texture_process.comp by Victor Laliena. To be used with datafile "coef_Four_L2.txt" found in the installation data-folder. This datafile contains texture information on Zr alloys derived from DOI:10.1016/j.jnucmat.2018.08.003.
    • Union_IncoherentPhonon_test.instr demonstrates use of IncoherentPhonon_process.comp by Victor Laliena. To be used with datafile "dos_meV.txt" found in the installation data-folder.
    • Union_test_mesh.instr demonstrates use of mesh geometry in Union
    • ESS_BIFROST_shielding.instr and PSI_Focus_shielding.instr, demonstration of Shielding_logger concept from Rodion Kolevatov
    • TasResoTest, triple-axis resolution test instrument from Tobias Weber ILL. Can be used with his new tool development
    • Tools_ONION, instrument to investigate q-resolution via Mantid, by Thomas Huegle, ORNL. See also DOI:10.1016/j.nima.2019.162711 and the related python code available at our new "snippet" repository that should eventually replace the old "share" part of this webpage.
    • templateSANS_MCPL, behaves like the normal templateSANS but dumps all events in an MCPL file.
    • MCPL-oriented tool-instruments by Peter Willendrup. See the CHANGES document for full detail.
    • SINE2020-developed McStas_Isotropic_Sqw, McStas_PowderN, McStas_Single_crystal by Erik Knudsen. They have MCPL input/output and are intended for easy use of McStas samples within SIMRES.
    • Test_guides has been modified to include Guide_anyshape_r from Peter Link MLZ.
    • templateSANS2 serves as test instrument for SANS_spheres2.
    • Test_single_magnetic_crystal.instr is a skeleton Laue camera which exemplfies use of Single_magnetic_crystal.comp
  • Datafiles:
    • Klaus Lieutenant from FZJ/Vitess has collected reflectitivy-data from SwissNeutronics, Mirrotron and S-DH, analysed these and fitted the "classical" McStas mirror-reflectivity profile to these. The resulting data have been placed in the data directory under the filenames of
      • SwissNeutronics_mirors_2020.txt
      • Mirrotron_mirors_2020.txt
      • S-DH_mirors_2020.txt.
    • The files are not to be used directly with reflecting components, but can instead be used as lookup-tables for relevant parameters in each case. I.e. for a mirror of nominal m-value m_nom, use m_real, R_0, W and alpha from the relevant table.
- Most other new datafiles are directly related to component- or instrument-additions and have been mentioned above.

We hope you will enjoy this new release!!!

Previous news items: 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001, 2000, 1999, 1998.

Last Modified: Friday, 02-Oct-2020 22:52:05 CEST
Search website mailinglist archive GitHub repos