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
77 stars 54 forks source link

Rare memory-allocation issues on Windows during code generation #642

Closed willend closed 6 years ago

willend commented 6 years ago

I have received the attached instrument file + components from Lamar Moore at ISIS.

The code generator crashes with the error message:

Fatal error: memory exhausted during allocation of size 2000000.

Generating the code works OK on other systems, and the simulation runs OK also on windows if that c-code is transported over and compiled.

freia_simulation.zip

willend commented 6 years ago

If a certain number of components are commented out, code generation occurs...

Also, it seems the issue is 32 vs 64 bit related: Having transported a 64-bit mcstas.exe to my Windows 10, code generation also works.

willend commented 6 years ago

Looks like a 64-bit code generator and compiler system works as well as a 32 bit.

Test Abstract for selftest_0G5M
[OK]     BNL_H8_1 (accuracy, 14 %)
[FAILED] BTsimple_2 (compilation/execution)
[notest] Demo_shape_primitives (no test procedure)
[notest] ESS_2001_bispectral (no test procedure)
[notest] ESS_2015_test (no test procedure)
[notest] ESS_Brilliance_2001 (no test procedure)
[notest] ESS_Brilliance_2013 (no test procedure)
[notest] ESS_Brilliance_2014 (no test procedure)
[notest] ESS_Brilliance_2015 (no test procedure)
[notest] ESS_Brilliance_TDR (no test procedure)
[notest] ESS_butterfly_Guide_curved_test (no test procedure)
[notest] ESS_butterfly_MCPL_test (no test procedure)
[notest] ESS_butterfly_test (no test procedure)
[notest] ESS_butterfly_tfocus_NOFOCUS_test (no test procedure)
[notest] ESS_butterfly_tfocus_test (no test procedure)
[OK]     ESS_IN5_reprate_3 (accuracy, 6 %)
[notest] ESS_mcpl2hist (no test procedure)
[notest] FZJ_BenchmarkSfin2 (no test procedure)
[OK]     FZJ_KWS2_Lens_4 (accuracy, 4 %)
[OK]     FZJ_SANS_KWS2_AnySample_5 (accuracy, 16 %)
[OK]     FZJ_SANS_KWS2_AnySample_6 (accuracy, 13 %)
[OK]     FZJ_SANS_KWS2_AnySample_7 (accuracy, 8 %)
[OK]     FZJ_SANS_KWS2_AnySample_8 (accuracy, 1 %)
[notest] Gallmeier_SNS_decoupled_poisoned (no test procedure)
[notest] Granroth_SNS_decoupled_poisoned (no test procedure)
[notest] h8_test_legacy (no test procedure)
[notest] Histogrammer (no test procedure)
[notest] HZB_FLEX (no test procedure)
[OK]     HZB_NEAT_9 (accuracy, 6 %)
[OK]     HZB_NEAT_10 (accuracy, 24 %)
[OK]     ILL_BRISP_11 (accuracy, 2 %)
[OK]     ILL_D2B_12 (accuracy, 13 %)
[OK]     ILL_D4_13 (accuracy, 1 %)
[OK]     ILL_H10_IN8_14 (accuracy, 3 %)
[OK]     ILL_H113_15 (accuracy, 2 %)
[OK]     ILL_H13_IN20_16 (accuracy, 2 %)
[OK]     ILL_H142_17 (accuracy, 1 %)
[FAILED] ILL_H142_IN12_18 (accuracy off by 32 %)
[notest] ILL_H143_LADI (no test procedure)
[OK]     ILL_H15_19 (accuracy, 4 %)
[notest] ILL_H15_IN6 (no test procedure)
[OK]     ILL_H16_20 (accuracy, 5 %)
[OK]     ILL_H16_IN5_21 (accuracy, 30 %)
[OK]     ILL_H16_IN5_22 (accuracy, 27 %)
[OK]     ILL_H16_IN5_Mantid_23 (accuracy, 18 %)
[OK]     ILL_H16_IN5_Mantid_24 (accuracy, 18 %)
[notest] ILL_H16_Mantid (no test procedure)
[OK]     ILL_H22_25 (accuracy, 13 %)
[OK]     ILL_H22_D1A_26 (accuracy, 75 %)
[OK]     ILL_H22_D1B_27 (accuracy, 42 %)
[OK]     ILL_H22_VIVALDI_28 (accuracy, 516 %)
[OK]     ILL_H24_29 (accuracy, 4 %)
[OK]     ILL_H25_30 (accuracy, 11 %)
[OK]     ILL_H25_IN22_31 (accuracy, 4 %)
[notest] ILL_H5 (no test procedure)
[OK]     ILL_H512_D22_32 (statistics too low for testing, increase ncount)
[OK]     ILL_H53_33 (accuracy, 1 %)
[notest] ILL_H53_D16 (no test procedure)
[FAILED] ILL_H53_IN14_34 (accuracy off by 83 %)
[notest] ILL_H5_new (no test procedure)
[OK]     ILL_H8_IN1_35 (accuracy, 1 %)
[FAILED] ILL_IN13_36 (accuracy off by 28 %)
[OK]     ILL_IN4_37 (accuracy, fair 17 %)
[OK]     ILL_IN5_38 (accuracy, 1 %)
[OK]     ILL_IN5_Mantid_39 (accuracy, 32 %)
[notest] ILL_IN6 (no test procedure)
[??????] ILL_Lagrange_40 (reference not found)
[notest] ISIS_CRISP (no test procedure)
[OK]     ISIS_GEM_41 (accuracy, 1 %)
[OK]     ISIS_HET_42 (accuracy, 1 %)
[notest] ISIS_MERLIN (no test procedure)
[notest] ISIS_OSIRIS (no test procedure)
[OK]     ISIS_Prisma2_43 (accuracy, 4 %)
[notest] ISIS_SANS2d (no test procedure)
[notest] ISIS_SANS2d_Mantid (no test procedure)
[OK]     ISIS_test_44 (accuracy, 2 %)
[notest] ISIS_TS1_Brilliance (no test procedure)
[notest] ISIS_TS2_Brilliance (no test procedure)
[OK]     linup-1_45 (accuracy, 8 %)
[OK]     linup-2_46 (accuracy, 18 %)
[OK]     linup-3_47 (statistics too low for testing, increase ncount)
[OK]     linup-4_48 (accuracy, 8 %)
[OK]     linup-5_49 (accuracy, 7 %)
[OK]     linup-6_50 (accuracy, 7 %)
[OK]     linup-7_51 (accuracy, 1 %)
[notest] LLB_6T2 (no test procedure)
[notest] MCPL2hist (no test procedure)
[notest] Mezei_SNS_decoupled_poisoned (no test procedure)
[OK]     PSI_DMC_52 (accuracy, 6 %)
[OK]     PSI_Focus_53 (accuracy, 7 %)
[notest] Reflectometer (no test procedure)
[notest] RITA-II (no test procedure)
[notest] RTP_DIF (no test procedure)
[notest] RTP_Laue (no test procedure)
[notest] RTP_NeutronRadiography (no test procedure)
[notest] RTP_SANS (no test procedure)
[notest] SAFARI_MPISI (no test procedure)
[notest] SAFARI_PITSI (no test procedure)
[OK]     Samples_Incoherent_54 (accuracy, 1 %)
[OK]     Samples_Incoherent_55 (accuracy, 0 %)
[OK]     Samples_Incoherent_56 (accuracy, 2 %)
[OK]     Samples_Incoherent_57 (accuracy, 1 %)
[OK]     Samples_Incoherent_58 (accuracy, 1 %)
[OK]     Samples_Incoherent_59 (accuracy, 0 %)
[OK]     Samples_Incoherent_60 (accuracy, 1 %)
[OK]     Samples_Incoherent_61 (accuracy, 1 %)
[OK]     Samples_Incoherent_62 (accuracy, 1 %)
[OK]     Samples_Incoherent_63 (accuracy, 1 %)
[OK]     Samples_Incoherent_off_64 (accuracy, 1 %)
[OK]     Samples_Isotropic_Sqw_65 (accuracy, 10 %)
[OK]     Samples_Phonon_66 (accuracy, 1 %)
[OK]     Samples_vanadium_67 (accuracy, 1 %)
[notest] SEMSANS_instrument (no test procedure)
[notest] SE_example (no test procedure)
[notest] SE_example2 (no test procedure)
[notest] SNS_analytic_test (no test procedure)
[notest] SNS_ARCS (no test procedure)
[notest] SNS_ARCS_Mantid (no test procedure)
[notest] SNS_BASIS (no test procedure)
[notest] SNS_test (no test procedure)
[notest] template (no test procedure)
[OK]     templateDIFF_68 (accuracy, 3 %)
[OK]     templateLaue_69 (accuracy, 3 %)
[notest] templateNMX (no test procedure)
[notest] templateNMX_TOF (no test procedure)
[OK]     templateSANS_70 (accuracy, 11 %)
[OK]     templateSANS_Mantid_71 (statistics too low for testing, increase ncount)
[notest] templateSasView (no test procedure)
[notest] templateSasView_Mantid (no test procedure)
[OK]     templateTAS_72 (accuracy, 1 %)
[OK]     templateTAS_73 (accuracy, 3 %)
[OK]     templateTOF_74 (accuracy, fair 20 %)
[OK]     templateTOF_75 (accuracy, 7 %)
[notest] templateVanadiumMultipleScat_Mantid (no test procedure)
[notest] template_simple (no test procedure)
[notest] TestSANS (no test procedure)
[OK]     Test_Collimator_Radial_76 (accuracy, 2 %)
[OK]     Test_Collimator_Radial_77 (accuracy, 2 %)
[OK]     Test_Collimator_Radial_78 (accuracy, 2 %)
[OK]     Test_Fermi_79 (accuracy, 5 %)
[OK]     Test_Fermi_80 (accuracy, 2 %)
[OK]     Test_Fermi_81 (accuracy, 9 %)
[OK]     Test_Fermi_82 (accuracy, 4 %)
[OK]     Test_Fermi_83 (accuracy, 1 %)
[OK]     Test_FocalisationMirrors_84 (accuracy, 5 %)
[notest] Test_focus (no test procedure)
[OK]     Test_Guides_85 (accuracy, 3 %)
[OK]     Test_Guides_86 (accuracy, 3 %)
[OK]     Test_Guides_87 (accuracy, 2 %)
[OK]     Test_Guides_88 (accuracy, 1 %)
[OK]     Test_Guides_89 (accuracy, 3 %)
[OK]     Test_Guides_90 (accuracy, 2 %)
[OK]     Test_Guides_91 (accuracy, 3 %)
[OK]     Test_Guides_92 (accuracy, 3 %)
[OK]     Test_Guides_Curved_93 (accuracy, 3 %)
[OK]     Test_Guides_Curved_94 (accuracy, 1 %)
[OK]     Test_Guides_Curved_95 (accuracy, 3 %)
[OK]     Test_Guides_Curved_96 (accuracy, 1 %)
[OK]     Test_Jump_Iterate_97 (accuracy, 4 %)
[notest] Test_Lens (no test procedure)
[OK]     Test_Magnetic_Constant_98 (accuracy, 0 %)
[OK]     Test_Magnetic_Majorana_99 (accuracy, 0 %)
[OK]     Test_Magnetic_Rotation_100 (accuracy, fair 9 %)
[OK]     Test_Magnetic_Userdefined_101 (accuracy, 2 %)
[FAILED] Test_MCPL_input_102 (compilation/execution)
[FAILED] Test_MCPL_output_103 (compilation/execution)
[OK]     Test_Monitor_Sqw_104 (accuracy, 5 %)
[OK]     Test_Monitor_Sqw_105 (accuracy, 6 %)
[OK]     Test_Monochromators_106 (accuracy, 3 %)
[OK]     Test_Monochromators_107 (accuracy, 8 %)
[OK]     Test_Monochromators_108 (accuracy, 2 %)
[OK]     Test_Monochromators_109 (accuracy, 1 %)
[OK]     Test_Monochromators_110 (accuracy, 1 %)
[OK]     Test_Pol_Bender_111 (accuracy, 1 %)
[OK]     Test_Pol_Bender_Vs_Guide_Curved_112 (accuracy, 11 %)
[OK]     Test_Pol_Guide_Vmirror_113 (accuracy, 1 %)
[OK]     Test_Pol_Mirror_114 (accuracy, 1 %)
[OK]     Test_Pol_MSF_115 (accuracy, 1 %)
[OK]     Test_Pol_Set_116 (accuracy, 0 %)
[notest] Test_Pol_SF_ideal (no test procedure)
[FAILED] Test_pol_tabled_117 (accuracy off by 53 %)
[OK]     Test_Pol_TripleAxis_118 (accuracy, 2 %)
[notest] Test_PowderN_Res (no test procedure)
[notest] Test_PreMonitor_nD (no test procedure)
[OK]     Test_PSD_Detector_119 (accuracy, 1 %)
[notest] Test_Sample_nxs_diffraction (no test procedure)
[notest] Test_Sample_nxs_imaging (no test procedure)
[notest] Test_Scatter_log_losses (no test procedure)
[notest] Test_Scatter_log_mvalues (no test procedure)
[notest] Test_Scatter_log_ssw_mcnp (no test procedure)
[OK]     Test_Selectors_120 (accuracy, 1 %)
[OK]     Test_Selectors_121 (accuracy, 1 %)
[notest] Test_shellguides (no test procedure)
[OK]     Test_Sources_122 (accuracy, 1 %)
[OK]     Test_Sources_123 (accuracy, 1 %)
[OK]     Test_Sources_124 (accuracy, 0 %)
[OK]     Test_Sources_125 (accuracy, 0 %)
[OK]     Test_Sources_126 (accuracy, 1 %)
[OK]     Test_Sources_127 (accuracy, 1 %)
[OK]     Test_Sources_128 (accuracy, 1 %)
[OK]     Test_Sources_129 (accuracy, 1 %)
[notest] Test_Sqq_w (no test procedure)
[notest] Test_SSR_SSW (no test procedure)
[notest] Test_SSR_SSW_Guide (no test procedure)
[FAILED] Test_StatisticalChopper_130 (accuracy off by 3853 %)
[OK]     Tomography_131 (accuracy, 1 %)
[notest] Union_demonstration (no test procedure)
[notest] Union_demonstration_absorption_image (no test procedure)
[notest] Union_external_component (no test procedure)
[notest] Union_external_component_test (no test procedure)
[notest] Union_incoherent_validation (no test procedure)
[OK]     Union_laue_camera_132 (accuracy, 8 %)
[notest] Union_manual_example (no test procedure)
[notest] Union_powder_validation (no test procedure)
[notest] Union_sample_picture_replica (no test procedure)
[OK]     Union_single_crystal_validation_133 (accuracy, 8 %)
[notest] Union_tagging_demo (no test procedure)
[notest] Union_test_absorption (no test procedure)
[notest] Union_test_absorption_image (no test procedure)
[notest] Union_test_box (no test procedure)
[notest] Union_test_mask (no test procedure)
[notest] Union_test_powder (no test procedure)
[notest] Union_time_of_flight (no test procedure)
[notest] Vin_test (no test procedure)
[notest] Vout_test (no test procedure)

# Execution check:    FAILED. 3 instrument(s) did not compile/execute.
# >> Check instruments and mcstas installation.
# End Date: Mon Aug 20 15:34:29 2018
willend commented 6 years ago

Closing, as a long-wanted transfer to 64bit on Windows fixes this.