McStasMcXtrace / McCode

The home of the McStas (neutrons) and McXtrace (x-rays) Monte-Carlo ray-tracing instrument simulation codes.
https://github.com/McStasMcXtrace/McCode/wiki
GNU General Public License v3.0
78 stars 54 forks source link

McXtrace: instr/comp compilation tests #1642

Closed farhi closed 3 months ago

farhi commented 4 months ago

Here is a list of components that seem to fail to compile for the McXtrace part:

(Edited / categorised 20240713 13-15 by @willend)

Comp syntax errors

Work initiated, example instrument(s) missing

Drop / integrate functionality in other components?

Done / Understood?

Components without default parameter values are difficult to check for compilation. Perhaps the test script should set all to 0. I removed them from the failed list.

The command was, using Matlab:

addpath('MCCODE/tools/comp-test')
pw='MCCODE/mcxtrace-comps';
exe='mxrun';
[failed, compiled, tested, results] = check_compile(pw, exe)

resulting in 293 compilations.

willend commented 4 months ago

@farhi how was that system deployed - and are you sure there is e.g. an MCPL package in place?

My reason for asking is that my (two different kinds of) nightly builds seem to run fine: 1) see https://new-nightly.mcxtrace.org/2024-07-13_output.html - ./buildscripts/xbuild_loc_3.x_tree (conda provides dependencies - look inside the build script) 2) https://github.com/McStasMcXtrace/McCode/actions/runs/9916404512 (test output is in the artefact) created via https://github.com/McStasMcXtrace/McCode/blob/main/.github/workflows/mcstas-testsuite.yml - simple CMake build

willend commented 4 months ago

Also, my local check_compile function looks different has a header of only [failed, compiled] = check_compile(pw) and uses hard-coded mcrun.pl

willend commented 4 months ago

OK, perhaps I now better understand where you are going with this - it is more of a "does the component compile" test?

I would think however that MCPL is missing on your system, the MCPL-oriented comps and instrs work just fine here:

Finding instruments in: /Users/peterwillendrup/miniforge3/share/mcxtrace/resources/examples Copying instruments to: /Users/peterwillendrup/mcxtrace-test/20240713_1242_53/mcxtrace-3.4.54_Darwin

Compiling instruments [seconds]... Test_MCPL_input : 2.08 Test_MCPL_output : 2.11

Running tests... Test_MCPL_input : 0.57 Test_MCPL_output : 0.60

* Then used mxviewtest to render an html table:

(base) CIN-969631:~ peterwillendrup$ cd /Users/peterwillendrup/mcxtrace-test/20240713_1242_53/ (base) CIN-969631:20240713_1242_53 peterwillendrup$ mxviewtest --ref=mcxtrace-3.4.54_Darwin $PWD writing ofile: 20240713_1242_53_output.html


* Output folder and table copied here:
http://tmp.mcxtrace.org/mcpltest/
willend commented 4 months ago

On the note of DEFINITION PARAMETERS yes: I am sure these comps are effectively not ported to 3.x yet.

For the shadow-things it looks very simple, initial edits done but yes we clearly need a couple of example instruments.

willend commented 4 months ago

@farhi I took the liberty of categorising your initial input above and started working a little on a few comps.

I am certain the MCPL stuff is down to a missing dependency (can effectively only run with the Python mxrun though -- uses a command in the DEPENDENCY line)

I am certain the Saxs_spheres is a false positive - test instrument functions in https://new-nightly.mcxtrace.org/todays-datafiles/2024-07-13_output.html

farhi commented 4 months ago

Hi @willend ! many thanks for looking into this :+1: Perhaps a similar clean-up is needed on the McStas side. Cross-tests in many ways help to identify remaining dark parts of our code.

willend commented 4 months ago

@farhi I think I at one point made an in-repo tool for this... (Produced .txt files in all comp categories.)

--> ./compmatrix.sh

Will check / rerun now

willend commented 3 months ago

@farhi based on https://new-nightly.mcxtrace.org/todays-datafiles/2024-08-01_output.html I guess we can close this issue? (Full GPU support requires some details here and there - but all seems good on CPU... All compiles for GPU, it is a matter of details in comp TRACE sections that are not fullyGPU/thread safe)

farhi commented 3 months ago

All is fine,. agree to close.