Skip to content

LLVM 20 Fails at Loading MGXS Data Files #3367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nickschw2 opened this issue Apr 7, 2025 · 14 comments · Fixed by #3368
Closed

LLVM 20 Fails at Loading MGXS Data Files #3367

nickschw2 opened this issue Apr 7, 2025 · 14 comments · Fixed by #3368
Assignees
Labels

Comments

@nickschw2
Copy link

@jtramm thank you for adding the random ray auto conversion functionality! I'm new to random ray and mgxs, so this is a great starting point. When I run the following on my Mac M4

import openmc
model = openmc.examples.pwr_pin_cell()
model.convert_to_multigroup()
model.convert_to_random_ray()
model.run()

I receive an error in the run() step

Reading model XML file 'model.xml' ...
 Reading cross sections HDF5 file...
 Loading cross section data...
 Loading UO2__2_4__ data...
libc++abi: terminating due to uncaught exception of type std::bad_array_new_length: bad_array_new_length
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    model.run()
    ~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/openmc/model/model.py", line 744, in run
    openmc.run(particles, threads, geometry_debug, restart_file,
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               tracks, output, Path('.'), openmc_exec, mpi_args,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               event_based, path_input)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/openmc/executor.py", line 314, in run
    _run(args, output, cwd)
    ~~~~^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/openmc/executor.py", line 125, in _run
    raise RuntimeError(error_msg)
RuntimeError: OpenMC aborted unexpectedly.

I can successfully run without converting to multigroup or random ray, and I have set OPENMC_CROSS_SECTIONS to the correct path for endfb-viii.0-hdf5/cross_sections.xml.

@nickschw2 nickschw2 added the Bugs label Apr 7, 2025
@jtramm jtramm self-assigned this Apr 7, 2025
@jtramm
Copy link
Contributor

jtramm commented Apr 7, 2025

Sorry to hear this isn't working for you!

I was able to run your example cleanly on my end, so am not able to reproduce this error yet. Can you show the full output of things when you run it? Is it making it through the monte carlo solve at the beginning? Note -- it will load any mgxs.h5 file it finds in that directory, so you may want to delete that, or change things to:

import openmc
model = openmc.examples.pwr_pin_cell()
model.convert_to_multigroup(overwrite_mgxs_library=True)
model.convert_to_random_ray()
model.run()

to ensure the expected mgxs.h5 file is being generated. That said, when I substitute in a mgxs.h5 file that doesn't have the expected material data in it, I get:

Existing MGXS library file "mgxs.h5" will be used
                                %%%%%%%%%%%%%%%
                           %%%%%%%%%%%%%%%%%%%%%%%%
                        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                    %%%%%%%%%%%%%%%%%%%%%%%%
                                     %%%%%%%%%%%%%%%%%%%%%%%%
                 ###############      %%%%%%%%%%%%%%%%%%%%%%%%
                ##################     %%%%%%%%%%%%%%%%%%%%%%%
                ###################     %%%%%%%%%%%%%%%%%%%%%%%
                ####################     %%%%%%%%%%%%%%%%%%%%%%
                #####################     %%%%%%%%%%%%%%%%%%%%%
                ######################     %%%%%%%%%%%%%%%%%%%%
                #######################     %%%%%%%%%%%%%%%%%%
                 #######################     %%%%%%%%%%%%%%%%%
                 ######################     %%%%%%%%%%%%%%%%%
                  ####################     %%%%%%%%%%%%%%%%%
                    #################     %%%%%%%%%%%%%%%%%
                     ###############     %%%%%%%%%%%%%%%%
                       ############     %%%%%%%%%%%%%%%
                          ########     %%%%%%%%%%%%%%
                                      %%%%%%%%%%%

                 | The OpenMC Monte Carlo Code
       Copyright | 2011-2025 MIT, UChicago Argonne LLC, and contributors
         License | https://docs.openmc.org/en/latest/license.html
         Version | 0.15.3-dev5
     Commit Hash | 07f5334616c2ca92ad0a04dfa8c900e080509f70
       Date/Time | 2025-04-07 12:00:41
  OpenMP Threads | 10

 Reading model XML file 'model.xml' ...
 Reading cross sections HDF5 file...
 ERROR: Could not find nuclide UO2__2_4__ in the nuclear data library.
