-
Notifications
You must be signed in to change notification settings - Fork 54
/
CHANGES_McStas
3559 lines (3128 loc) · 214 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
*
* McStas and McXtrace share code repository at
* https://github.com/McStasMcXtrace/McCode
*
* Both codes are released under GPL v3
*
* Documentation: CHANGES_McStas
*
* %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
* Modified by: PW September 2023: version 3.4
* Modified by: PW September 2024: version 3.5.1
* Modified by: PW November 2024: version 3.5.12
*
* This file is part of McStas 3.5.12, released Novmeber 22nd 2024.
* It gives a 'changes' list from the beginning of the project
*
*******************************************************************************/
Changes in McStas/McXtrace 3.5.12, November 22nd, 2024
## What's Changed
* Platform support and installation procedures
* McStas + McXtrace: Allow to build installable packages for linux aarch64 Debian / arm64 by @willend in https://github.com/McStasMcXtrace/McCode/pull/1702
* McStas + McXtrace: Install mcstasscript from conda in the meta-packages. by @willend in https://github.com/McStasMcXtrace/McCode/pull/1724
* Please note that the packages are currently **NOT** available via the packages.mccode.org repo - and that you will have to manually uninstall McStas/McXtrace 3.5.1 before attempting to install 3.5.12
* Code generator and runtime-code
* McStas + McXtrace: Fix for SPLIT + GROUP issue: In instruments with a SPLIT N followed by a GROUP, the last N-1 particles would become lost. by @willend in https://github.com/McStasMcXtrace/McCode/pull/1760
* McStas + McXtrace: Implement combined OpenACC multicore + gpu in same binary. Enable by adding
`"OACCFLAGS": "-fast -Minfo=accel -acc=gpu,multicore -gpu=managed -DOPENACC -DMULTICORE",` to your `mccode_config.json` by @willend in https://github.com/McStasMcXtrace/McCode/pull/1761
* McStas + McXtrace: Add -D_DARWIN_C_SOURCE on macOS, required for correctly using `#include <stdio.h>` by @willend in https://github.com/McStasMcXtrace/McCode/pull/1703
* Component bugfixes and improvements
* McStas + McXtrace: Make use of mcpl_dump() in MCPL_output verbose mode by @willend in https://github.com/McStasMcXtrace/McCode/pull/1704
* McStas: MCPL_input, correction of #1733 by @willend in https://github.com/McStasMcXtrace/McCode/pull/1734
* McStas: [Fix] compilation error, if not behavior in Pol_guide_vmirror.comp by @g5t in https://github.com/McStasMcXtrace/McCode/pull/1708
* McStas: Fix contributed component type mismatches (Monochromator_bent and Statistical_Chopper) @g5t in https://github.com/McStasMcXtrace/McCode/pull/1714
* McStas: Union restructure share includes by @willend in https://github.com/McStasMcXtrace/McCode/pull/1716
* McStas: PowderN: fixing tth_sign argument by @farhi in https://github.com/McStasMcXtrace/McCode/pull/1727 and Fix for https://github.com/McStasMcXtrace/McCode/issues/1741 by @willend in https://github.com/McStasMcXtrace/McCode/pull/1745
* McXtrace: Add Collimator_linear port McStas -> McXtrace by @willend in https://github.com/McStasMcXtrace/McCode/pull/1737
* McStas + McXtrace: Removal of all DECLARATION and OUTPUT parameters by @willend in https://github.com/McStasMcXtrace/McCode/pull/1754
* McStas + McXtrace Fix SX issue from minghuisvn by @willend in https://github.com/McStasMcXtrace/McCode/pull/1755
* Sync McStas <-> McXtrace powdern focusing algo for https://github.com/McStasMcXtrace/McCode/issues/1741 by @willend in https://github.com/McStasMcXtrace/McCode/pull/1747 + consequence-edits in https://github.com/McStasMcXtrace/McCode/pull/1748
* McStas + McXtrace: Source_div_quasi fix for #1735 by @ebknudsen in https://github.com/McStasMcXtrace/McCode/pull/1759
* McStas + McXtrace Single_crystal:
* McStas: Fix #1732: Single_crystal powder mode was broken by #1521 by @farhi in https://github.com/McStasMcXtrace/McCode/pull/1738
* Fixes for https://github.com/McStasMcXtrace/McCode/issues/1728 by @willend in https://github.com/McStasMcXtrace/McCode/pull/1731
* Fix of Single_crystal reuse optimization by @mads-bertelsen in https://github.com/McStasMcXtrace/McCode/pull/1726
* To allow compilation for GPU hardware, drop all tau_lists in OPENACC case by @willend in https://github.com/McStasMcXtrace/McCode/pull/1751
* Introduction of order=0.5 mode in Single_crystal by @mads-bertelsen in https://github.com/McStasMcXtrace/McCode/pull/1762
* Fix of order system in Single_crystal by @mads-bertelsen in https://github.com/McStasMcXtrace/McCode/pull/1764
* Added order_extra feature for Single_crystal by @mads-bertelsen in https://github.com/McStasMcXtrace/McCode/pull/1767
* Instrument updates
* McStas: Test_DiskChoppers2 [Fix] missing pointer dereferences by @g5t in https://github.com/McStasMcXtrace/McCode/pull/1710
* McStas: Add a an updated (%)Example line for Test_StatisticalChopper by @willend in https://github.com/McStasMcXtrace/McCode/pull/1715
* McStas: Fix these instruments to use "local" inputfile by @willend in https://github.com/McStasMcXtrace/McCode/pull/1729
* McXtrace: NECSA X ray machines by @farhi in https://github.com/McStasMcXtrace/McCode/pull/1742
* McStas: Expand on Test_Powders from Mads by @willend in https://github.com/McStasMcXtrace/McCode/pull/1766
* Python tool layer
* McStas + McXtrace: Fix to comp-forms in mcdoc pages by @willend in https://github.com/McStasMcXtrace/McCode/pull/1723 (fixes #1722)
* McStas + McXtrace: mcrun/mxrun optimization: allows to specify criteria expression by @farhi in https://github.com/McStasMcXtrace/McCode/pull/1743
* McStas + McXtrace: mcrun/mxrun optimisation: better choice for missing dX/dY by @farhi in https://github.com/McStasMcXtrace/McCode/pull/1744
* McStas + McXtrace: mccode-antlr: Add mccode_config / m[c,x]run entry for MCCOGEN by @willend in https://github.com/McStasMcXtrace/McCode/pull/1749
* McStas + McXtrace: config updates for the added "MCCOGEN" setting by @willend in https://github.com/McStasMcXtrace/McCode/pull/1750
* McStas + McXtrace: Add -n in supplement of --ncount, allow match including .instr by @willend in https://github.com/McStasMcXtrace/McCode/pull/1753
* McStas: Strip off arguments not understood by mcdisplay-mantid by @willend in https://github.com/McStasMcXtrace/McCode/pull/1757
* McStas + McXtrace: Intermediate fix for https://github.com/McStasMcXtrace/McCode/issues/1768 by @willend in https://github.com/McStasMcXtrace/McCode/pull/1769
* McStas + McXtrace: Fix for issue 1763 and related issue propagating --no-output-files by @willend in https://github.com/McStasMcXtrace/McCode/pull/1765
* Documentation etc.
* Add binder link in the "Docker" / container README by @willend in https://github.com/McStasMcXtrace/McCode/pull/1700
* Document install steps around macOS 15 tightened security by @willend in https://github.com/McStasMcXtrace/McCode/pull/1706
* Installation rewording for conda-envs by @willend in https://github.com/McStasMcXtrace/McCode/pull/1756
**Full Changelog**: https://github.com/McStasMcXtrace/McCode/compare/v3.5.1...v3.5.12
**Specific issues solved:**: https://github.com/McStasMcXtrace/McCode/issues?q=is%3Aissue+label%3A%22ready+for+release%22+label%3Amcstas-3.5.1+label%3Amcxtrace-3.5.1+
We hope you will enjoy this new release!!!
Changes in McStas 3.5.1, September 16th, 2024
McStas 3.5.1 is the sixth 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 and input from our
users via emails and GitHub issues alike! Further a special thanks to
Theodor Peter Guttesen (former DTU diploma student) who has helped modernise
our 3D visualisation!
Important changes going forward:
- From release 3.5.1 McStas and McXtrace are released simultaneously and with
the same versioning (meaning that McXtrace takes a jump from 3.2 up to 3.5)
- With release 3.5.1 we are officially dropping support for the "legacy"
McStas 2.7.2 release and the "legacy" McXtrace 1.7.1 release.
- To minimize work required for platform support and builds, we are now focusing
on fewer platforms:
* Debian packages at packages.mccode.org are provided for x86_64 and arm64 Linux
(Thanks to the work of Emmanuel Farhi and his team at SOLEIL, official Debian
packages are already available in Debian Testing and Unstable
(see https://tracker.debian.org/pkg/mccode) and should become
widely available with next Debian Stable, after which we might drop our "own
channel").
* conda-forge is to become our distribution channel for "everything else", meaning
that:
1. Our macOS "bundles" are effectively now self-extracting conda-installers and
REQUIRES an active internet connection during installation
2. From a later release in the 3.5 series the same will be the case for Windows
- We are dropping builds for ALL rpm-oriented platform. Please use conda-forge instead.
- We want to release more "early and often" going forward, see below under conda-forge.
Conda-forge:
- We are now officially on conda-forge, with feedstocks available at:
* https://github.com/conda-forge/mcstas-suite-feedstock
* https://github.com/conda-forge/mcxtrace-suite-feedstock
- Via conda-forge we support the platforms linux-64, linux-aarch64, osx-arm64, osx-64 and win-64
- The conda-forge win-64 packages have slight shortcomings for this first release, meaning that:
* MCPL and NCrystal are not shipped with McStas
* MCPL is not shipped with McXtrace
- We still provide cross-compiled installers for Windows (mingw builds) for now
- You will find that when installed via conda-forge, file locations are slightly different:
most of the locations may be probed via:
mcrun --showcfg=ITEM Print selected cfg item and exit (paths are resolved
and absolute). Allowed values are "bindir", "libdir",
"resourcedir", and "tooldir".
(Wrt. locations of examples and components, the "resourcdir" is the same as $MCSTAS)
- Going forward, we will add incremental releases in the 3.5-series as work happens on the
main McStas/McXtrace branch - and this work will automatically go on our official
conda-forge and Debian channels. Other distribution channels ("bulky installers etc.)
may come with longer intervals.
Fixes of issues from last 3.x release:
- A number of issues from 3.4 were addressed, see the relevant GitHub issues for details:
- https://github.com/McStasMcXtrace/McCode/issues?q=is%3Aissue+is%3Aclosed+label%3Amcstas-3.4
Installation:
- Our install docs are available on the McCode GitHub page at
https://github.com/McStasMcXtrace/McCode/tree/master/INSTALL-McStas
- The meta-package for Debian/Ubuntu is named mcstas-suite-python
- 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 -> 24.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.5.1 packages come with OpenMPI and NeXus as install-time dependencies for all supported
platforms.
McStas 3.5.1 enables most components and instruments on GPU. A few components compute only on CPU:
- Components using shared libraries from external software:
* GNU Scientific library used in:
contrib/SANSPDBFast
contrib/SANSNanodiscs
contrib/SANSNanodiscsWithTags
contrib/SANSNanodiscsFast
contrib/SANSEllipticCylinders
contrib/SANSPDB
contrib/SANSCylinders
contrib/Multilayer_Sample
* NCrystal used in
contrib/NCrystal_sample
* Components that are not fully thread-safe / ported to GPU
(I.e. these may come to GPU later)
contrib/Single_crystal_inelastic
contrib/SupermirrorFlat
contrib/Monochromator_bent
samples/Single_magnetic_crystal
union/Union_master
* Components that are intentionally for CPU-only use
(No dealing with buffersizes etc.)
misc/MCPL_output_noacc
monitors/Monitor_nD_noacc
Tool enhancements:
- The mcdisplay-webgl tool has received a MAJOR overhaul:
* Support for visualisation of proper "solids" instead of "multilines". Key components
have been updated with this new style, but more will come in the following releases.
* New react/js user-interface with options for choosing colour and transparency
of the individual components.
* Save and load of instrument visualisation and particle rays in JSON format
* The new features require a server-process, facilitated by the 'vite' javascript/node.js
oriented server. The server is by default shut down after 5 minutes - but mcdisplay-webgl
has an input parameter to control this behavior.
* On first launch the 'npm' package manager installs and builds packages to the McStas
user directory, so expect this first launch to take a little time.
* The tool further has a '2D' mode in the style of mcdisplay-pyqtgrahph, simply use your
mouse wheel on the browser menu to scroll the 3D view 'up' and the 2D views will appear!
- The mcgui user interface also has recieved a numner of usability changes:
* The main interface includes a new 'Jupylab' button that will convert a loaded
instrument file to McStasScript (python) format and launch Jupyterlab.
* The mcgui font-size can be configured via the Preferences dialogue and saved to
the user-level mccode_config.json file
* Monitor_nD "buffersize" of a given simulation (mostly used for the list/event mode)
may be configured via the Preferences dialogue and saved to the user-level config
* When copying an instrument from the Examples / Templates, the instrument-folder is
copied, i.e. including both instrument and specific datafiles etc.
* The "autoplot" mode that spawns plotting post simulation completion now also functions
with NeXus output
* "Inverted" canvas can be chosen when autoplotting with mcplot(-pyqtgraph)
- Improved NeXus support in both mcgui and mcrun:
* The JSON configuration file mccode_config.json now includes a HDFVIEW setting,
defaulting to 'nexpy' on the conda-forge based systems and HDFCompass on Debian
as nexpy is not yet available here. (A useful alternative is 'silx view'.)
- The primary mcplot(-pyqtgraph) tool also received a number of updates:
* The tool behaves correctly both in case of PyQt5 and PyQt6 based systems
* Visibility of legends is highly improved both on (standard) black canvas and
inverted white canvas (select from the mcgui prefs / run dialogue)
* When selecting --format=NeXus and requesting '--autoplot' from mcgui/mcrun, both the
mcplot(-pyqtgraph) and mcplot-matplotlib plotters request the HDFVIEW tool to
open the resulting mccode.h5 file.
- The 'mctest' tool is now available as a user-tool. The tool
* Allows to test for compilation of all instruments
* test-executes those including with %Example lines.
* To test your McStas installation, simply execute 'mctest' in your McStas environment
* The tool creates an output folder with the tested instruments in subfolders and the
test simulation results in subfolders under these. Compile-time, execution-time and
test numerical output is stored in JSON files.
* The most important commandline switches are these:
--ncount N selects the wanted statistic for the tests
--mpi=number or --mpi=auto enables mpi mode for the tests
--openacc enables OpenACC accelerations on Nvidia GPU on Linux
--instr=PATTERN only test instruments matching PATTERN
--testdir=DIR puts the test results under the DIR folder
--suffix=SUFFIX adds SUFFIX as an identifier in the output foldername
--nexus enables NeXus output for all tested instruments
* Here is an example of a run:
# mctest --instr=BNL_H8_simple --testdir=mcstas-test
loading system configuration
Output of test will be placed in: mcstas-test
ncount is: 1e6
Testing: 3.5.1
Finding instruments in: /Users/peterwillendrup/miniforge3/share/mcstas/resources/examples
Copying instruments to: mcstas-test/mcstas-3.5.1_BNL_H8_simple_Darwin
Compiling instruments [seconds]...
BNL_H8_simple : 2.03
Running tests...
BNL_H8_simple : 0.96
- The 'mcviewtest' tool is now available as a user-tool. The tool may be used to render
an html page with results from one or more 'mctest' runs. If your results of a test run
was placed in e.g. mcstas-test/mcstas-3.5.1_BNL_H8_simple_Darwin:
* cd to mcstas-test
* run the command: mcviewtest
* You may then open the resulting html file for visualisation in your browser and see
an output simmilar to that of our nightly test, see e.g.
https://new-nightly.mcstas.org/2024-09-11_output.html (A single test run gives
a single column of output - the example test demonstrated above would give only a
single cell since only one test was executed for a single instrument.)
* GRAY = instrument compiled OK, GREEN = instrument test agrees with %Example line,
RED = numerical result disagrees, WHITE with red text = instrument did not compile.
* The included numbers pr. cell includes C: compile time R: runtime and I=numerical value
Components and Instruments:
- The examples/ folder is no longer a flat directory, but has instead beceme a tree-structure,
subdivided into instrument categories:
* Facility / University / source type instruments:
BNL DTU ESS FZ_Juelich HZB ILL ISIS LLB Necsa PSI Risoe SNS TRIGA TUDelft
* Templates, tools and various tests:
Templates Tools, Tests_RNG Tests_monitors Tests_other Tests_samples Tests_MCPL_etc
Tests_grammar Tests_optics Tests_polarization Tests_sources
* Output from EU-projects etc.
HighNESS SINE2020 e-learning
* Links with other software
Mantid NCrystal
* Union-specific tests
Tests_union Union_demos Union_sample_environments Union_validation
- Each instrument has its own folder within the hierarcy, where usage-specific input files
etc. may also exist. In the future we may decide to distribute some McStasScript instruments
within this folder structure.
- MCPL_input had a parameter change: E_smear has become v_smear since what was implemented
was in fact a smearing on velocity.
- New component MCPL_input_once from Gregory S Tucker, ESS. Reads an MCPL file a single time,
and in MPI-mode with k processes, each processor reads just ~ 1/k of the file.
- An updated version of the strain-scanning instrument ILL_SALSA.instr was contributed by
Daniel Lomholt Christensen, Uni Copenhagen and ILL. The instrument uses a new model of
a bent-Si monochromator (Monochromator_bent) which was benchmarked and validated against
the RESTRAX/SIMRES model with help from Jan Šaroun, NPI Řež. The Test_Monochromator_bent
is a unit test for the monochromator.
- From Swiss Neutronics AG we have received an Transmission_V_polarisator.comp with two
corresponding test-instruments (Test_V_cavity_SNAG_single_side and Test_V_cavity_SNAG_double_side)
for single-side and double-side coated V-polarisers. The component was originally developed
by Andreas Ostermann (TUM) and has been updated by Michael Schneider from SNAG. The
models correspond to the simulations carried out for the publication
https://doi.org/10.1016/j.physb.2009.06.031
- Please note that the Pol_guide_vmirror currently has a systematic discrepancy wrt. the SNAG model,
full investigation of the problem is pending but will be fixed for a later 3.5.x update release.
!! If your simulation problem allows, please make use of the experimentally benchmarked
Transmission_V_polarisator instead !!
- From Hal Lee (ESS) we have received a new SupermirrorFlat component including all relevant
physics in the form of reflection, refraction and absorption in coating, substrate and absorber.
The component requires multiple new SHARE libs: supermirror-lib.c/h, plane.c/h, polyhedron.c/h
and comes with the example instrument Supermirror_thin_substrate.instr
- Incoming components and instruments:
* Ba. thesis student Thom van der Woude from TU Delft has written an excellent thesis on his
SEMSANS-related project "Design and analysis of a SEMSANS instrument for a cold source".
The code is available at https://github.com/tbvanderwoude/semsans for anyone interested and
includes simulation scripts, McStas code and Jupyter notebooks for analysis. We foresee
that this work will make it to one of the next minor updates McStas 3.5.x.
Core simulation framework / code-generator:
- The McStas and McXtrace code-generators are fully synchronised from v3.5.1 onwards.
Libraries and other runtime code:
- The NeXus output is richer from McStas 3.5.1, specifically:
* All component global postions and orientations are placed as dataset within
/entry1/instrument/components/<COMP>
* Monitors store their detector outputs in
/entry1/instrument/components/<COMP>/output/<filename>
* Monitor_nD instances further store their spatial bin-information in
/entry1/instrument/components/<COMP>/output/BINS
* To still support the "McStas-Mantid" NeXus variant, please use --format=NeXus --IDF
which will include virtual links to the above datasets within the expected
/entry1/data structure
- NCrystal library version 3.9.7 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 T. Kittelmann (ESS) included at v. 1.6.2
- On debian and fedora we are providing new packages for NCrystal and MCPL via the
McCode repository, independent of the McStas release. (Both codes have further arrived
in the Debian ecosystem, thanks to Synchrotron SOLEIL, Emmanuel Farhi and Roland Mas.)
Migration to 3.5.1:
- As mentioned above, we no longer support McStas 2.x.
- 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]
Platforms:
- We provide packages for the following platforms / systems:
* conda-forge Platforms linux-64, linux-aarch64 osx-arm64, osx-64 and win-64
* Debian-based distros on Intel and Arm
* conda-forge based 'application bundles' for
64bit macOS 12-14 both Intel and Silicon (should also be ready for macOS 15 Sequoia)
* A cross-compiled 'bulky installer' for 64bit Windows 10/11 on Intel
- For RPM based distros please use our conda-forge solution!
- For e.g. FreeBSD you may roll your own using CMake.
We hope you will enjoy this new release!!!
Changes in McStas 3.4, September 19th, 2023
McStas 3.4 is the fifth 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 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.3 were addressed, see the relevant GitHub issues for details:
- https://github.com/McStasMcXtrace/McCode/issues?q=is%3Aissue+is%3Aclosed+label%3Amcstas-3.3
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. (Please note that there will be no future 2.x releases!)
- 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.4 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 both macOS and Windows has been further overhauled and is based on an
embedded conda environment. MPI support is now included with the installation on Windows.
- We have further been modernising the (CMake-based) build system and will be contributing
conda recipes for distribution via conda in the near future.
Thanks to Thomas Kittelmann (ESS) for lots of help and footwork in the CMake/conda effort!
McStas 3.4 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:
- We are no longer supporting / distributing the Perl-based tool set as all functionality
has finally been ported to the Python tool set (which has been default since v. 2.4)
- mcrun now supports an set of "optimisation" switches to allow evaluating an instrument as
"object function". Thanks to Emmanuel Farhi for working on this.
--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
--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.mini
mize.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)
- McStas now ships with a "python-aware" code generator for generating "McStasScript" code, example:
mcstas-pygen Instrument.instr --> Instrument_generated.py
Using 'jupytext' this file may easily be converted to a notebook:
jupytext --to ipynb Instrument_generated.py --> Instrument_generated.ipynb
See https://github.com/PaNOSC-ViNYL/McStasScript
for more information on McStasScript.
- McStasScript is included with McStas 3.4 on macOS and Windows and readily configured for use with
McStas 3.4 and its embedded Python version. For sake of user convenience, Jupyterlab is also included
on these platforms, use 'jupyter lab' from within the McStas 'environment' to work with a McStasScript
notebook.
Components and Instruments:
- In relation to the HighNESS project, the Wolter-optic components Conics_* have been given an
overhaul by Mads Bertelsen. New related instrument WOFSANS is included with McStas 3.4.
- Thanks to the work of José Robledo (FZJ), we now have a better interface to the Small-Angle Scattering
models from SASview, aka. SASmodels. Due to the big number of included models that each correspond
to a McStas component (94 in total!), these are now found in the "sasmodels" folder of your McStas
installation. Two example instruments are also included: Test_SasView_bcc_paracrystal_aniso.instr and
Test_SasView_guinier.instr.
- The strain-scanning instrument ILL_SALSA.instr was contributed by Daniel Lomholt Christensen,
Uni Copenhagen and ILL.
Core simulation framework / code-generator:
- mcstas-pygen: A secondary code-generator is now included that translates an instrument file to
a .py script for use with McStasScript. If your system includes the jupytext utility
(McStas on Windows and macOS now does by default), the command
jupytext --to ipynb
will translate the .py output from mcstas-pygen to an iPython notebook.
- New functions to probe the distance to a given component instance at INTITIALIZE time:
double index_getdistance(int first_index, int second_index)
/* Calculate the distance two components from their indexes*/
double getdistance(char* first_component, char* second_component)
/* Calculate the distance between two named components */
double checked_setpos_getdistance(int current_index, char* first_component, char* second_component)
/* Calculate the distance between two named components at *_setpos() time, with component index checking */
Thanks to Gregory S. Tucker (ESS) for contributing this functionality.
- A new syntax for instrument parameter units has been added to the grammar:
DEFINE INSTRUMENT template(lambda / "Aa" = 2.36)
Such unit definitions may be probed using
./template.out --list-parameters
double lambda/"Aa" = 2.36
Thanks to Gregory S. Tucker (ESS) for contributing this grammar enhancement!
- A new syntax called METADATA has been added to the grammar, allowing users to "glue" one or more
pieces of information to a component instance, e.g.:
COMPONENT Origin = Progress_bar()
AT (0,0,0) ABSOLUTE
METADATA JSON eniius_data %{
...{JSON string}...
%}
METADATA Python extra_function %{
def the_function(a, b, c):
return a + b / c
%}
Such metadata definitions may be probed using e.g.
# List the components that have attached metadata:
./template.out --meta-list
Origin
# List the attached metadata names for Origin:
./template.out --meta-defined Origin
eniius_data extra_function
# Probe the "type" of metadata for each metadata name:
./template.out --meta-type Origin:eniius_data
JSON
./template.out --meta-type Origin:extra_function
Python
# Print the metadata for each metadata name:
./template.out --meta-data Origin:eniius_data
...{JSON string}...
./template.out --meta-data Origin:extra_function
def the_function(a, b, c):
return a + b / c
Thanks to Gregory S. Tucker (ESS) for contributing this grammar enhancement!
Libraries and other runtime code:
- NCrystal library version 3.7.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 T. Kittelmann (ESS) included at v. 1.6.2
- On macOS NCrystal and MCPL are now installed via conda.
- On debian and fedora we are providing new packages for NCrystal and MCPL via the
McCode repository, independent of the McStas release. (Both codes will also soon arrive
in the Debian ecosystem to beecome available with the next releases, thanks to
Synchrotron SOLEIL, Emmanuel Farhi and Roland Mas.)
START your migration to 3.x:
- Following the release of 3.4, we will no longer systematically be releasing updates to the
2.x series.
- 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 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.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.