I'm currently running into problems where sometimes this function seems to hang when called many times with MPI.
Inside a bash script for example, I run the following commands (hoping to get OpenMP not to interfere with a MPI loop)
export MKL_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export OMP_NUM_THREADS=1
mpirun python openMP_test_case.py
where a minimal working example is
import numpy as np
from triqs_tprf.tight_binding import TBLattice
from triqs_tprf.lattice import *
from triqs_tprf.lattice_utils import *
from triqs.gf import *
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
Variable_1_array = np.linspace(0.0, 1.0, 11)
Variable_2_array = np.linspace(0.0, 1.0, 11)
grid = np.array(np.meshgrid(Variable_1_array, Variable_2_array)).T.reshape(-1, 2)
chunks = np.array_split(grid, mpi.size)
chunk = comm.scatter(chunks, root=0)
for c in chunk:
var_1, var_2 = np.round(c, 4)
t = 0.1 + var_1*var_2
H = TBLattice(
units = [(1, 0, 0), (0, 1, 0)],
hopping = {
# nearest neighbour hopping -t
( 0,+1): -t * np.eye(2),
( 0,-1): -t * np.eye(2),
(+1, 0): -t * np.eye(2),
(-1, 0): -t * np.eye(2),
},
orbital_positions = [(0,0,0)]*2,
orbital_names = ['up', 'do'],
)
e_k = H.fourier(H.get_kmesh(n_k=(60, 60, 1)))
DLRmesh = MeshDLRImFreq(beta=100, statistic='Fermion', w_max=10, eps=1e-14)
G_c_wk = lattice_dyson_g0_wk(mu=0.0, e_k=e_k, mesh=DLRmesh)
print("Finished for loop iteration")
print("FINISHED RUNNING ?")
which hangs and never completes. I need to perform operations (like saving data) after this loop, so need to understand how to prevent this hanging.
(this issue also occurs without DLR mesh)
by the way,
I also get a warning when calling lattice_dyson_g0_wk which is probably also worth fixing.
DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
I'm currently running into problems where sometimes this function seems to hang when called many times with MPI.
Inside a bash script for example, I run the following commands (hoping to get OpenMP not to interfere with a MPI loop)
where a minimal working example is
which hangs and never completes. I need to perform operations (like saving data) after this loop, so need to understand how to prevent this hanging.
(this issue also occurs without DLR mesh)
by the way,
I also get a warning when calling
lattice_dyson_g0_wkwhich is probably also worth fixing.DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)