Traceback (most recent call last):
  File "/Users/jtramm/tmp/automagic_test/test.py", line 5, in <module>
    model.run()
    ~~~~~~~~~^^
  File "/Users/jtramm/openmc/openmc/model/model.py", line 744, in run
    openmc.run(particles, threads, geometry_debug, restart_file,
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               tracks, output, Path('.'), openmc_exec, mpi_args,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               event_based, path_input)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jtramm/openmc/openmc/executor.py", line 314, in run
    _run(args, output, cwd)
    ~~~~^^^^^^^^^^^^^^^^^^^
  File "/Users/jtramm/openmc/openmc/executor.py", line 125, in _run
    raise RuntimeError(error_msg)
RuntimeError: Could not find nuclide UO2__2_4__ in the nuclear data library.

Which looks different than what you're seeing. So this may be something else. I'm currently using Python 3.13.2.

Another thing we can try is to instead do:

import openmc
model = openmc.examples.pwr_pin_cell()
model.convert_to_multigroup(overwrite_mgxs_library=True)
model.convert_to_random_ray()
model.export_to_model_xml()

and then run manually on the command line -- perhaps the error message will be more insightful?

@jtramm
Copy link
Contributor

jtramm commented Apr 7, 2025

For the exporting to XML strategy, if this is still not working, can you share the resulting model.xml file? I could then try running this to see if something is going wrong on the python side vs. the C++ side.

@nickschw2
Copy link
Author

Yes, it makes it through the monte carlo solve in model.convert_to_multigroup(overwrite_mgxs_library=True) no problem. I'm running in a conda environment with python version 3.13.2, as well. I've exported it to xml and run from command line, and the issue persists. Though I'll note the error message is not ERROR: Could not find nuclide UO2__2_4__ in the nuclear data library. but rather

                                %%%%%%%%%%%%%%%
                           %%%%%%%%%%%%%%%%%%%%%%%%
                        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                    %%%%%%%%%%%%%%%%%%%%%%%%
                                     %%%%%%%%%%%%%%%%%%%%%%%%
                 ###############      %%%%%%%%%%%%%%%%%%%%%%%%
                ##################     %%%%%%%%%%%%%%%%%%%%%%%
                ###################     %%%%%%%%%%%%%%%%%%%%%%%
                ####################     %%%%%%%%%%%%%%%%%%%%%%
                #####################     %%%%%%%%%%%%%%%%%%%%%
                ######################     %%%%%%%%%%%%%%%%%%%%
                #######################     %%%%%%%%%%%%%%%%%%
                 #######################     %%%%%%%%%%%%%%%%%
                 ######################     %%%%%%%%%%%%%%%%%
                  ####################     %%%%%%%%%%%%%%%%%
                    #################     %%%%%%%%%%%%%%%%%
                     ###############     %%%%%%%%%%%%%%%%
                       ############     %%%%%%%%%%%%%%%
                          ########     %%%%%%%%%%%%%%
                                      %%%%%%%%%%%

                 | The OpenMC Monte Carlo Code
       Copyright | 2011-2025 MIT, UChicago Argonne LLC, and contributors
         License | https://docs.openmc.org/en/latest/license.html
         Version | 0.15.3-dev5
     Commit Hash | 07f5334616c2ca92ad0a04dfa8c900e080509f70
       Date/Time | 2025-04-07 13:19:55
  OpenMP Threads | 14

 Reading model XML file 'model.xml' ...
 Reading cross sections HDF5 file...
 Loading cross section data...
 Loading UO2__2_4__ data...
libc++abi: terminating due to uncaught exception of type std::bad_array_new_leng
Abort trap: 6

Below is the xml file

