[NOBUGS] McStas 3.0 release - modernised code-generator and GPU support

Peter Kjær Willendrup pkwi at fysik.dtu.dk
Tue Dec 15 12:49:50 GMT 2020

Dear all,

McStas, v. 3.0, our next-generation code generator and support for NVIDIA GPU's via OpenACC has been built and is ready for download!

Download and installation instructions are available via our GitHub download pages<https://github.com/McStasMcXtrace/McCode/tree/master/INSTALL-McStas>.

Selected highligts from the release are listed below. The full list of changes is also available at http://mcstas.org/CHANGES_McStas.


  *   Thanks to all members of the joint McStas-McXtrace team, you guys ROCK!
  *   A special thanks to Jakob Garde who has continued to contribute (unpaid!) to the 3.0 efforts even after leaving DTU.
  *   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 RomanenkoMain new features and changes:

  1.  New code-generation scheme based on functions instead of #defines, which brings
     *   Much improved compilation-times, the code is better suited for modern compilers
     *   In most cases a speed-up of order 20%
     *   The neutron _particle is now represented by a struct
     *   The component types and instances are also represented by structs
     *   New instrument section of USERVARS %{ double example_flag; %} which enriches the _particle struct
     *   Further, the new cogen implements support for Nvidia GPU's, for details see point 2 below.
  2.  Support for OpenACC acceleration on NVIDIA GPU's on Linux systems
     *   #pragma driven, inserted by the code-generation, but also implemented in libs and comps
     *   Speedups measured using top-notch NVIDIA V100 datacenter cards are in the range of 10-600 with respect to a single-core of a modern CPU.
     *   Platform support / compiler configuration:
        *   Required compiler for GPU/OpenACC: NVIDIA HPC SDK 20.x or newer. Community edition works fine
        *   Required GPU hardware: NVIDIA Tesla card + configured driver
        *   Windows: At this point UNSUPPORTED for GPU/OpenACC. Support should come with WSL 2.0 or via native support from NVIDIA.
        *   macOS: At this point UNSUPPORTED for OpenACC since NVIDIA does not ship a package for this platform.
        *   Linux: Full acceleration support with GPU, and with CPU/multicore.
     *   Tool support
        *   On Linux and macOS mcrun is preconfigured so that mcrun -c --openacc compiles with:
        *   Linux: nvc -ta:tesla,managed,deepcopy -DOPENACC
        *   Linux: You may configure for use on CPU/multicore via: nvc -ta:multicore -DOPENACC
        *   The --funnel option can be used to launch the FUNNEL simulation flow, see description below.
        *   For both of the above, adding -Minfo:accel will output verbose information on parallelisation
        *   In mcgui, the mcrun --openacc configuration can be selected via the preferences
        *   Both mcgui and mcrun allow combining --openacc and --mpi if you have multiple GPU's available.
  3.  Special McStas 3.0 grammar for mixed CPU/GPU mode:
     *   A "FUNNEL" mode has been added, which allows
        *   Mixed GPU/CPU mode, were sections of the instrument are executed on each device type, with copying of neutron-bunches back and forth.
        *   When this instrument grammar is specified, it signifies that the component should be executed on CPU rather than GPU. CPU SPLIT 10 COMPONENT Sample = Something()
        *   Sections before and after that are not marked CPU will be executed on GPU.
        *   If a component includes the NOACC token in the component header, the CPU-mode is forced through the compilation, as it signifies that the component does NOT support GPU. This is for the time being the case for Union_master. (Support is expected to come with McStas 3.1)
  4.  Interoperability with McStas 2.7
     *   Support for MCPL event interchange has been added through MCPL_input and MCPL_output components, that work both on CPU and GPU for McStas 3.0. Note however that targeting GPU, MCPL_input reads ALL particle events durin INITIALIZE and MCPL_output writes ALL particle events during SAVE, whereas when using CPU in 3.0 or 2.7, reads and writes happen during the TRACE flow.
  5.  Known limitations
     *   The Union subsystem works on CPU only for now, but can be used in the mixed GPU/CPU funnnel mode as mentioned above. Union_master is a NOACC component.
     *   The same solution is applied in use of the NCrystal_sample and will eventually come for Sample_nxs.
     *   Not all features of all components correspond to those from McStas 2.7, but all essential components have beenfully ported from the 2.7 tree to the 3.0 tree. Hence, some parts distributed with McStas 2.7 will either not exist in the 3.0 release or may not function, due to either: (1) very specialised features (2) maintainability issues or (3) use ofcomplex algorithms.
     *   Generally, most components/instruments are now ported to our OpenACC based GPU-technology, but you likely may find combinations of use that slipped through our not fully exhaustive test-suite. Missing support may come in the form of either
        *   Code that does not compile
        *   Instruments that segfaults during execution
        *   Instruments or components that produce obscure results
     *   At the time of release, the nightly tests<http://new-nightly.mccode.org/> show that
        *   McStas 3.0 ships with 211 instruments that succesfully compiles
        *   These instruments use 147 of our components
     *   We don't ship an updated set of manuals for McStas 3.0, but essential documentation is available on the McCode GitHub wiki<https://github.com/McStasMcXtrace/McCode/wiki>

Seasons greetings -  we hope you will enjoy this new release!!!

Peter Willendrup

Peter Kjær Willendrup
Forskningsingeniør, Specialkonsulent
Næstformand for DTU Fysik LSU

DTU Physics

[cid:b6339554-7f28-441d-9f31-5944f811397c at win.dtu.dk]

Technical University of Denmark

[cid:e108e480-fcab-46e2-9531-b38165079572 at win.dtu.dk]

Department of Physics
Building 307
DK-2800 Kongens Lyngby
Direct +45 2125 4612
Mobil +45 2125 4612
Fax +45 4593 2399
pkwi at fysik.dtu.dk<mailto:pkwi at fysik.dtu.dk>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.nobugsconference.org/pipermail/nobugs/attachments/20201215/34b2b19c/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 58 bytes
Desc: image001.gif
URL: <https://lists.nobugsconference.org/pipermail/nobugs/attachments/20201215/34b2b19c/attachment-0002.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.gif
Type: image/gif
Size: 1055 bytes
Desc: image002.gif
URL: <https://lists.nobugsconference.org/pipermail/nobugs/attachments/20201215/34b2b19c/attachment-0003.gif>

More information about the NOBUGS mailing list