forked from mccode-dev/McCode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCHANGES_McStas
3028 lines (2657 loc) · 181 KB
/
CHANGES_McStas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*******************************************************************************
*
* McStas, neutron ray-tracing package
* Copyright 1997-, All rights reserved
* Risoe National Laboratory, Roskilde, Denmark
* Institut Laue Langevin, Grenoble, France
*
* Documentation: CHANGES
*
* %Identification
* Written by: KN, KL, PEO, EF, PW, EK, JB
* Origin: DTU, ILL, Uni Copenhagen, PSI
* Modified by: KN, October 26, 1998 : initial release 1.0
* Modified by: KN, March 31, 1999 : release 1.1
* Modified by: KN, January 31, 2000 : release 1.2
* Modified by: KN, May 18, 2000 : release 1.3
* Modified by: KN, July 28, 2000 : release 1.4
* Modified by: KN, PEO, March 16, 2001: release 1.4.1
* Modified by: PEO, EF, October, 10th, 2001: release 1.5
* Modified by: PW, EF, May 19th 2003: version 1.7
* Modified by: PW, EF, March 4th 2004: version 1.8
* Modified by: PW, EF, November 16th 2005: version 1.9
* Modified by: PW, EF, March 29th 2006: version 1.9.1
* Modified by: PW, EF, December 4th 2006: version 1.10
* Modified by: PW, EF, July 3rd 2007: version 1.11
* Modified by: PW, EF, EK May 8th 2008: version 1.12
* Modified by: PW, EF, EK April 2nd 2009: version 1.12a
* Modified by: PW, EF, EK June/July 2010: version 1.12b
* Modified by: PW May-June 2011: version 1.12c (re-release)
* Modified by: PW November 2012: version 2.0RC1 (pre-release)
* Modified by: PW December 2012: version 2.0RC2 (pre-release)
* Modified by: PW December 2012: version 2.0
* Modified by: PW February-July 2014: version 2.1 (and the 2.1RC1 pre-release)
* Modified by: PW and JG May 2015: versions 2.2 and 2.2a
* Modified by: PW March 2016: version 2.3
* Modified by: PW May 2017: version 2.4
* Modified by: PW June 2017: version 2.4.1
* Modified by: PW December 2018: version 2.5
* Modified by: PW January 2020: version 2.6
* Modified by: PW February 2020: 3.0beta tech preview
* Modified by: PW May 2020: version 2.6.1
* Modified by: PW November 2020: version 2.7
* Modified by: PW December 2020: version 3.0
* Modified by: PW September-October 2021: version 2.7.1
* Modified by: PW September-November 2021: version 3.1
* Modified by: PW December 2022: versions 3.2 and 2.7.2
* Modified by: PW March 2023: version 3.3
*
* This file is part of McStas 3.3, released March 31st 2023.
* It gives a 'changes' list from the beginning of the project
*
*******************************************************************************/
Changes in McStas 3.3, March 31st, 2023
McStas 3.3 is the fourth official release in the 3.x series, with a modernised
code-generator and support for GPU acceleration on NVIDIA cards.
3.3 could have been considered a 'minor' update, but new built-in support for NeXus
on all platforms and new SEARCH grammar warrant the .x increment.
Thanks:
- Thanks to all members of the joint McStas-McXtrace team and input from our
users via emails and GitHub issues alike!
Fixes of issues from last 3.x release:
- A number of issues from 3.2 were addressed, see the relevant GitHub issues for details:
- https://github.com/McStasMcXtrace/McCode/issues?q=is%3Aissue+is%3Aclosed+label%3Amcstas-3.2
Installation:
- As usual, our install docs are available on the McCode GitHub page at
https://github.com/McStasMcXtrace/McCode/tree/master/INSTALL-McStas
- The meta-packages for Debian/Ubuntu and RedHat/Centos/Fedora are named e.g.
mcstas-suite-python-ng for 'next generation' for coexistance with the 2.x
series packages
- OpenACC GPU (and CPU multicore) acceleration is at the time of release still ONLY
supported on Linux systems, as this is the only platform targeted by the NVIDIA
HPC package. Versions 20.x, 21.x, 22.x and 23.x should all work. On Windows 64bit systems,
support is expected to arrive "later", but you may run on your GPU via the so-called
"Windows Subsystem for Linux" (WSL). macOS is unfortunately not supported
by NVIDIA HPC acceleration.
- McStas 3.3 comes with embedded NeXus support on macOS and on Debian/Ubuntu NeXus is pulled
as a package dependency. On Windows, please install NeXus from the extras/ folder alongside
your McStas bundle.
- The build process for macOS has been overhauled and is now performed with the embedded
conda environment. Further, the macOS builds should be more robust wrt. added, surrounding
non-standard Python environments on the target machine.
McStas 3.3 enables most components and instruments on GPU. A very limited instruments using
the "scatter logger" mechanism are still only available on 2.x and key components (e.g. Union
and NCrystal) compute only on CPU.
Tools:
- mcrun now automatically adds NeXus support to your binary if --format=NeXus is given on the
commandline (or if DEPENDENCY " @NEXUSFLAGS@ " is included in your instrument or component file).
- The new input flag --IDF will run an IDF generator (i.e. mcdisplay-mantid) prior to performing
a NeXus-based simulation, i.e. for "one-click" support of output in Mantid-compatible NeXus
format with an embedded IDF. Please consult the naming-conventions for sourceMantid, sampleMantid
and nD_Mantid_xx found in
https://github.com/McStasMcXtrace/McCode/wiki/McStas-and-Mantid#mcstas-mantid-workflow
to succesfully generate your IDF. Please also inspire from the example instruments in the 'Mantid'
category, see mcgui -> File -> New from template -> Mantid .
- mcrun now forwards the -I input to the code-generator, which allows you to add a chosen folder
with extra components etc. to your search path. Setting the -I flag implies recompilation (-c).
(Please also note the related SEARCH grammar below which allows working on the component search
path directly via the instrument or component grammar.)
- The mcgui run dialogue now allows to directly specify --format=NeXus and --format=NeXus --IDF
when starting a simulation.
- mcdisplay-mantid has been given a good overhaul and now works properly with all of the supported
mantid-event-detector geometries of Monitor_nD: rectangular, cylindrical/banana and OFF-file based.
Thanks to Torben R. Nielsen and Celine Durniak (ESS) for repeated testing.
- An mcplot (-pyqtgraph) and numpy related bug was quickly spotted and ironed out with the help
of by Rose Robledo FZJ.
Components and Instruments:
- FZP_simple model of Fresnel Zone-Plate (phenomenologic/closed-form thin-plate approximation) added
along with test instrument Test_FZP_simple, work by Anders Komar Ravn (NBI), and Erik B Knudsen
(DTU, now Copenhagen Atomics)
- Test_Monochromators.instr has been updated to include NCrystal_sample as a monochromator, plus
includes multiple ways of parametrizing Single_crystal lattice orientation.
- The 3 example ConicTracer interface-component codes Conics_EH.comp, Conics_PH.comp, Conics_PP.comp
have been updated to allow specifying non-equidistant radii of the nested optical shells. Please
use vector radii={a,b,c,d,e} or initialization via an instrument-based array and use a compatible
setting of nshells.
- The Elliptical_guide_gravity will now complain if you are using arrays for specifying varied coating
without setting the nSegments input.
- The multi-v-cavity support from the McStas 2.x version of Pol_guide_vmirror has been ported to 3.x.
Thanks to Damian Rodriguez and Hal Lee (ESS) for interactions on this component.
- By popular demand, certain characteristics of the ESS_butterfly component may be modified using
compile-time re-definition. Defaults are ESS_SOURCE_DURATION 2.857e-3, ESS_SOURCE_FREQUENCY 14,
ESS_SOURCE_POWER 5. (Use e.g. mcrun --D1=ESS_SOURCE_DURATION=1.0e-3 to simulate a 1 ms pulse.)
- Similarly, the precession-algorithm constants of pol-lib may also be redefined at compile-time,
defaults are: MCMAGNET_STACKSIZE 12, mc_pol_angular_accuracy (1.0*DEG2RAD), mc_pol_initial_timestep 1e-5.
Core simulation framework / code-generator:
- A new syntax called SEARCH has been added to the grammar, allowing users to run append a directory
to the mcstas search path when looking for components. The syntax may be given in two forms in the
instrument- or component-header directly after a SHELL token and before the DEPENDENCY, DECLARE
tokens:
SEARCH "/the/path/to/add/"
SEARCH SHELL "the_executable --and --some --options"
But you may also apply the same two SEARCH forms in connection with a component instance in TRACE, e.g.:
TRACE
...
SEARCH SHELL "readout-config --show compdir"
COMPONENT readout = Readout(ring="RING", fen="FEN", tube="TUBE", a="left", b="right", ...)
AT (0, 0, 0) ABSOLUTE
...
Thanks to Gregory S. Tucker (ESS) for contributing this grammar enhancement!
Libraries and other runtime code:
- The (r-)interoff-lib.c family of codes have again received a couple of updates, thanks to McStas user
Richard Wagner (ILL).
- NCrystal library version 3.5.1 from T. Kittelmann (ESS) and X.X. Cai (CSNS), distributed
with McStas on Unix platforms only. (Cross-compiles for Windows, but still needs work
for "production" availability.)
- MCPL library from the same authors included at v. 1.6.1
Please start your migration to 3.x:
- Following the release of 3.3, we will also release a "VERY last update" to the 2.x series in the form
of McStas 2.7.3 that share a subset of tool features with McStas 3.3.
- The Wiki has a dedicated section on McStas 2.x -> McStas 3.x conversion that includes:
* A nomenclature list containing short descriptions of new concepts and important keywords
in McStas 3.x and OpenACC / CUDA code in general.
* A document outlining the most importand differences between 2.x and 3.x.
* A guide for 2.x -> 3.x instrument conversion.
* A guide for 2.x -> 3.x component conversion.
- If you are still in trouble, please write us a GitHub issue or an email to [email protected]
- Known limitations in the GPU-implementation:
* The Union subsystem still works on CPU only, but can be used in the mixed GPU/CPU funnnel
mode as mentioned above. Union_master is a NOACC component. We expect Union_master to receive
GPU suport later in 2023.
* The same solution is applied in use of the NCrystal_sample that uses a non-accelerated library
without the needed #pragma's included. Several other "complicated" components such as
Single_crystal_inelastic are included the same way.
* Special NOACC versions of Monitor_nD and MCPL_output are included. These may be used in the case
of large event datasets, allowing more than 2e9 events to be stored.
Platforms:
- We still support 64bit Windows 10/11 on Intel, three most recent 64bit macOS (11 Big Sur -> 13 Ventura)
on both Intel and Apple Silicon/M1 processors. Debian-based distros on Intel and Arm, Fedora on Intel.
- On macOS and Windows we bundle a Mambaforge Python with the installation.
We hope you will enjoy this new release!!!
Changes in McStas 3.2, December 12th, 2022
McStas 3.2 is the third official release in the 3.x series, with a modernised
code-generator and support for GPU acceleration on NVIDIA cards.
Thanks:
- Thanks to all members of the joint McStas-McXtrace team, you guys ROCK!
- Our joint hackathon in November brought lots of goodies to our user base!
Fixes of issues from last 3.x release:
- A large number of issues from 3.1 were addressed, see the relevant GitHub issues for details:
- https://github.com/McStasMcXtrace/McCode/issues?q=is%3Aissue+is%3Aclosed+label%3Amcstas-3.1
Documentation & guides:
- All 3.2 component and instrument headers have been given an overhaul and should
render correctly in mcdoc / your browser.
- The component pages now include an extra column in the parameter-table. When filling in
this column with wanted values, plus filling the entry-boxes for AT, ROTATED and instance
name, pressing "Generate" will put a code-snipet for your component instance directly on
your computer clipboard, for easy transfer to the mcgui editor or any other editor of choice!
- mcdoc has been made "less picky" wrt. component and instrument structure for a more robust
experience.
- mcgui has a new "Docs" button for easier access to the generated mcdoc pages (that give easy
access to components, instruments, manuals, datafiles and more.
Installation:
- As usual, our install docs are available on the McCode GitHub page at
https://github.com/McStasMcXtrace/McCode/tree/master/INSTALL-McStas
- The meta-packages for Debian/Ubuntu and RedHat/Centos/Fedora are named e.g.
mcstas-suite-python-ng for 'next generation' for coexistance with the 2.x
series packages
- OpenACC GPU (and CPU multicore) acceleration is at the time of release still ONLY
supported on Linux systems, as this is the only platform targeted by the NVIDIA
HPC package. Versions 20.x, 21.x and 22.x should all work. On Windows 64bit systems,
support is expected to arrive "later", but you may run on your GPU via the so-called
"Windows Subsystem for Linux" (WSL). macOS is unfortunately not supported
by NVIDIA HPC acceleration.
McStas 3.2 enables further components and instruments GPU. A very limited instruments using
the "scatter logger" mechanism are still only available on 2.x.
Interoperability with other codes:
- We have worked on the interfaces with MCPL and NCrystal and a mechanism was developed
to automatically detect their location using the mcpl-config and ncrystal-config utils.
In practice this happens prior/during to the code-generation step, see below under mcrun.
Thanks to Thomas Kittelmann (ESS) for your help in this area.
Tools:
- mcrun has a new solution to support 3 new keywords CMD(), ENV() and GETPATH() through the
DEPENDENCY line as collected by the code-generator.
* CMD() is used to call mcpl-config and ncrystal-config to probe lib and include-paths and
use them in compiler-directives.
(Examples available in MCPL_input.comp and MCPL_output.comp)
* ENV() may evaluate an evironment variable
(No specific example available yet)
* GETPATH() can be used to locate the absolute path to e.g. an input file in the $MCSTAS
folder hierachy. Component writers may use this mechanism for a low-barrier and platform-
independent way to access inputfiles.
(Examples available in Test_MCPL_input.instr and ESS_BEER_MCPL.instr)
- mcrun has a new triplet of switches (D1/D2/D3) that can be used to easily set defines from
the commandline. For instance --D1=SOMETHING will mean -DSOMETHING when compiling. Note that
setting these --D flags implies recompilation (-c).
- mcdoc has been made "less picky" wrt. component and instrument structure for a more robust
experience. Also, rendered component pages now include an extra column in the parameter-table.
When filling in this column with wanted parameter-values, plus filling the entry-boxes for
AT, ROTATED and instance name, pressing "Generate" will put a code-snipet for your component
instance directly on your computer clipboard, for easy transfer to the mcgui editor or any
other editor of choice!
- mcplot (-pyqtgraph) has received a nice update with an infobar at the bottom of the window.
The infobar is updated with coordinates of the cursor on the active plot, meaning that you
can easily determine the coordinates of e.g. a peak. The code has also received a number of
bugfixes relating to colorbars, the order of monitor output in overviews etc.
Thanks to Tobias Weber (ILL) for your work on mcplot.
- The new mcdisplay-cad variant has come along, and is currently included in the form of a
technology-preview. The code uses the Python module cadquery (https://github.com/CadQuery/cadquery)
and is able to write e.g. STEP or STL output. For now, resolving the required dependencies is
left to the user, but we foresee that this tool will mature over the coming releases.
Thanks to Greg Tyler (ESS) for contributing this tool.
Components and Instruments:
- The Union framework is now considered a fully "official" part of McStas and is hence now found
in the $MCSTAS/union folder. Union_master is a still a NOACC component when running on GPU
(i.e. performs its calculations on CPU in FUNNEL mode). We expect Union_master to receive
full GPU suport within 2023. The NCrystal_process.comp is back in Union - will work only in
a NOACC/CPU COMPONENT setting.
- By popular demand, the ConicTracer code for simulating Wolter optics from Boris Khaykovich et. al. (MIT)
has been included. The main "library" code is conic.h found in $MCSTAS/share and is used from
3 different example Wolter optic components: Conics_EH.comp, Conics_PH.comp, Conics_PP.comp.
The illustrate how to mplement Elliptic-Hyperbolic, Parabolic-Hyperbolic and Parabolic-Parabolic
Wolter mirrors, and two of these are used in the Test_Conics_pairs.instr instrument.
- Most of the standard monitors will now fill in their own "instance name" as filename in case
a filename was not defined. A small but very useful convenience.
- Source_div_quasi.comp allows to sample source phase-space using Halton-sequences, which proves
to be a very effective way to ensure an evenly distributed phase space region of interest, e.g.
for imaging/SANS settings where a very low-divergent beam is relevant. This contribution is from
Mads Carlsen and Erik B. Knudsen (DTU) and was originally developed for McXtrace.
- PSD_Pol_monitor.comp measures (local) polarisation over the (x,y) cross-section of a beam. Contributed
by Alexander Backs (LU/ESS).
- Single_crystal_inelastic.comp (NOACC), Single_magnetic_crystal.comp (NOACC), SANS_benchmark2.comp and
Guide_multichannel are now all available in the McStas 3 series.
- The Fermi_chop2a.comp and Vertical_T0a.comp chopppers from Garrett Granroth (SNS) have received
a GPU-oriented update.
Core simulation framework / code-generator:
- Previously, any component present in a McStas instrument would trigger the transformation of
every neutron to its local coordinate system, even in the case of an Arm() (empty TRACE) without
an EXTEND block. We now instead detect components with an empty TRACE that have no EXTEND block
and are able to completely skip these in the calculation. This results in a speedup in case of
instruments with many "empty" components, such as big Union assemblies.
Thanks to Mads Bertelsen (ESS) for investigating the problem and finding a good solution.
- A new syntax called SHELL has been added to the grammar, allowing users to run a system command
prior to code-generation. This may for instance be used to generate an instrument-snippet that
you may %include in the instrument (think for-loops of an assembly of identical components).
One could also imagine compilation of a needed library, wget of a data file etc.
The synax is SHELL "command-to-execute" and it should be placed directly after a DEPENDENCY line
within an instrument or component. We expect that applications and examples will come in the
next couple of releases.
- Components may from McStas 3.2 request USERVARS that become part of the particle struct.
(For the time being only in the form of basic C types like double, int etc. and corresponding
arrays / pointers.) This will mean that e.g. the optimisations in Single_crystal and PowderN
in SPLIT scenarios can be introduced also in GPU settings.
The first component to make use of this mechanism is Res_monitor.comp as used in Test_TasReso.instr.
Libraries and other runtime code:
- The (r-)interoff-lib.c family of codes have received multiple updates, thanks to McStas users
Kyle Grammer (ORNL) and Gaetano Mangiapia (HZH):
* The intersection routines now work correctly with gravity
(see https://github.com/McStasMcXtrace/McCode/issues/1248)
* The r-interoff-lib (and the related Guide_anyshape_r component) now support specifying
a "full" reflectivity curve pr. OFF face, columns of m, alpha and W values should be
added in this order to the OFF face. See example input file data/Guide_r.off.
(see https://github.com/McStasMcXtrace/McCode/issues/1250)
- A flaw was spotted in our NeXus implementation in the case of event lists: A small chunk-size
of (1,6) was used, leading to slow I/O and lots of size-overhead. Our new NeXus files are
generally a factor of (at least) 2-3 smaller and load much faster in e.g. Mantid.
- A correction to ref-lib.c was recieved from Gaetano Mangiapia (HZH), allowing closer
correspondance between simulated and measured mirror-reflectivities.
(see https://github.com/McStasMcXtrace/McCode/issues/1247)
- Updated version 3.5.1 NCrystal library from T. Kittelmann (ESS) and X.X. Cai (CSNS), distributed
with McStas on Unix platforms only. (Now also cross-compiles for Windows, but still needs work
for "production" availability.)
- MCPL library from the same authors now included at v. 1.6.1
Please start your migration to 3.x:
- Following the release of 3.2, we will also release a "last update" to the 2.x series in the form
of McStas 2.7.2 that share a subset of tool features with McStas 3.2.
- The Wiki has a dedicated section on McStas 2.x -> McStas 3.x conversion that includes:
* A nomenclature list containing short descriptions of new concepts and important keywords
in McStas 3.x and OpenACC / CUDA code in general.
* A document outlining the most importand differences between 2.x and 3.x.
* A guide for 2.x -> 3.x instrument conversion.
* A guide for 2.x -> 3.x component conversion.
- If you are still in trouble, please write us a GitHub issue or an email to [email protected]
- Known limitations in the GPU-implementation:
* The Union subsystem still works on CPU only, but can be used in the mixed GPU/CPU funnnel
mode as mentioned above. Union_master is a NOACC component. We expect Union_master to receive
GPU suport within 2023.
* The same solution is applied in use of the NCrystal_sample that uses a non-accelerated library
without the needed #pragma's included. Several other "complicated" components such as
Single_crystal_inelastic are included the same way.
* Special NOACC versions of Monitor_nD and MCPL_output are included. These may be used in the case
of large event datasets, allowing more than 2e9 events to be stored.
Platforms:
- We still support 64bit Windows 10/11 on Intel, all recent 64bit macOS including 13.0 Ventura on
both Intel and Apple Silicon/M1 processors. Debian-based distros on Intel and Arm, Fedora on Intel.
- On macOS and Windows we now bundle a Mambaforge Python with the installation.
- On Windows, the McStasScript and guide_bot codes are as an experimental solution installed in our
Python using pip. We will work on a solution for the other platforms during the spring of 2023.
Infrastructure:
- During the last McStas-McXtrace hackathon we worked on "standardizing" our CMake code, which will
mean smoother integration with other codes and easier configuration and build of our code for
various platforms. Try it out if you like, directly from the McCode repo.
(https://github.com/McStasMcXtrace/McCode/)
We hope you will enjoy this new release!!!
Changes in McStas 2.7.2, December 12th, 2022
McStas 2.7.2 is the 12th release in the 2.x series, provides minor incremental
improvements and fixes various minor issues with McStas 2.7.1. McStas 2.7.2 is meant
to be the LAST version in the 2.x series.
Please start your migration to 3.x:
- McStas 2.7.2 is a "last update" to the 2.x series, sharing a subset of tool features with McStas 3.2.
- The Wiki has a dedicated section on McStas 2.x -> McStas 3.x conversion that includes:
* A nomenclature list containing short descriptions of new concepts and important keywords
in McStas 3.x and OpenACC / CUDA code in general.
* A document outlining the most importand differences between 2.x and 3.x.
* A guide for 2.x -> 3.x instrument conversion.
* A guide for 2.x -> 3.x component conversion.
- If you are still in trouble, please write us a GitHub issue or an email to [email protected]
Thanks:
- Thanks to all members of the joint McStas-McXtrace team, you guys ROCK!
- Our joint hackathon in November brought lots of goodies to our user base!
Fixes of issues from last release:
- A number of minor issues from 2.7.1 were addressed, see the relevant GitHub issues for details:
- https://github.com/McStasMcXtrace/McCode/issues?q=is%3Aissue+is%3Aclosed+label%3Amcstas-2.7.1
Documentation & guides:
- mcdoc has been made "less picky" wrt. component and instrument structure for a more robust
experience. Most docs should thus render correctly in mcdoc / your browser.
- The component pages now include an extra column in the parameter-table. When filling in
this column with wanted values, plus filling the entry-boxes for AT, ROTATED and instance
name, pressing "Generate" will put a code-snipet for your component instance directly on
your computer clipboard, for easy transfer to the mcgui editor or any other editor of choice!
- mcgui has a new "Docs" button for easier access to the generated mcdoc pages (that give easy
access to components, instruments, manuals, datafiles and more.
Installation:
- As usual, our install docs are available on the McCode GitHub page at
https://github.com/McStasMcXtrace/McCode/tree/master/INSTALL-McStas
- The meta-packages for Debian/Ubuntu and Fedora are named e.g.
mcstas-suite-python for coexistance with the 3.x series packages that are named
mcstas-suite-python-ng.
Interoperability with other codes:
- We have worked on the interfaces with MCPL and NCrystal and a mechanism was developed
to automatically detect their location using the mcpl-config and ncrystal-config utils.
In practice this happens prior/during to the code-generation step, see below under mcrun.
Thanks to Thomas Kittelmann (ESS) for your help in this area.
Tools:
- mcrun has a new solution to support 3 new keywords CMD(), ENV() and GETPATH() through the
DEPENDENCY line as collected by the code-generator.
* CMD() is used to call mcpl-config and ncrystal-config to probe lib and include-paths and
use them in compiler-directives.
(Examples available in MCPL_input.comp and MCPL_output.comp)
* ENV() may evaluate an evironment variable
(No specific example available yet)
* GETPATH() can be used to locate the absolute path to e.g. an input file in the $MCSTAS
folder hierachy. Component writers may use this mechanism for a low-barrier and platform-
independent way to access inputfiles.
(Examples available in Test_MCPL_input.instr and ESS_BEER_MCPL.instr)
- mcrun has a new triplet of switches (D1/D2/D3) that can be used to easily set defines from
the commandline. For instance --D1=SOMETHING will mean -DSOMETHING when compiling. Note that
setting these --D flags implies recompilation (-c).
- mcdoc has been made "less picky" wrt. component and instrument structure for a more robust
experience. Also, rendered component pages now include an extra column in the parameter-table.
When filling in this column with wanted parameter-values, plus filling the entry-boxes for
AT, ROTATED and instance name, pressing "Generate" will put a code-snipet for your component
instance directly on your computer clipboard, for easy transfer to the mcgui editor or any
other editor of choice!
- mcplot (-pyqtgraph) has received a nice update with an infobar at the bottom of the window.
The infobar is updated with coordinates of the cursor on the active plot, meaning that you
can easily determine the coordinates of e.g. a peak. The code has also received a number of
bugfixes relating to colorbars, the order of monitor output in overviews etc.
Thanks to Tobias Weber (ILL) for your work on mcplot.
Components and Instruments:
- Minor updates only, most are adjustments to align with McStas 3.x features
- Update to Pol_guide_vmirror.comp to allow multiple V-cavities "side by side". Developed with
Wai Tung (Hal) Lee and Damian Martin Rodriguez (ESS).
- The Union framework is now considered a fully "official" part of McStas and is hence now found
in the $MCSTAS/union folder.
- By popular demand, the ConicTracer code for simulating Wolter optics from Boris Khaykovich et. al. (MIT)
has been included. The main "library" code is conic.h found in $MCSTAS/share and is used from
3 different example Wolter optic components: Conics_EH.comp, Conics_PH.comp, Conics_PP.comp.
The illustrate how to mplement Elliptic-Hyperbolic, Parabolic-Hyperbolic and Parabolic-Parabolic
Wolter mirrors, and two of these are used in the Test_Conics_pairs.instr instrument.
- Source_div_quasi.comp allows to sample source phase-space using Halton-sequences, which proves
to be a very effective way to ensure an evenly distributed phase space region of interest, e.g.
for imaging/SANS settings where a very low-divergent beam is relevant. This contribution is from
Mads Carlsen and Erik B. Knudsen (DTU) and was originally developed for McXtrace.
- PSD_Pol_monitor.comp measures (local) polarisation over the (x,y) cross-section of a beam. Contributed
by Alexander Backs (LU/ESS).
Libraries and other runtime code:
- The (r-)interoff-lib.c family of codes have received multiple updates, thanks to McStas users
Kyle Grammer (ORNL) and Gaetano Mangiapia (HZH):
* The intersection routines now work correctly with gravity
(see https://github.com/McStasMcXtrace/McCode/issues/1248)
* The r-interoff-lib (and the related Guide_anyshape_r component) now support specifying
a "full" reflectivity curve pr. OFF face, columns of m, alpha and W values should be
added in this order to the OFF face. See example input file data/Guide_r.off.
(see https://github.com/McStasMcXtrace/McCode/issues/1250)
- A flaw was spotted in our NeXus implementation in the case of event lists: A small chunk-size
of (1,6) was used, leading to slow I/O and lots of size-overhead. Our new NeXus files are
generally a factor of (at least) 2-3 smaller and load much faster in e.g. Mantid.
- A correction to ref-lib.c was recieved from Gaetano Mangiapia (HZH), allowing closer
correspondance between simulated and measured mirror-reflectivities.
(see https://github.com/McStasMcXtrace/McCode/issues/1247)
- Updated version 3.5.1 NCrystal library from T. Kittelmann (ESS) and X.X. Cai (CSNS), distributed
with McStas on Unix platforms only. (Now also cross-compiles for Windows, but still needs work
for "production" availability.)
- MCPL library from the same authors now included at v. 1.6.1
Platforms:
- We still support 64bit Windows 10/11 on Intel, all recent 64bit macOS including 13.0 Ventura on
both Intel and Apple Silicon/M1 processors. Debian-based distros on Intel and Arm, Fedora on Intel.
- On macOS and Windows we now bundle a Mambaforge Python with the installation.
- On Windows, the McStasScript and guide_bot codes are as an experimental solution installed in our
Python using pip. We will work on a solution for the other platforms during the spring of 2023.
Infrastructure:
- During the last McStas-McXtrace hackathon we worked on "standardizing" our CMake code, which will
mean smoother integration with other codes and easier configuration and build of our code for
various platforms. Try it out if you like, directly from the McCode repo.
(https://github.com/McStasMcXtrace/McCode/)
We hope you will enjoy this new release!!!
Changes in McStas 3.1, November 24th, 2021
McStas 3.1 is the second official release in the 3.x series, with a modernised
code-generator and support for GPU acceleration on NVIDIA cards.
Thanks:
- Thanks to all members of the joint McStas-McXtrace team, you guys ROCK!
Fixes of issues from last 3.x release:
- A largetnumber of issues from 3.0 were addressed, see the relevant GitHub issues for details:
- https://github.com/McStasMcXtrace/McCode/issues?q=is%3Aissue+is%3Aclosed+label%3Amcstas-3.0
- Many GPU-related bugs fixes in all layers of the code, be it components, instruments or
libraries.
Documentation & guides:
- The Wiki has been updated with a dedicated section on McStas 2.x -> McStas 3.x conversion
- It includes:
- A nomenclature list containing short descriptions of new concepts and important keywords
in McStas 3.x and OpenACC / CUDA code in general.
- A document outlining the most importand differences between 2.x and 3.x.
- A guide for 2.x -> 3.x instrument conversion.
- A guide for 2.x -> 3.x component conversion.
Installation:
- Our install docs are available on the McCode GitHub page at
https://github.com/McStasMcXtrace/McCode/tree/master/INSTALL-McStas
- The meta-packages for Debian/Ubuntu and RedHat/Centos/Fedora are named e.g.
mcstas-suite-python-ng for 'next generation' for coexistance with the 2.x
series packages
- OpenACC GPU (and CPU multicore) acceleration is at the time of release ONLY
supported on Linux systems, as this is the only platform targeted by the NVIDIA
HPC package. Versions 20.x and 21.x should all work. On Windows 64bit systems,
support is expected to arrive end of 2021. macOS is unfortunately not supported
by NVIDIA HPC acceleration.
Any GPU-capable McStas instrument now feature three new input parameters for GPU
parallelisation flow-control:
--vecsize OpenACC vector-size
--numgangs Number of OpenACC gangs
--gpu_innerloop Maximum rays to process in a kernel call
McStas 3.1 enables further instruments and functionality on GPU and has improved support for
use of the union components. Also, the FUNNEL mode with combined CPU-GPU execution has become
stable in all tested cases.
Main features and changes with respect to the 2.x series:
1. Modernised code-generation scheme based on functions instead of #defines, which brings
many befefits.
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 since NVIDIA does not yet ship a package for
this platform. 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.
* Install the compiler and put it on your system PATH. Install and configure Nvidia drivers for your card.
* We hope that GCC will offer better support for OpenACC in the near future.
* 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.
The n'th mpi process will attempt to use the k'th GPU, where k = #available GPU's % #MPI nodes.
3. Special McStas 3.0 grammar for mixed CPU/GPU mode:
* The "FUNNEL" mode has been improved and bugfixed. E.g. allows use of the GROUP keyword:
- 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.
4. Interoperability with McStas 2.7.1
* Support for MCPL event interchange is available through MCPL_input and MCPL_output components,
that work both on CPU and GPU for McStas 3.1. 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.1 or 2.7.1, reads and writes happen during the TRACE flow.
5. Known limitations
* The Union subsystem still works on CPU only, 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 for Sample_nxs.
* Not all features of all components correspond to those from McStas 2.7.1, but all essential components
have beenfully ported from the 2.7.1 tree to the 3.0 tree. Hence, some parts distributed with McStas 2.7.1
will either not exist in the 3.1 release or may not function, due to either:
(1) very specialised features (2) maintainability issues or (3) use ofcomplex algorithms.
* At the time of release, the nightly tests http://new-nightly.mccode.org/latest/overview.html show that
- McStas 3.1 ships with 238 instruments that succesfully compile on both CPU and GPU
- These instruments use 162 of our components
- 181 tests produce credible output data on GPU
* We don't ship an updated set of manuals for McStas 3.1, but essential documentation is available
on the McCode GitHub wiki https://github.com/McStasMcXtrace/McCode/wiki
Components:
- A new source component Source_pulsed form Klaus Lieutentant (FZJ/Vitess) has been added with a
corresponding test instrument Test_Source_pulsed.instr. Default parametrisations correspond to
those of the source of the Juelich HBS project.
- Special NOACC versions of Monitor_nD and MCPL_output have been added. When using these for event-mode
output, more than 2e9 events can be stored.
Tools:
- The tools for McStas 3.1 correspond to those distributed with McStas 2.7.1, that is:
- mcgui allows definition of an "external editor", see the configuration menu.
- On Linux we preconfigure for gedit (where we now also provide syntax-highlighting, on macOS
and Windows we default to use the OS file-type settings, i.e. whatever you get by double-clicking
an instr file.) Use ctrl/meta + shift + e to spawn the editor from mcgui.
- User-level configuration files are now in a more user-readable form with indentation.
- Use mcrun --write-user-config to save your user-level configuration file.
- Config setting 'QSCI' has been added, putting this to 0 disables the QScintilla editor.
- On macOS (from 11.0 Big Sur onwards), mcgui assumes light/dark mode with the system settings. A
side-effect is that the syntax-highlighting in our QScintilla editor becomes close-to-unredable.
Workarounds are:
- Use the "external editor" option added to mcgui, see above.
- Don't use dark mode
- Start mcgui in light mode, then switch to dark mode
Platforms:
- We still support 64bit Windows 10/11 on Intel, all recent 64bit macOS including 11.0 Big Sur on
both Intel and Apple Silicon/M1 processors. Debian-based distros on Intel and Arm, RPM-based distros on Intel.
(RPMs are built on/for CentOS and Fedora, you may get varying milage elsewhere.)
Libraries:
- Updated version 2.7.3 NCrystal library from T. Kittelmann (ESS) and X.X. Cai (CSNS), distributed with McStas on Unix
platforms only.
- MCPL library from the same authors now included at v. 1.3.2
We hope you will enjoy this new release!!!
Changes in McStas v.2.7.1, October 4th, 2021
McStas 2.7.1 is the 11th release in the 2.x series, provides minor incremental
improvements and fixes various minor issues with McStas 2.7
Thanks:
- Thanks to all contributors of components, instruments etc.! This is what Open Source
and McStas is all about!
Installation:
- Our install docs are available on the McCode GitHub page at
https://github.com/McStasMcXtrace/McCode/tree/master/INSTALL-McStas
Fixes of issues from last release:
- A number of minor issues from 2.7 were addressed, see the relevant GitHub issues for details:
- https://github.com/McStasMcXtrace/McCode/issues?q=is%3Aissue+is%3Aclosed+label%3Amcstas-2.7
Tools:
- mcgui allows definition of an "external editor", see the configuration menu.
- On Linux we preconfigure for gedit (where we now also provide syntax-highlighting, on macOS
and Windows we default to use the OS file-type settings, i.e. whatever you get by double-clicking
an instr file.) Use ctrl/meta + shift + e to spawn the editor from mcgui.
- User-level configuration files are now in a more user-readable form with indentation.
- Use mcrun --write-user-config to save your user-level configuration file.
- Config setting 'QSCI' has been added, putting this to 0 disables the QScintilla editor.
- On macOS (from 11.0 Big Sur onwards), mcgui assumes light/dark mode with the system settings. A
side-effect is that the syntax-highlighting in our QScintilla editor becomes close-to-unredable.
Workarounds are:
- Use the "external editor" option added to mcgui, see above.
- Don't use dark mode
- Start mcgui in light mode, then switch to dark mode
Platforms:
- We still support 64bit Windows 10/11 on Intel, all recent 64bit macOS including 11.0 Big Sur on
both Intel and Apple Silicon/M1 processors. Debian-based distros on Intel and Arm, RPM-based distros on Intel.
(RPMs are built on/for CentOS and Fedora, you may get varying milage elsewhere.)
Libraries:
- Updated version 2.7.3 NCrystal library from T. Kittelmann (ESS) and X.X. Cai (CSNS), distributed with McStas on Unix
platforms only. With McStas 2.7.1, NCrystal is more tightly integrated and should run without using ncrystal_preparemcstasdir.
- MCPL library from the same authors included at v. 1.3.2.
Components:
- Minor updates only, adjustments to align with McStas 3.x features
Instruments:
- New "test" instruments have been added for easier comparison with McStas 3.x.
We hope you will enjoy this new release!!! (And keep an eye out for 3.1, it is almost also there...)
Changes in McStas 3.0, December 15th, 2020
McStas 3.0 is the first official release in the 3.x series, with a modernised
code-generator and support for GPU acceleration on NVIDIA cards.
Thanks:
- 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 Romanenko
Installation:
- Our install docs are now available on the McCode GitHub page at
https://github.com/McStasMcXtrace/McCode/tree/master/INSTALL-McStas
- The meta-packages for Debian/Ubuntu and RedHat/Centos/Fedora are named e.g.
mcstas-suite-python-ng for 'next generation' for coexistance with the 2.x
series packages
- OpenACC GPU (and CPU multicore) acceleration is at the time of release ONLY
supported on Linux systems, as this is the only platform targeted by the NVIDIA
HPC package. Versions 20.x should all work. On Windows 64bit systems, support is
promised to arrive with WSL 2.0 (i.e. via a Linux-layer), but may also become
supported with a targeted release by NVIDIA. macOS is unfortunately not supported
by NVIDIA HPC acceleration.
Main 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
* In the generic TRACE function of a given component type, the _comp var is
short-hand for "whatever the component instance is"
* New instrument section of USERVARS %{ double example_flag; %} which enriches
the _particle struct
* In component DECLARE blocks, assignments can no longer be done and all declarations
must be listed independently, i.e double a; is OK, double a,b; is not. Variables in
this scope are automatically so-called "OUTPUT PARAMETERS" (we may deprecate that
keyword completely for the official McStas 3.0 release)
* Components no longer support DEFINITION PARAMETERS, instead the SETTING PARAMETERS
must be used, which now includes a vector and string type supplementing the (default)
double/MCNUM and int types.
* New macros have been added for
* INSTRUMENT_GETPAR(parameter_name)
* COMP_GETPAR(component, parameter_name) which is similar to the legacy MC_GETPAR
* MC_GETPAR3(component_class, component_name,parameter_name)
* The function particle_getvar(_particle,"variable",success) provides component-access
to the instrument USERVARS, e.g. in Monitor_nD.
* 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, see the figure in the below link. It was generated for
an "ideally" parallel instrument.
(https://camo.githubusercontent.com/96fcceec70d0761f8709eda4de7bcbde5597aee6/687474703a2f2f746d702e6d63737461732e6f72672f563130302d73706565647570732e706e67)
* 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 since NVIDIA does not yet ship a package for
this platform. 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.
* Install the compiler and put it on your system PATH. Install and configure Nvidia drivers for your card.
* We hope that GCC will offer better support for OpenACC in the near future.
* 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.
The n'th mpi process will attempt to use the k'th GPU, where k = #available GPU's % #MPI nodes.
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.
* Notable examples of unsupported / non-functional components or instruments are:
- The scatter_logger and shielding_logger components / instruments
- The Vitess_chopperfermi component
- The FZJ_BenchmarkSfin2 instrument / SANS_benchmark2 component
- The MCPL_merge instrument
- SEMSANS_instrument
- Sample_nxs
* 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
Tools:
- The tools for McStas 3.0 correspond to those distributed with McStas 2.7, apart from the above-mentioned
mcrun options for --openacc and --funnel.
- On macOS (from 11.0 Big Sur onwards), mcgui will assume light/dark mode with the system settings.
(The change came from using the system python3 with our app/miniconda-distributed Qt libs etc.)
- We now no longer officially support the perl/PGPLOT backend, these may or may not work on your system.
- The mcformat utility has been deprecated.
Platforms:
- Nothing really new to report here. We still support 64bit Windows 10, all recent 64bit macOS including 11.0 Big Sur,
Debian-based and RPM-based distros. (RPMs are built on/for CentOS, you may get varying milage elsewhere.)
Libraries:
- Updated version 2.2.2 NCrystal library from T. Kittelmann (ESS) and X.X. Cai (CSNS), distributed with McStas on Unix
platforms only. With McStas 3.0, NCrystal is more tightly integrated and should run without using ncrystal_preparemcstasdir.
- MCPL library from the same authors now included at v. 1.3.2
Tools:
- The tools for McStas 3.0 correspond to those distributed with McStas 2.7, apart from the above-mentioned
mcrun options for --openacc and --funnel.
- On macOS (from 11.0 Big Sur onwards), mcgui will assume light/dark mode with the system settings.
(The change came from using the system python3 with our app/miniconda-distributed Qt libs etc.)
- We now no longer officially support the perl/PGPLOT backend, these may or may not work on your system.
Platforms:
- Nothing really new to report here. We still support 64bit Windows 10, all recent 64bit macOS including 11.0 Big Sur,
Debian-based and RPM-based distros. (RPMs are built on/for CentOS, you may get varying milage elsewhere.)
Libraries:
- Updated version 2.2.1 NCrystal library from T. Kittelmann (ESS) and X.X. Cai (CSNS), distributed with McStas on Unix
platforms only. To use it, carry out the below steps:
mcstas:~/NCryst$ mcstas-2.7-environment
mcstas:~/NCryst$ source $MCSTAS/ncrystal/setup.sh
mcstas:~/NCryst$ ncrystal_preparemcstasdir
mcstas:~/NCryst$ cp $MCSTAS/examples/NCrystal_example_mcstas.instr .
mcstas:~/NCryst$ mcrun -c NCrystal_example_mcstas.instr
- MCPL library from the same authors now included at v.
We hope you will enjoy this new release!!!
Changes in McStas v.2.7, Novmeber 27th, 2020
McStas 2.7 is the 10th release in the 2.x series, provides minor incremental
improvements and fixes various minor issues with McStas 2.6.1
Thanks:
- Thanks to all contributors of components, instruments etc.! This is what Open Source
and McStas is all about!
Installation:
- Our install docs are now available on the McCode GitHub page at
https://github.com/McStasMcXtrace/McCode/tree/master/INSTALL-McStas
Fixes of issues from last release:
- A number of minor issues from 2.6.1 were addressed, see the relevant GitHub issues for details:
- https://github.com/McStasMcXtrace/McCode/issues?q=label%3A%22McStas+2.6.1%22+label%3A%22ready+for+release+on+master%22+is%3Aclosed
Tools:
- On macOS (from 11.0 Big Sur onwards), mcgui will assume light/dark mode with the system settings.
(The change came from using the system python3 with our app/miniconda-distributed Qt libs etc.)
- We now no longer officially support the perl/PGPLOT backend, these may or may not work on your system.
Platforms:
- Nothing really new to report here. We still support 64bit Windows 10, all recent 64bit macOS including 11.0 Big Sur,
Debian-based and RPM-based distros. (RPMs are built on/for CentOS, you may get varying milage elsewhere.)
Libraries:
- Updated version 2.1.1 NCrystal library from T. Kittelmann (ESS) and X.X. Cai (CSNS), distributed with McStas on Unix
platforms only. To use it, carry out the below steps:
mcstas:~/NCryst$ mcstas-2.7-environment
mcstas:~/NCryst$ source $MCSTAS/ncrystal/setup.sh
mcstas:~/NCryst$ ncrystal_preparemcstasdir
mcstas:~/NCryst$ cp $MCSTAS/examples/NCrystal_example_mcstas.instr .
mcstas:~/NCryst$ mcrun -c NCrystal_example_mcstas.instr
- MCPL library from the same authors now included at v. 1.3.2.
Components:
- Updated Union library from Mads Bertelsen, ESS DMSC.
- Cyl_monitor.comp, enriched with angular limits and dynamic allocation.
- Event_monitor_simple.comp, a simple ascii event-list monitor, good for debugging purposes
Instruments:
- New "unit test" instruments for basic functionalities and key components:
* Random numbers and focusing
. Test_RNG_rand01.instr
. Test_RNG_randnorm.instr
. _RNG_randpm1.instr
. Test_RNG_randtriangle.instr
. Test_RNG_randvec_target_circle.instr
. Test_RNG_randvec_target_rect.instr
. Test_RNG_randvec_target_rect_angular.instr
* Monitors
. Test_Monitor_nD.instr
* Sample components
. Test_Incoherent.instr
. Test_PowderN.instr
. Test_PowderN_concentric.instr
. Test_SX.instr
. Test_Sqw.instr
- Various new instruments used for comparison with the forthcoming McStas 3.0
ILL_D2B_noenv.instr, ILL_H22_D1A_noenv.instr, ILL_H22_D1B_noenv.instr,
- Name change, TasResoTest.instr is now called Test_TasReso.instr
- Instruments providing earlier models of ESS moderators have been retired, i.e. are not in the
release anymore:
ESS_2001_bispectral.instr, ESS_2015_test.instr, ESS_Brilliance_2001.instr, ESS_Brilliance_2013.instr,
ESS_Brilliance_2014.instr, ESS_Brilliance_2015.instr, ESS_Brilliance_TDR.instr
We hope you will enjoy this new release!!! (And keep an eye out for 3.0, it is almost also there...)
Changes in McStas v.2.6.1, May 4th, 2020
McStas 2.6.1 is the nineth release in the 2.x series and fixes various minor issues with McStas 2.6.
Thanks:
- Thanks to all contributors of components, instruments etc.! This is what Open Source
and McStas is all about!
Installation:
- Our install docs are now available on the McCode GitHub page at
https://github.com/McStasMcXtrace/McCode/tree/master/INSTALL-McStas
Fixes of issues from last release:
- A number of minor issues from 2.6 were addressed, see the relevant GitHub issues for details:
- https://github.com/McStasMcXtrace/McCode/issues?q=is%3Aissue++label%3A%22McStas+2.6%22+
Changes in McStas 3.0 technology preview, Feburary 25th, 2020
IMPORTANT: 3.0beta IS a proper 'beta', that is: Don't expect it to fully work, don't expect it to be fully stable,
Do on the other hand expect interesting BUGS!
McStas 3.0beta is a preview of technology in the forthcoming 3.x series.
Thanks:
- 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
Installation:
- As this is NOT a production release, we will only offer installation packages in
the form of "manually installable" packages.
Main 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
* In the generic TRACE function of a given component type, the _comp var is
short-hand for "whatever the component instance is"
* New instrument section of USERVARS %{ double example_flag; %} which enriches
the _particle struct
* In component DECLARE blocks, assignments can no longer be done and all declarations
must be listed independently, i.e double a; is OK, double a,b; is not. Variables in
this scope are automatically so-called "OUTPUT PARAMETERS" (we may deprecate that
keyword completely for the official McStas 3.0 release)
* Components no longer support DEFINITION PARAMETERS, instead the SETTING PARAMETERS
must be used, which now includes a vector and string type supplementing the (default)
double/MCNUM and int types.
* New macros have been added for
* INSTRUMENT_GETPAR(parameter_name)
* COMP_GETPAR(component, parameter_name) which is similar to the legacy MC_GETPAR
* MC_GETPAR3(component_class, component_name,parameter_name)
* Further, the new cogen implements support for Nvidia GPU's, for details see point 2 below.
* Status on CPU (20200220) is that 134 out of 176 instruments from the mcstas-3.0 branch compile
for CPU - and most run as expected.
2. Limited, experimental support for OpenACC acceleration on NVIDIA GPU's
* #pragma driven, inserted by the code-generation, but also implemented in (many, not all)
libs and comps
* Status on GPU (20200220) is that 91 out of 176 instruments from the mcstas-3.0 branch compile
for GPU. These 91 instruments include in total 73 out of 213 components. Out of the functional
instruments, around 45 produce meaningful data at this point.
* 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, see the figure in the below link. It was generated for
an "ideally" parallel instrument.
(https://camo.githubusercontent.com/96fcceec70d0761f8709eda4de7bcbde5597aee6/687474703a2f2f746d702e6d63737461732e6f72672f563130302d73706565647570732e706e67)
* Platform support / compiler configuration:
- Required compiler for GPU/OpenACC: PGI 19.4 or newer. Community edition works fine
- Required GPU hardware: NVIDIA Tesla card + configured driver
- Windows: At this point UNSUPPORTED for GPU/OpenACC since the CUDA managed memory mode is not
available for this platform. (Very simple instruments without monitors may work, at this point
untested). OpenACC multi-threading should work with pgcc -ta:multicore -DOPENACC, also untested.
- macOS: Only CPU-thread parallelisation is supported, since NVIDIA Cards at this point are
unsupported on recent macOS versions. Parallelises similarly to MPI, but slightly slower.
- Linux: Full acceleration support with GPU, and with multicore.
* Install the compiler and put it on your system PATH. Install and configure Nvidia drivers for your card.
* We hope that GCC will offer better support for OpenACC in the near future.
* Tool support
- On Linux and macOS mcrun is preconfigured so that mcrun -c --openacc compiles with:
- Linux: pgcc -ta:tesla,managed,deepcopy -DOPENACC
- macOS: pgcc -ta:multicore -DOPENACC
* 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
3. Interoperability with McStas 2.6