<?xml version='1.0' encoding='utf-8'?>
<model>
  <materials>
    <cross_sections>/Users/Nick/programs/openmc/random_ray_test/mgxs.h5</cross_sections>
    <material depletable="true" id="1" name="UO2__2_4__">
      <density units="macro" value="1.0"/>
      <macroscopic name="UO2__2_4__"/>
    </material>
    <material id="2" name="Zircaloy">
      <density units="macro" value="1.0"/>
      <macroscopic name="Zircaloy"/>
    </material>
    <material id="3" name="Hot_borated_water">
      <density units="macro" value="1.0"/>
      <macroscopic name="Hot_borated_water"/>
    </material>
  </materials>
  <geometry>
    <cell id="1" material="1" name="Fuel" region="-1" universe="0"/>
    <cell id="2" material="2" name="Cladding" region="1 -2" universe="0"/>
    <cell id="3" material="3" name="Water" region="2 3 -4 5 -6" universe="0"/>
    <surface coeffs="0 0 0.39218" id="1" name="Fuel OR" type="z-cylinder"/>
    <surface coeffs="0 0 0.4572" id="2" name="Clad OR" type="z-cylinder"/>
    <surface boundary="reflective" coeffs="-0.63" id="3" name="left" type="x-plane"/>
    <surface boundary="reflective" coeffs="0.63" id="4" name="right" type="x-plane"/>
    <surface boundary="reflective" coeffs="-0.63" id="5" name="bottom" type="y-plane"/>
    <surface boundary="reflective" coeffs="0.63" id="6" name="top" type="y-plane"/>
  </geometry>
  <settings>
    <run_mode>eigenvalue</run_mode>
    <particles>60</particles>
    <batches>10</batches>
    <inactive>5</inactive>
    <source particle="neutron" strength="1.0" type="independent">
      <space type="box">
        <parameters>-0.63 -0.63 -1 0.63 0.63 1</parameters>
      </space>
      <constraints>
        <fissionable>true</fissionable>
      </constraints>
    </source>
    <energy_mode>multi-group</energy_mode>
    <random_ray>
      <source particle="neutron" strength="1.0" type="independent">
        <space type="box">
          <parameters>-0.63 -0.63 -1.0 0.63 0.63 1.0</parameters>
        </space>
      </source>
      <distance_inactive>30.0</distance_inactive>
      <distance_active>150.0</distance_active>
    </random_ray>
  </settings>
  <plots>
    <plot basis="xy" color_by="material" id="1" type="slice">
      <pixels>300 300</pixels>
      <origin>0.0 0.0 0.0</origin>
      <width>1.26 1.26</width>
    </plot>
  </plots>
</model>

@nickschw2
Copy link
Author

Note that to install from source, I had to brew uninstall xtensor and use the submodules that cmake finds, as per this user support post. I'm not sure if this problem is related to the errors above.

@jtramm
Copy link
Contributor

jtramm commented Apr 7, 2025

