Skip to content

Commit

Permalink
[build] optimize maxent test for mpi
Browse files Browse the repository at this point in the history
  • Loading branch information
the-hampel committed Aug 6, 2023
1 parent 1ebf4f6 commit 2870925
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ foreach(file test_maxent.py helper.py)
endforeach()

add_test(NAME maxent_${test}
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_PREFLAGS} ${TRIQS_PYTHON_EXECUTABLE} test_maxent.py
COMMAND ${TRIQS_PYTHON_EXECUTABLE} test_maxent.py
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

Expand Down
17 changes: 8 additions & 9 deletions test/python/test_maxent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@

from solid_dmft.postprocessing import maxent_gf_imp, maxent_gf_latt

# Runs maxent on lattice Green function and compares afterwards
maxent_gf_latt.main('svo_hubbardI_basic/out/inp.h5', sum_spins=True, n_points_maxent=100, n_points_alpha=25, omega_min=-20, omega_max=20)

# Runs maxent on the impurity Green function
# No comparison to reference because the spectral function would be too "spiky"
# because of HubbardI so that numerical differences can dominate the comparison
maxent_gf_imp.main('svo_hubbardI_basic/out/inp.h5', sum_spins=True, n_points_maxent=100, n_points_alpha=25)
mpi.barrier()

# Runs maxent on lattice Green function and compares afterwards
maxent_gf_latt.main('svo_hubbardI_basic/out/inp.h5', sum_spins=True, n_points_maxent=100, n_points_alpha=25,
omega_min=-20, omega_max=20)
mpi.barrier()
maxent_gf_imp.main('svo_hubbardI_basic/out/inp.h5', sum_spins=True,
n_points_maxent=50, n_points_alpha=20)

if mpi.is_master_node():
print('Comparing Alatt_maxent')
with HDFArchive('svo_hubbardI_basic/out/inp.h5', 'r')['DMFT_results']['last_iter'] as out, \
HDFArchive('svo_hubbardI_basic/ref.h5', 'r')['DMFT_results']['last_iter'] as ref:
with HDFArchive('svo_hubbardI_basic/out/inp.h5', 'r')['DMFT_results']['last_iter'] as out, HDFArchive('svo_hubbardI_basic/ref.h5', 'r')['DMFT_results']['last_iter'] as ref:
assert are_iterables_equal(out['Alatt_maxent'], ref['Alatt_maxent'])

mpi.barrier(1000)

0 comments on commit 2870925

Please sign in to comment.