Open cfichtlscherer opened 10 months ago
Update:
Actually there were some warnings during the make process:
In file included from /home/gf737457/openmc-13.3/openmc/src/finalize.cpp(18):
/home/gf737457/openmc-13.3/openmc/include/openmc/plot.h(102): warning #858: type qualifier on return type is meaningless
const int id() const { return id_; }
^
In file included from /home/gf737457/openmc-13.3/openmc/src/finalize.cpp(18):
/home/gf737457/openmc-13.3/openmc/include/openmc/plot.h(103): warning #858: type qualifier on return type is meaningless
const int level() const { return level_; }
^
In file included from /home/gf737457/openmc-13.3/openmc/src/initialize.cpp(26):
/home/gf737457/openmc-13.3/openmc/include/openmc/plot.h(102): warning #858: type qualifier on return type is meaningless
const int id() const { return id_; }
^
In file included from /home/gf737457/openmc-13.3/openmc/src/initialize.cpp(26):
/home/gf737457/openmc-13.3/openmc/include/openmc/plot.h(103): warning #858: type qualifier on return type is meaningless
const int level() const { return level_; }
^
In file included from /home/gf737457/openmc-13.3/openmc/src/output.cpp(33):
/home/gf737457/openmc-13.3/openmc/include/openmc/plot.h(102): warning #858: type qualifier on return type is meaningless
const int id() const { return id_; }
^
In file included from /home/gf737457/openmc-13.3/openmc/src/output.cpp(33):
/home/gf737457/openmc-13.3/openmc/include/openmc/plot.h(103): warning #858: type qualifier on return type is meaningless
const int level() const { return level_; }
^
In file included from /home/gf737457/openmc-13.3/openmc/src/plot.cpp(1):
/home/gf737457/openmc-13.3/openmc/include/openmc/plot.h(102): warning #858: type qualifier on return type is meaningless
const int id() const { return id_; }
^
In file included from /home/gf737457/openmc-13.3/openmc/src/plot.cpp(1):
/home/gf737457/openmc-13.3/openmc/include/openmc/plot.h(103): warning #858: type qualifier on return type is meaningless
const int level() const { return level_; }
^
In file included from /home/gf737457/openmc-13.3/openmc/src/settings.cpp(25):
/home/gf737457/openmc-13.3/openmc/include/openmc/plot.h(102): warning #858: type qualifier on return type is meaningless
const int id() const { return id_; }
^
In file included from /home/gf737457/openmc-13.3/openmc/src/settings.cpp(25):
/home/gf737457/openmc-13.3/openmc/include/openmc/plot.h(103): warning #858: type qualifier on return type is meaningless
const int level() const { return level_; }
^
We have tried with
CMAKE_BUILD_TYPE=Debug
which compiles the code without optimizations and the error persists.
We conclude that the problem is not due to the optimization of the compiler.
Seems like the criticality is about three times as high. And checking the statepoint we see that every source point exists three times:
It would be interesting to know if this works when you turn off threading
The criticality values do not change depending on the number of used threads. So OpenMP does not seem to be the problem.
Also compiling without OpenMP does not fix the problem.
That is very strange. Some issue with threading would have been my guess too but it sounds like that's ruled out. Given that the most recent compiler version works, it may have been some weird compiler bug that has since been fixed :man_shrugging:
Seems like the criticality is about three times as high. And checking the statepoint we see that every source point exists three times:
It would be nice to track down what's wrong here, or at least the piece of code that leads to erroneous compiler behavior. I fear this is due to undefined behavior in OpenMC.
How do fixed source calcs look? You could run a fixed source calc that runs both with create_fission_neutrons
true and false. Seems like the problem might lie there.
Sorry for the late reply, and thanks for the good idea.
Since create_fission_neutrons
only affects the fixed_source
simulations, I tried running the pincell example as a fixed source simulation and used diff
to compare the created tallies.out files. With create_fission_neutrons=false
there is no difference.
It seems like the bug is somewhere where the created particles are written to the secondary / fission bank.
Bug Description
This is a bug Sophie, Lukas and I discovered on our university cluster.
Compiling OpenMC with certain ICPC compilers will let you install and run the code without any warnings or error messages, but will return completly wrong results.
For example, the pincell example should return a criticality of around 1.15, compiled with certain ICPC compilers the criticality during the batch will be around 3.5 and the simulation results will be
The entire output can be found in a google docs.
We checked all ICPC compilers on our cluster with the following result:
intel-compilers/2021.2.0 (C) :white_check_mark: intel-compilers/2021.4.0 (C) :no_entry_sign: intel-compilers/Intel 2021.6.0 :no_entry_sign:
intel-compilers/2022.1.0 (C,D) :no_entry_sign: intel-compilers/2022.2.1 (C) :no_entry_sign: intel-compilers/2023.0.0 (L,C) :no_entry_sign: intel-compilers/2023.1.0 (C) :white_check_mark:
(:white_check_mark: = OpenMC returns correct results / :no_entry_sign: = OpenMC returns wrong results)
We were able to produce this bug for
OpenMC 0.13.3
and thedev branch
. We have not checked further OpenMC versions.We were not able to reproduce this bug with other compilers.
Slack discussion
Steps to Reproduce
Install OpenMC from source via
or set the compiler with
Run the pincell example.
Environment
So far we only produced this bug on our cluster and would be happy if someone could try to reproduce.