My model.xml is looking identical to yours (save for the difference in path to the mgxs.h5 file, but that's expected). One last thing to check would be if there are differences in our mgxs.h5 files themselves -- can you share that one, if possible?

@jtramm
Copy link
Contributor

jtramm commented Apr 7, 2025

Another idea that might help narrow down what is causing this -- can you try running this through the lldb debugger, e.g.:

lldb openmc
run
bt

It should crash at some point after you run it, and then you can see the full stack trace of where the program was with the backtrace (bt) command. If you can send the results of this, then we would at least know the line number in OpenMC where things are going wrong.

@nickschw2
Copy link
Author

Github won't let me attach .h5 files, so I've uploaded it to dropbox. Let me know if you're having trouble downloading it.

Here's the output of the debugger. Thanks for taking the time to help me solve this, I really appreciate it!

Process 27990 launched: '/usr/local/bin/openmc' (arm64)
                                %%%%%%%%%%%%%%%
                           %%%%%%%%%%%%%%%%%%%%%%%%
                        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                    %%%%%%%%%%%%%%%%%%%%%%%%
                                     %%%%%%%%%%%%%%%%%%%%%%%%
                 ###############      %%%%%%%%%%%%%%%%%%%%%%%%
                ##################     %%%%%%%%%%%%%%%%%%%%%%%
                ###################     %%%%%%%%%%%%%%%%%%%%%%%
                ####################     %%%%%%%%%%%%%%%%%%%%%%
                #####################     %%%%%%%%%%%%%%%%%%%%%
                ######################     %%%%%%%%%%%%%%%%%%%%
                #######################     %%%%%%%%%%%%%%%%%%
                 #######################     %%%%%%%%%%%%%%%%%
                 ######################     %%%%%%%%%%%%%%%%%
                  ####################     %%%%%%%%%%%%%%%%%
                    #################     %%%%%%%%%%%%%%%%%
                     ###############     %%%%%%%%%%%%%%%%
                       ############     %%%%%%%%%%%%%%%
                          ########     %%%%%%%%%%%%%%
                                      %%%%%%%%%%%

                 | The OpenMC Monte Carlo Code
       Copyright | 2011-2025 MIT, UChicago Argonne LLC, and contributors
         License | https://docs.openmc.org/en/latest/license.html
         Version | 0.15.3-dev5
     Commit Hash | 07f5334616c2ca92ad0a04dfa8c900e080509f70
       Date/Time | 2025-04-07 16:15:26
  OpenMP Threads | 14

 Reading model XML file 'model.xml' ...
 Reading cross sections HDF5 file...
 Loading cross section data...
 Loading UO2__2_4__ data...
libc++abi: terminating due to uncaught exception of type std::bad_array_new_length: bad_array_new_length
Process 27990 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x000000019823b720 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x19823b720 <+8>:  b.lo   0x19823b740    ; <+40>
    0x19823b724 <+12>: pacibsp 
    0x19823b728 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x19823b72c <+20>: mov    x29, sp
Target 0: (openmc) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x000000019823b720 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x0000000198273f70 libsystem_pthread.dylib`pthread_kill + 288
    frame #2: 0x0000000198180908 libsystem_c.dylib`abort + 128
    frame #3: 0x000000019822a44c libc++abi.dylib`abort_message + 132
    frame #4: 0x0000000198218a24 libc++abi.dylib`demangling_terminate_handler() + 320
    frame #5: 0x0000000197ec13f4 libobjc.A.dylib`_objc_terminate() + 172
    frame #6: 0x0000000198229710 libc++abi.dylib`std::__terminate(void (*)()) + 16
    frame #7: 0x000000019822ccdc libc++abi.dylib`__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 88
    frame #8: 0x000000019822cc84 libc++abi.dylib`__cxa_throw + 92
    frame #9: 0x00000001003af588 libopenmc.dylib`std::__throw_bad_array_new_length[abi:ne200100]() at exceptions.h:67:3 [opt]
    frame #10: 0x0000000100410a18 libopenmc.dylib`void xt::xstrided_container<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>::resize<std::__1::array<unsigned long, 4ul>>(std::__1::array<unsigned long, 4ul>&&, bool) [inlined] std::__1::allocator<double>::allocate[abi:ne200100](this=<unavailable>, __n=<unavailable>) at allocator.h:101:7 [opt]
    frame #11: 0x0000000100410a14 libopenmc.dylib`void xt::xstrided_container<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>::resize<std::__1::array<unsigned long, 4ul>>(std::__1::array<unsigned long, 4ul>&&, bool) [inlined] std::__1::allocator_traits<std::__1::allocator<double>>::pointer xt::detail::safe_init_allocate<std::__1::allocator<double>>(alloc=<unavailable>, size=<unavailable>) at xstorage.hpp:177:33 [opt]
    frame #12: 0x0000000100410a14 libopenmc.dylib`void xt::xstrided_container<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>::resize<std::__1::array<unsigned long, 4ul>>(std::__1::array<unsigned long, 4ul>&&, bool) [inlined] xt::uvector<double, std::__1::allocator<double>>::resize_impl(this=<unavailable>, new_size=<unavailable>) at xstorage.hpp:232:23 [opt]
    frame #13: 0x0000000100410a14 libopenmc.dylib`void xt::xstrided_container<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>::resize<std::__1::array<unsigned long, 4ul>>(std::__1::array<unsigned long, 4ul>&&, bool) [inlined] xt::uvector<double, std::__1::allocator<double>>::resize(this=<unavailable>, size=<unavailable>) at xstorage.hpp:399:9 [opt]
    frame #14: 0x0000000100410a14 libopenmc.dylib`void xt::xstrided_container<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>::resize<std::__1::array<unsigned long, 4ul>>(std::__1::array<unsigned long, 4ul>&&, bool) [inlined] bool xt::resize_container<xt::uvector<double, std::__1::allocator<double>>>(c=<unavailable>, size=<unavailable>) at xutils.hpp:341:11 [opt]
    frame #15: 0x0000000100410a14 libopenmc.dylib`void xt::xstrided_container<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>::resize<std::__1::array<unsigned long, 4ul>>(std::__1::array<unsigned long, 4ul>&&, bool) [inlined] void xt::detail::resize_data_container<xt::uvector<double, std::__1::allocator<double>>, unsigned long>(c=<unavailable>, size=<unavailable>) at xcontainer.hpp:967:13 [opt]
    frame #16: 0x0000000100410a14 libopenmc.dylib`void xt::xstrided_container<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>::resize<std::__1::array<unsigned long, 4ul>>(this=<unavailable>, shape=<unavailable>, force=<unavailable>) at xcontainer.hpp:1019:13 [opt]
    frame #17: 0x0000000100410908 libopenmc.dylib`decltype(auto) xtl::mpl::static_if<bool xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>&, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>> const&)::'lambda'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>), bool xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>&, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>> const&)::'lambda0'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>)>(std::__1::integral_constant<bool, false>, xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag> const&, xt::math::abs_fun const&) [inlined] auto bool xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (this=<unavailable>, (null)=<unavailable>)1, xt::xtensor_expression_tag>, xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>&, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>> const&)::'lambda0'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>)::operator()<xtl::identity>(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>) const at xassign.hpp:609:20 [opt]
    frame #18: 0x0000000100410820 libopenmc.dylib`decltype(auto) xtl::mpl::static_if<bool xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>&, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>> const&)::'lambda'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>), bool xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>&, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>> const&)::'lambda0'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>)>((null)=<unavailable>, (null)=<unavailable>, ff=<unavailable>) at xmeta_utils.hpp:597:20 [opt]
    frame #19: 0x00000001004106a4 libopenmc.dylib`void xt::xexpression_assigner<xt::xtensor_expression_tag>::assign_xexpression<xt::xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>, xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>>(xt::xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>&, xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&) [inlined] decltype(auto) xtl::mpl::static_if<false, bool xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>&, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>> const&)::'lambda'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>), bool xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>&, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>> const&)::'lambda0'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>)>(tf=0x000000016fdfe308, ff=0x000000016fdfe310) at xmeta_utils.hpp:603:20 [opt]
    frame #20: 0x0000000100410698 libopenmc.dylib`void xt::xexpression_assigner<xt::xtensor_expression_tag>::assign_xexpression<xt::xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>, xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>>(xt::xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>&, xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&) [inlined] bool xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>(e1=0x000000016fdfe3b0, e2=0x000000016fdfe5a0) at xassign.hpp:588:16 [opt]
    frame #21: 0x000000010041068c libopenmc.dylib`void xt::xexpression_assigner<xt::xtensor_expression_tag>::assign_xexpression<xt::xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>, xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>>(e1=0x000000016fdfe418, e2=0x000000016fdfe5a0) at xassign.hpp:487:34 [opt]
    frame #22: 0x0000000100410348 libopenmc.dylib`auto xt::argmin<(xt::layout_type)1, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&) [inlined] auto void xt::assign_xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(this=<unavailable>, (null)=<unavailable>)1, xt::xtensor_expression_tag>>&, xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&)::'lambda0'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>)::operator()<xtl::identity>(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>) const at xassign.hpp:226:17 [opt]
    frame #23: 0x0000000100410340 libopenmc.dylib`auto xt::argmin<(xt::layout_type)1, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&) [inlined] decltype(auto) xtl::mpl::static_if<void xt::assign_xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>&, xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&)::'lambda'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>), void xt::assign_xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>&, xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&)::'lambda0'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>)>((null)=<unavailable>, (null)=<unavailable>, ff=<unavailable>) at xmeta_utils.hpp:597:20 [opt]
    frame #24: 0x0000000100410340 libopenmc.dylib`auto xt::argmin<(xt::layout_type)1, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&) [inlined] decltype(auto) xtl::mpl::static_if<false, void xt::assign_xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>&, xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&)::'lambda'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>), void xt::assign_xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>&, xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&)::'lambda0'(xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>)>(tf=<unavailable>, ff=<unavailable>) at xmeta_utils.hpp:603:20 [opt]
    frame #25: 0x0000000100410340 libopenmc.dylib`auto xt::argmin<(xt::layout_type)1, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&) [inlined] void xt::assign_xexpression<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(e1=<unavailable>, e2=0x000000016fdfe5a0) at xassign.hpp:217:9 [opt]
    frame #26: 0x0000000100410340 libopenmc.dylib`auto xt::argmin<(xt::layout_type)1, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&) [inlined] xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>& xt::xcontainer_semantic<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>::assign_xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(this=<unavailable>, e=0x000000016fdfe5a0) at xsemantic.hpp:624:9 [opt]
    frame #27: 0x0000000100410340 libopenmc.dylib`auto xt::argmin<(xt::layout_type)1, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&) [inlined] xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>& xt::xsemantic_base<xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>>::assign<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(this=<unavailable>, e=0x000000016fdfe5a0) at xsemantic.hpp:490:37 [opt]
    frame #28: 0x0000000100410340 libopenmc.dylib`auto xt::argmin<(xt::layout_type)1, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&) [inlined] xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>::xtensor_container<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(this=0x000000016fdfe3b0, e=0x000000016fdfe5a0) at xtensor.hpp:572:24 [opt]
    frame #29: 0x00000001004102c0 libopenmc.dylib`auto xt::argmin<(xt::layout_type)1, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&) [inlined] xt::xtensor_container<xt::uvector<double, std::__1::allocator<double>>, 4ul, (xt::layout_type)1, xt::xtensor_expression_tag>::xtensor_container<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(this=0x000000016fdfe3b0, e=0x000000016fdfe5a0) at xtensor.hpp:564:5 [opt]
    frame #30: 0x00000001004102c0 libopenmc.dylib`auto xt::argmin<(xt::layout_type)1, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(xt::xexpression<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>> const&) [inlined] std::__1::enable_if<!detail::is_container<__decay(xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>> const&)>::value, xt::temporary_type<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>> const&, void>::type>::type xt::eval<xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>> const&>(t=0x000000016fdfe5a0) at xeval.hpp:56:16 [opt]
    frame #31: 0x00000001004102c0 libopenmc.dylib`auto xt::argmin<(xt::layout_type)1, xt::xfunction<xt::math::abs_fun, xt::xfunction<xt::detail::minus, xt::xarray_container<xt::uvector<double, std::__1::allocator<double>>, (xt::layout_type)1, xt::svector<unsigned long, 4ul, std::__1::allocator<unsigned long>, true>, xt::xtensor_expression_tag> const&, xt::xscalar<double const&>>>>(e=0x000000016fdfe5a0) at xsort.hpp:1246:21 [opt]
    frame #32: 0x000000010040f230 libopenmc.dylib`openmc::Mgxs::metadata_from_hdf5(this=0x00006000037d40d0, xs_id=144115188075855872, temperature=<unavailable>, temps_to_read=size=0, order_dim=0x000000016fdfe87c) at mgxs.cpp:102:24 [opt]
    frame #33: 0x00000001004112c8 libopenmc.dylib`openmc::Mgxs::Mgxs(this=0x00006000037d40d0, xs_id=144115188075855872, temperature=<unavailable>, num_group=<unavailable>, num_delay=<unavailable>) at mgxs.cpp:267:3 [opt]
    frame #34: 0x0000000100416428 libopenmc.dylib`openmc::Mgxs* std::__1::vector<openmc::Mgxs, std::__1::allocator<openmc::Mgxs>>::__emplace_back_slow_path<long long&, std::__1::vector<double, std::__1::allocator<double>> const&, int&, int&>(long long&, std::__1::vector<double, std::__1::allocator<double>> const&, int&, int&) [inlined] void std::__1::allocator<openmc::Mgxs>::construct[abi:ne200100]<openmc::Mgxs, long long&, std::__1::vector<double, std::__1::allocator<double>> const&, int&, int&>(this=0x0000000100528928, __p=<unavailable>, __args=0x000000016fdfee28, __args=<unavailable>, __args=0x00000001005288c0, __args=0x00000001005288c4) at allocator.h:153:24 [opt]
    frame #35: 0x0000000100416414 libopenmc.dylib`openmc::Mgxs* std::__1::vector<openmc::Mgxs, std::__1::allocator<openmc::Mgxs>>::__emplace_back_slow_path<long long&, std::__1::vector<double, std::__1::allocator<double>> const&, int&, int&>(long long&, std::__1::vector<double, std::__1::allocator<double>> const&, int&, int&) [inlined] void std::__1::allocator_traits<std::__1::allocator<openmc::Mgxs>>::construct[abi:ne200100]<openmc::Mgxs, long long&, std::__1::vector<double, std::__1::allocator<double>> const&, int&, int&, 0>(__a=0x0000000100528928, __p=<unavailable>, __args=0x000000016fdfee28, __args=<unavailable>, __args=0x00000001005288c0, __args=0x00000001005288c4) at allocator_traits.h:309:9 [opt]
    frame #36: 0x0000000100416414 libopenmc.dylib`openmc::Mgxs* std::__1::vector<openmc::Mgxs, std::__1::allocator<openmc::Mgxs>>::__emplace_back_slow_path<long long&, std::__1::vector<double, std::__1::allocator<double>> const&, int&, int&>(this=0x0000000100528928 size=0, __args=0x000000016fdfee28, __args=<unavailable>, __args=0x00000001005288c0, __args=0x00000001005288c4) at vector.h:1116:3 [opt]
    frame #37: 0x0000000100415e40 libopenmc.dylib`openmc::MgxsInterface::add_mgxs(long long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::vector<double, std::__1::allocator<double>> const&) [inlined] openmc::Mgxs& std::__1::vector<openmc::Mgxs, std::__1::allocator<openmc::Mgxs>>::emplace_back<long long&, std::__1::vector<double, std::__1::allocator<double>> const&, int&, int&>(this=<unavailable>, __args=0x000000016fdfee28, __args=size=0, __args=0x00000001005288c0, __args=<unavailable>) at vector.h:1136:13 [opt]
    frame #38: 0x0000000100415e34 libopenmc.dylib`openmc::MgxsInterface::add_mgxs(this=0x00000001005288c0, file_id=72057594037927937, name=Summary Unavailable, temperature=size=0) at mgxs_interface.cpp:111:13 [opt]
    frame #39: 0x0000000100415488 libopenmc.dylib`openmc::MgxsInterface::init(this=0x00000001005288c0) at mgxs_interface.cpp:88:5 [opt]
    frame #40: 0x00000001003c5e5c libopenmc.dylib`openmc::finalize_cross_sections() at cross_sections.cpp:347:16 [opt]
    frame #41: 0x00000001003e3058 libopenmc.dylib`openmc::read_model_xml() at initialize.cpp:402:3 [opt]
    frame #42: 0x00000001003e1ef4 libopenmc.dylib`openmc_init(argc=<unavailable>, argv=<unavailable>, intracomm=0x0000000000000000) at initialize.cpp:118:8 [opt]
    frame #43: 0x0000000100002f70 openmc`main(argc=<unavailable>, argv=<unavailable>) at main.cpp:22:9 [opt]
    frame #44: 0x0000000197ef4274 dyld`start + 2840

@jtramm
Copy link
Contributor

jtramm commented Apr 7, 2025

Your mgxs.h5 runs cleanly for me as well. The lldb output is interesting -- it seems to be happening on line 102 of mgxs.cpp:

      auto i_closest = xt::argmin(xt::abs(temps_available - T))[0];

and then the problem happens somewhere inside there (which is all xtensor code).

One way to test is to add the following code right before line 102 of mgxs.cpp and recompile:

      // Print out the temps_available xarray and the temperature "T" for debugging:
      fmt::print("There are {} available temperatures: ", temps_available.size());
      for (const auto& temp : temps_available) {
        fmt::print("{} ", temp);
      }
      fmt::print("\nRequested temperature: {}\n", T);
      fmt::print("abs(temps_available - T): ");
      auto abs_diff = xt::abs(temps_available - T);
      for (const auto& diff : abs_diff) {
        fmt::print("{} ", diff);
      }
      fmt::print("\n");
      auto test_closest = xt::argmin(xt::abs(temps_available - T));
      auto test_closest_0 = test_closest[0];
      fmt::print("Index of closest temperature: {}\n", test_closest_0);

On mine, when I run the model.xml I get:

 Loading UO2__2_4__ data...
There are 1 available temperatures: 294 
Requested temperature: 293.59999999999997
abs(temps_available - T): 0.4000000000000341 
Index of closest temperature: 0
 Loading Zircaloy data...
There are 1 available temperatures: 294 
Requested temperature: 293.59999999999997
abs(temps_available - T): 0.4000000000000341 
Index of closest temperature: 0
 Loading Hot_borated_water data...
There are 1 available temperatures: 294 
Requested temperature: 293.59999999999997
abs(temps_available - T): 0.4000000000000341 
Index of closest temperature: 0

@jtramm
Copy link
Contributor

jtramm commented Apr 7, 2025

Also: which compiler version are you using?

@nickschw2
Copy link
Author

When I run cmake .. my compiler is id'd as

-- The C compiler identification is Clang 20.1.2
-- The CXX compiler identification is Clang 20.1.2

When I recompile and run your test code, I don't get past auto test_closest = xt::argmin(xt::abs(temps_available - T)); with error. I confirmed this was the problem line and not auto test_closest_0 = test_closest[0]; by adding another print statement between the two.

Loading UO2__2_4__ data...
libc++abi: terminating due to uncaught exception of type std::bad_array_new_length: bad_array_new_length
There are 1 available temperatures: 294 
Requested temperature: 293.59999999999997
abs(temps_available - T): 0.4000000000000341 
Traceback (most recent call last):
  File "/Users/Nick/programs/openmc/random_ray_test/random_ray.py", line 6, in <module>
    model.run()
    ~~~~~~~~~^^
  File "/opt/miniconda3/envs/openmc-dev/lib/python3.13/site-packages/openmc/model/model.py", line 744, in run
    openmc.run(particles, threads, geometry_debug, restart_file,
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               tracks, output, Path('.'), openmc_exec, mpi_args,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               event_based, path_input)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/openmc-dev/lib/python3.13/site-packages/openmc/executor.py", line 314, in run
    _run(args, output, cwd)
    ~~~~^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/openmc-dev/lib/python3.13/site-packages/openmc/executor.py", line 125, in _run
    raise RuntimeError(error_msg)
RuntimeError: OpenMC aborted unexpectedly.

So it appears that xt::argmin is producing the error here. I'm running with xtensor version 0.25.0.

@nickschw2
Copy link
Author

For what it's worth, I can copy the model.xml and mgxs.h5 file produced by the auto conversion and run the model in a separate conda environment with the stable, conda-installed 0.15.2 version of openmc and the simulation executes fine.

@jtramm
Copy link
Contributor

jtramm commented Apr 8, 2025

I upgraded my LLVM clang from 19 to 20.1.2 and this appears to be causing all sorts of issues with loading multigroup data files. E.g., even the openmc/examples/pincell_multigroup monte carlo example gives the same error you're getting. So -- this is not related to the random ray solver or FW-CADIS, but due to something being up with LLVM v20 and reading in multigroup data files.

The good news is that I can now reproduce the error on my end! I'll start figuring out if it is something wrong with xtensor, hdf5, or if there was a bug in LLVM.

If you want to just get up and running, an easy workaround would be to change which compiler you're using. If you installed via homebrew, you could do:

brew uninstall llvm
brew install llvm@18

@jtramm jtramm changed the title Automagic random ray can't find cross-section data LLVM 20 Fails at Loading MGXS Data Files Apr 8, 2025
@jtramm
Copy link
Contributor

jtramm commented Apr 8, 2025

Actually -- no need to downgrade your LLVM. It looks like there is an easy workaround here, as the argmin function can just be replaced with something else. I have put in a fix (PR #3368), so once that's merged things should work find again with LLVM 20.

@nickschw2
Copy link
Author

Ah ha! That's great help, thanks. I'm running now with the commits from PR #3368 and it's all working well. I'll merge once it's done with the checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants