-
Notifications
You must be signed in to change notification settings - Fork 542
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
Comments
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 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
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? |
For the exporting to XML strategy, if this is still not working, can you share the resulting |
Yes, it makes it through the monte carlo solve in
Below is the xml file
|
Note that to install from source, I had to |
My |
Another idea that might help narrow down what is causing this -- can you try running this through the
It should crash at some point after you |
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!
|
Your 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:
|
Also: which compiler version are you using? |
When I run
When I recompile and run your test code, I don't get past
So it appears that xt::argmin is producing the error here. I'm running with xtensor version 0.25.0. |
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. |
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 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:
|
Actually -- no need to downgrade your LLVM. It looks like there is an easy workaround here, as the |
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. |
@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
I receive an error in the run() step
I can successfully run without converting to multigroup or random ray, and I have set
OPENMC_CROSS_SECTIONS
to the correct path forendfb-viii.0-hdf5/cross_sections.xml
.The text was updated successfully, but these errors were encountered: