Closed rebeccafair closed 2 years ago
After some investigation, it seems that the points listed in the error message are
To try and work out what the problem could be, and confirm that the points are outside of the irreducible Brillouin zone, I resorted to using bz.ir_moveinto
and brille.plotting
:
q1, _,_,_ = bz.ir_moveinto(qpts, 1)
q4, _,_,_ = bz.ir_moveinto(qpts, 4)
ax =bp.plot(grid.BrillouinZone, show=False, units='rlu');
bp.plot(q1, axs=ax, show=False);
bp.plot(q4, axs=ax)
Plotted separately, for 1 thread:
and 4 threads (though this is run dependent)
There are clearly points outside of the irreducible Brillouin zone, which points to a problem with bz.ir_moveinto
.
The implementation of BrillouinZone::ir_moveinto
includes an OpenMP parallel for loop which called BrillouinZone::isinside_wedge
which also contains a parallel for loop. The nested parallel for loops caused ir_moveinto
to fail silently in some cases.
Since the call to isinside_wedge
from ir_moveinto
can be refactored to only-ever check one point the inner loop is redudant and a new private method has been written to perform the same isinside_wedge
calculation for a single point.
This change is now in a pull request which should alleviate the problem.
When I run the following script:
I get the following error:
This only seems to happen when
useparallel=True
andthreads>=1
and is a bit intermittent. I am usingBrille 0.5.4
from PyPI on Windows.