From 6483b1cd2d6c7a3e129a43a76ddaa4137cf7990e Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 19 Mar 2026 16:33:39 +0100 Subject: [PATCH 1/7] Re-enable these instruments on nightly tests --- .../Granroth_SNS_decoupled_poisoned.instr | 2 +- mcstas-comps/examples/SNS/SNS_ARCS/SNS_ARCS.instr | 3 +-- .../examples/SNS/SNS_analytic_test/SNS_analytic_test.instr | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mcstas-comps/examples/SNS/Granroth_SNS_decoupled_poisoned/Granroth_SNS_decoupled_poisoned.instr b/mcstas-comps/examples/SNS/Granroth_SNS_decoupled_poisoned/Granroth_SNS_decoupled_poisoned.instr index 5017b24f1..d5e9c3126 100644 --- a/mcstas-comps/examples/SNS/Granroth_SNS_decoupled_poisoned/Granroth_SNS_decoupled_poisoned.instr +++ b/mcstas-comps/examples/SNS/Granroth_SNS_decoupled_poisoned/Granroth_SNS_decoupled_poisoned.instr @@ -16,7 +16,7 @@ * * Simple instrumentfile for estimating SNS brilliance, moderator is a the Granroth SNS_source applying linear interpolation in MCNPX tables. * -* Example: filename=source_sct091_tu_02_1.dat Detector: Brillmon_I=7.11736e+12 +* %Example: filename=source_sct091_tu_02_1.dat Detector: Brillmon_I=7.11736e+12 * * %Parameters * Lambda_min: [AA] Minimum wavelength produced at source diff --git a/mcstas-comps/examples/SNS/SNS_ARCS/SNS_ARCS.instr b/mcstas-comps/examples/SNS/SNS_ARCS/SNS_ARCS.instr index f5b44644c..c5a407fae 100644 --- a/mcstas-comps/examples/SNS/SNS_ARCS/SNS_ARCS.instr +++ b/mcstas-comps/examples/SNS/SNS_ARCS/SNS_ARCS.instr @@ -24,8 +24,7 @@ * B. Fultz,"Design and operation of the wide angular-range chopper spectrometer ARCS at the * Spallation Neutron Source", Review of Scientific Instruments, 83 , 015114 (2012) * -* Example: -y Detector: Full_cyl_I=235445 -* (temporarily disabled on nightly test...) +* %Example: -y Detector: Full_cyl_I=235445 * * %Parameters * Fermi_nu: [Hz] Frequency of the Fermi chopper diff --git a/mcstas-comps/examples/SNS/SNS_analytic_test/SNS_analytic_test.instr b/mcstas-comps/examples/SNS/SNS_analytic_test/SNS_analytic_test.instr index 1ee8de668..fe1301bc1 100644 --- a/mcstas-comps/examples/SNS/SNS_analytic_test/SNS_analytic_test.instr +++ b/mcstas-comps/examples/SNS/SNS_analytic_test/SNS_analytic_test.instr @@ -19,7 +19,7 @@ * Simple test instrument for the SNS_source component. * Refer to SNS Source files. * -* Example: filename=source_sct091_tu_02_1.dat Detector: det_I=7.09416e+09 +* %Example: filename=source_sct091_tu_02_1.dat Detector: det_I=7.09416e+09 * * %Parameters * filename: [string] Source file From 0d9ffc0b7fa4d1b71c74dd8ec051a005d0b1a6d7 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 19 Mar 2026 17:06:01 +0100 Subject: [PATCH 2/7] Add same monitor/target value as in non-Mantid variant of instr --- .../examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr b/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr index 4e3e8fbb7..663ae4494 100644 --- a/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr +++ b/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr @@ -24,6 +24,8 @@ * B. Fultz,"Design and operation of the wide angular-range chopper spectrometer ARCS at the * Spallation Neutron Source", Review of Scientific Instruments, 83 , 015114 (2012) * +* %Example: Fermi_nu=420 Detector: Full_cyl_I=235445 +* * %Parameters * Fermi_nu: [Hz] Frequency of the Fermi chopper * T0_nu: [Hz] Frequency of the T0 chopper @@ -261,6 +263,10 @@ AT(0,0,LS) RELATIVE mod COMPONENT sampleMantid = Spot_sample(radius_o=0.01, h=0.05, pack = 1,xwidth=0, yheight=0, zthick=0, Eideal=Edes,w=Et,two_theta=ttheta,n_spots=4) AT (0.0,0.0,0.0) RELATIVE Sample_Arm +COMPONENT Full_cyl= Monitor_nD(xwidth=5.98,yheight=3.2,restore_neutron=1, + options="mantid banana, theta limits=[-28.0 135.38] bins=389 ,y limits=[-0.550 0.450] bins=128") +AT (0,0,0.00005) RELATIVE Sample_Arm + COMPONENT nD_Mantid_0= Monitor_nD(xwidth=5.9817,yheight=3.2,restore_neutron=1, filename="this", options="mantid banana, theta limits=[-28.0 135.38] bins=389 ,y limits=[-0.550 0.450] bins=128, neutron pixel min=0 t, list all neutrons", restore_neutron=1) AT (0,0,0.00005) RELATIVE Sample_Arm From a5243924256f437476b1e5b043709172f6fc8b4f Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 19 Mar 2026 17:10:12 +0100 Subject: [PATCH 3/7] Correct the %Example line --- .../examples/SNS/SNS_analytic_test/SNS_analytic_test.instr | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mcstas-comps/examples/SNS/SNS_analytic_test/SNS_analytic_test.instr b/mcstas-comps/examples/SNS/SNS_analytic_test/SNS_analytic_test.instr index fe1301bc1..c59cf64c3 100644 --- a/mcstas-comps/examples/SNS/SNS_analytic_test/SNS_analytic_test.instr +++ b/mcstas-comps/examples/SNS/SNS_analytic_test/SNS_analytic_test.instr @@ -19,7 +19,7 @@ * Simple test instrument for the SNS_source component. * Refer to SNS Source files. * -* %Example: filename=source_sct091_tu_02_1.dat Detector: det_I=7.09416e+09 +* %Example: -y Detector: det_I=8.51297e+10 * * %Parameters * filename: [string] Source file @@ -48,8 +48,9 @@ INITIALIZE %{ #define LOADPATH_ STR(LOADPATH) sprintf(fullfile,"%s/%s",LOADPATH_,filename); -printf("Using the input file: %s\n", fullfile); - +MPI_MASTER( + printf("Using the input file: %s\n", fullfile); +); %} TRACE From 354eb2433cf840695920864cb2ff04fa986ae3ff Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 19 Mar 2026 17:10:42 +0100 Subject: [PATCH 4/7] Let only MPI_MASTER give status output from Gallmeier comp --- mcstas-comps/contrib/SNS_source_analytic.comp | 100 +++++++++++++----- 1 file changed, 75 insertions(+), 25 deletions(-) diff --git a/mcstas-comps/contrib/SNS_source_analytic.comp b/mcstas-comps/contrib/SNS_source_analytic.comp index 38e8b5e0a..b17ebe65f 100644 --- a/mcstas-comps/contrib/SNS_source_analytic.comp +++ b/mcstas-comps/contrib/SNS_source_analytic.comp @@ -809,84 +809,124 @@ INITIALIZE fprintf (stderr, "Error opening file\n"); exit (-1); } else { - printf ("%s\n", "File opened..."); + MPI_MASTER( + printf ("%s\n", "File opened..."); + ); } /* spectral parameters */ while ((fgets (line, linelength, fp) != NULL) && (strchr (line, '#') != NULL)) { - printf ("%s", line); + MPI_MASTER( + printf ("%s", line); + ); } kk = sscanf (line, " %le %le %le %le %le %le %le %le %le %le %le %le %le %le", ¶_sp[0], ¶_sp[1], ¶_sp[2], ¶_sp[3], ¶_sp[4], ¶_sp[5], ¶_sp[6], ¶_sp[7], ¶_sp[8], ¶_sp[9], ¶_sp[10], ¶_sp[11], ¶_sp[12], ¶_sp[13]); /* a parameter of emission time distribuation */ while ((fgets (line, linelength, fp) != NULL) && (strchr (line, '#') != NULL)) { - printf ("%s", line); + MPI_MASTER( + printf ("%s", line); + ); } kk = sscanf (line, " %le %le %le %le %le %le %le %le %le %le", ¶_a[0], ¶_a[1], ¶_a[2], ¶_a[3], ¶_a[4], ¶_a[5], ¶_a[6], ¶_a[7], ¶_a[8], ¶_a[9]); if (kk != 10) { - printf ("para_a: insufficient number of data entries read\n"); + MPI_MASTER( + printf ("para_a: insufficient number of data entries read\n"); + ); _ABORT (); } /* b parameter of emission time distribuation */ while ((fgets (line, linelength, fp) != NULL) && (strchr (line, '#') != NULL)) { - printf ("%s", line); + MPI_MASTER( + printf ("%s", line); + ); } kk = sscanf (line, " %le %le %le %le %le %le %le %le %le %le", ¶_b[0], ¶_b[1], ¶_b[2], ¶_b[3], ¶_b[4], ¶_b[5], ¶_b[6], ¶_b[7], ¶_b[8], ¶_b[9]); if (kk != 10) { - printf ("para_b: insufficient number of data entries read\n"); + MPI_MASTER( + printf ("para_b: insufficient number of data entries read\n"); + ); _ABORT (); } /* R parameter of emission time distribuation */ while ((fgets (line, linelength, fp) != NULL) && (strchr (line, '#') != NULL)) { - printf ("%s", line); + MPI_MASTER( + printf ("%s", line); + ); } kk = sscanf (line, " %le %le %le %le %le %le %le %le %le %le", ¶_R[0], ¶_R[1], ¶_R[2], ¶_R[3], ¶_R[4], ¶_R[5], ¶_R[6], ¶_R[7], ¶_R[8], ¶_R[9]); if (kk != 10) { - printf ("para_R: kk=%d insufficient number of data entries read\n", kk); + MPI_MASTER( + printf ("para_R: kk=%d insufficient number of data entries read\n", kk); + ); _ABORT (); } /* to parameter of emission time distribuation */ while ((fgets (line, linelength, fp) != NULL) && (strchr (line, '#') != NULL)) { - printf ("%s", line); + MPI_MASTER( + printf ("%s", line); + ); } kk = sscanf (line, " %le %le %le %le %le %le %le %le %le %le", ¶_to[0], ¶_to[1], ¶_to[2], ¶_to[3], ¶_to[4], ¶_to[5], ¶_to[6], ¶_to[7], ¶_to[8], ¶_to[9]); if (kk != 10) { - printf ("para_R: insufficient number of data entries read\n"); + MPI_MASTER( + printf ("para_R: insufficient number of data entries read\n"); + ); _ABORT (); } printf ("\n"); for (k = 0; k < 14; k++) { - printf (" para_sp(%d)=%e\n", k, para_sp[k]); + MPI_MASTER( + printf (" para_sp(%d)=%e\n", k, para_sp[k]); + ); } - printf ("\n"); + MPI_MASTER( + printf ("\n"); + ); for (k = 0; k < 10; k++) { - printf (" para_a(%d)=%e\n", k, para_a[k]); + MPI_MASTER( + printf (" para_a(%d)=%e\n", k, para_a[k]); + ); } - printf ("\n"); + MPI_MASTER( + printf ("\n"); + ); for (k = 0; k < 10; k++) { - printf (" para_b(%d)=%e\n", k, para_b[k]); + MPI_MASTER( + printf (" para_b(%d)=%e\n", k, para_b[k]); + ); } - printf ("\n"); + MPI_MASTER( + printf ("\n"); + ); for (k = 0; k < 8; k++) { - printf (" para_R(%d)=%e\n", k, para_R[k]); + MPI_MASTER( + printf (" para_R(%d)=%e\n", k, para_R[k]); + ); } - printf ("\n"); + MPI_MASTER( + printf ("\n"); + ); for (k = 0; k < 10; k++) { - printf (" para_to(%d)=%e\n", k, para_to[k]); + MPI_MASTER( + printf (" para_to(%d)=%e\n", k, para_to[k]); + ); } if (sample_E == 0) { CItot = prepare_cumulative_spectral_function (csfE, Emin, Emax, para_sp); if (CItot <= 0.0) { - printf (" choice of Emin and Emax gives zero neutron intensity\n"); + MPI_MASTER( + printf (" choice of Emin and Emax gives zero neutron intensity\n"); + ); _ABORT (); } // for(i=0;i<=1000;i++){ @@ -896,19 +936,29 @@ INITIALIZE /* some checks */ if (dist <= 0.0) { - printf (" dist must be greater zero\n"); + MPI_MASTER( + printf (" dist must be greater zero\n"); + ); _ABORT (); } else if (focus_xw <= 0.0) { - printf (" focus_xw must be greater zero\n"); + MPI_MASTER( + printf (" focus_xw must be greater zero\n"); + ); _ABORT (); } else if (focus_yh <= 0.0) { - printf (" focus_yh must be greater zero\n"); + MPI_MASTER( + printf (" focus_yh must be greater zero\n"); + ); _ABORT (); } else if (p_power <= 0) { - printf (" p_power must be greater zero\n"); + MPI_MASTER( + printf (" p_power must be greater zero\n"); + ); _ABORT (); } else if (n_pulses <= 0) { - printf (" n_pulses must be greater zero\n"); + MPI_MASTER( + printf (" n_pulses must be greater zero\n"); + ); _ABORT (); } From 0bb4b9a1d6903a99d9cd660fa4d33993255bac38 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 19 Mar 2026 17:18:42 +0100 Subject: [PATCH 5/7] Temporaily disable --- .../examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr b/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr index 663ae4494..8712ac46b 100644 --- a/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr +++ b/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr @@ -24,7 +24,7 @@ * B. Fultz,"Design and operation of the wide angular-range chopper spectrometer ARCS at the * Spallation Neutron Source", Review of Scientific Instruments, 83 , 015114 (2012) * -* %Example: Fermi_nu=420 Detector: Full_cyl_I=235445 +* Example: Fermi_nu=420 Detector: Full_cyl_I=235445 * * %Parameters * Fermi_nu: [Hz] Frequency of the Fermi chopper From db83ce2e4f296d988e340c31189fd72430b094a2 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 19 Mar 2026 17:31:45 +0100 Subject: [PATCH 6/7] file-existance check for "cache load" attempt --- tools/Python/mctest/mctest.py | 48 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index 03426abfd..831a36109 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -95,26 +95,30 @@ def save(self, infolder): text = json.dumps(self.get_json_repr(), indent=2) f = open(join(infolder, self.get_display_name()) + ".json", 'w').write(text) def load(self,testnb=0): - jsonfile=os.path.join(os.path.dirname(self.localfile),self.get_display_name()+'.json') - f = open(jsonfile, "r", encoding="utf-8") - obj = json.load(f) - # # Populate test - self.displayname=obj['displayname'] - self.sourcefile=obj['sourcefile'] - self.localfile=obj['localfile'] - self.instrname=obj['instrname'] - self.testnb=obj['testnb'] - self.parvals=obj['parvals'] - self.detector=obj['detector'] - self.targetval=obj['targetval'] - self.testval=obj['testval'] - self.linted=obj['linted'] - self.compiled=obj['compiled'] - self.compiletime=obj['compiletime'] - self.didrun=obj['didrun'] - self.runtime=obj['runtime'] - self.errmsg=obj['errmsg'] - + jsonfile=pathlib.Path(os.path.join(os.path.dirname(self.localfile),self.get_display_name()+'.json')) + if jsonfile.is_file(): + f = open(jsonfile, "r", encoding="utf-8") + obj = json.load(f) + # # Populate test + self.displayname=obj['displayname'] + self.sourcefile=obj['sourcefile'] + self.localfile=obj['localfile'] + self.instrname=obj['instrname'] + self.testnb=obj['testnb'] + self.parvals=obj['parvals'] + self.detector=obj['detector'] + self.targetval=obj['targetval'] + self.testval=obj['testval'] + self.linted=obj['linted'] + self.compiled=obj['compiled'] + self.compiletime=obj['compiletime'] + self.didrun=obj['didrun'] + self.runtime=obj['runtime'] + self.errmsg=obj['errmsg'] + return True + else: + return False + def get_display_name(self): if self.testnb > 1: return self.instrname + "_%d" % self.testnb @@ -251,8 +255,8 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt populated=[] for t in instrtests: if t.testnb >= 0: - t.load(t.testnb) - populated.append(t) + if t.load(t.testnb)==True: + populated.append(t) tests = tests + populated pass From 65d9131a0a61d1768c7d6be7c25f31fe54091c63 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 19 Mar 2026 17:40:49 +0100 Subject: [PATCH 7/7] Reinstate test --- .../examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr b/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr index 8712ac46b..663ae4494 100644 --- a/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr +++ b/mcstas-comps/examples/Mantid/SNS_ARCS_Mantid/SNS_ARCS_Mantid.instr @@ -24,7 +24,7 @@ * B. Fultz,"Design and operation of the wide angular-range chopper spectrometer ARCS at the * Spallation Neutron Source", Review of Scientific Instruments, 83 , 015114 (2012) * -* Example: Fermi_nu=420 Detector: Full_cyl_I=235445 +* %Example: Fermi_nu=420 Detector: Full_cyl_I=235445 * * %Parameters * Fermi_nu: [Hz] Frequency of the Fermi chopper