Skip to content

Expand Monitor_nD to 10 uservars + other work on monitors#2428

Merged
willend merged 14 commits into
mccode-dev:mainfrom
willend:main
Apr 30, 2026
Merged

Expand Monitor_nD to 10 uservars + other work on monitors#2428
willend merged 14 commits into
mccode-dev:mainfrom
willend:main

Conversation

@willend
Copy link
Copy Markdown
Contributor

@willend willend commented Apr 30, 2026

Free-form text area

Please describe what your PR is adding in terms of features or bugfixes:

Work on monitors:

  • Monitor_nD uservars expanded from 3->10 uservars ([FEATURE]: Increase number of Monitor_nD user vars #2391)
  • Naïve test instrument(s) added for McStas and McXtrace
  • Correction of wording / parameters in Flex_monitors, McStas and McXtrace
  • Removal of PreMonitor_nD mentions in comps and docs -> use USERVARS

Development OS / boundary conditions

Please describe what OS you developed and tested your additions on, and if any special dependencies are required:


PR Checklist for contributing to McStas/McXtrace

For a coherent and useful contribution to McStas/McXtrace, please fill in relevant parts of the checklist:

  • My contribution includes patches to an existing component file

    • I have used the mcdoc utility and rendered a reasonable documentation page for the component (please attach as screenshot in comments!)
    • I have ensured that basic use of the component is OK (e.g. an instrument using it compiles?)
    • I have used the mctest utility to test one or more instruments making use of the component (please attach mcviewtest report as screenshot in comments)
    • I have used the mccode-clangformat tool to apply the standard McCode component indentation scheme
    • I have used the mcrun --c-lint "linter" and followed advice to remove most / all warnings that are raised
  • My contribution includes a new instrument file

    • I have used the mcdoc utility and rendered a reasonable documentation page for the instrument (please attach as screenshot in comments!)
    • I have ensured that basic use of the instrument is OK (e.g. it compiles?)
    • ... and provided reasonable default parameters in that instrument that produce reasonable output
    • ... and maybe even added a %Example: line to describe expected behaviour
    • I have used the mcrun --c-lint "linter" and followed advice to remove most / all warnings that are raised
    • My new instrument is added within the examples hierarchy in a folder in the style of examples/ESS/New_stuff/New_stuff.instr
    • My new instrument has a new, unique filename, not clashing with existing example instruments
    • My new instrument requires a data/input file. If the datafile is specific for my instrument I have left it in the same example folder, but if general use I have placed it in the global data folder.
  • My PR is meant to fix a specific, existing issue

  • My contribution contains something else

    • Explanation is added in free form text above or below the checklist

@willend willend changed the title DRAFT PR to expand Monitor_nD to 10 uservars maximum Expand Monitor_nD to 10 uservars + other work on monitors Apr 30, 2026
@willend
Copy link
Copy Markdown
Contributor Author

willend commented Apr 30, 2026

Docs look fine, here is a a sample:
Screenshot 2026-04-30 at 10 03 03
Screenshot 2026-04-30 at 10 03 16
Screenshot 2026-04-30 at 10 03 29

@willend
Copy link
Copy Markdown
Contributor Author

willend commented Apr 30, 2026

The failing tests of McXtrace / conda / windows are due to #1579

The failing test of McStas / non-conda-windows is a missing dependency in the CI… (jinja2 for mcviewtest)

@willend
Copy link
Copy Markdown
Contributor Author

willend commented Apr 30, 2026

McXtrace has a couple of (likely unrelated) instruments with output that is off:
Screenshot 2026-04-30 at 12 33 10

McStas looks all green for the PR-related instruments:
Screenshot 2026-04-30 at 12 32 35
Screenshot 2026-04-30 at 12 32 21

@willend
Copy link
Copy Markdown
Contributor Author

willend commented Apr 30, 2026

No noise from the linter based on the McStas side:
Screenshot 2026-04-30 at 12 58 43

INFO: Linting generated code: ./Test_Monitor_nD.c
DEBUG: CMD: cppcheck ./Test_Monitor_nD.c --check-level=exhaustive --force -DMCDEFAULT_NCOUNT=1000000 -UMC_PORTABLE -DND_BUFFER=10000000 -UNOABSORB_INF_NAN -UOMPI_MPI_H -DSIGABRT -DSIGBREAK -DSIGBUS -DSIGPE -DSIGHUP -DSIGILL -DSIGINT -DSIGKILL -DSIGUSR1 -DSIGUSR2 -DSIGPIPE -DSIGQUIT -DSIGSEGV -DSIGTRAP -DSIGURG -DSIGFPE -DSIGKILL -DSIGTERM -UTEST -UUSE_OPENCL -UWIN32 -UOPENACC -UGCCOFFLOAD -U_MSC_VER -U_MSC_EXTENSIONS -U_WIN32 -UWIN32 -D__unix__ -UDANSE -UFUNNEL -UMC_ANCIENT_COMPATIBILITY -UMC_POL_COMPAT -UNEUTRONICS -Uisnan -Uisinf
Checking Test_Monitor_nD.c ...
Checking Test_Monitor_nD.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1...
Checking Test_Monitor_nD.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;OFF_LEGACY=OFF_LEGACY...
Checking Test_Monitor_nD.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;USE_MPI=0...
Checking Test_Monitor_nD.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;USE_MPI=USE_MPI...
Checking Test_Monitor_nD.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;USE_MPI=USE_MPI;USE_NEXUS=USE_NEXUS...
Checking Test_Monitor_nD.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;USE_NEXUS=0...
Checking Test_Monitor_nD.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;USE_NEXUS=USE_NEXUS...

@willend
Copy link
Copy Markdown
Contributor Author

willend commented Apr 30, 2026

Down to only McXtrace + MSVC on windows via conda failling due to #1579. Merge.

@willend willend merged commit 0fdcc11 into mccode-dev:main Apr 30, 2026
15 of 16 checks passed
willend added a commit to willend/McCode that referenced this pull request May 1, 2026
willend added a commit that referenced this pull request May 1, 2026
Follow-up to #2428, required interface changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant