Remove C code from the dft_tools project#283
Conversation
There was a problem hiding this comment.
Hi, this looks good to me. I added a numpy vectorized form of the tetrahedron. In my tests this is only a little slower than the C implementation. For 9 bands (5d orbitals NiO) and a 11x11x11 mesh of kpoints (1331) on 3001 grid points I get on my m3 macbook:
33x/log: Elapsed time: 15.8411 seconds
rewrite_py/log: Elapsed time: 24.3028 seconds
for the integration call. Given that this is only used to verify a setup, and should also greatly improve when symmetries are used I think we can safely replace the C code to make dft_tools python only. We can also leverage trivially mpi parallelism if we wish in the calling function in the future.
@opeil any objections?
We should maybe enforce Python support then in this build @Wentzell does this make sense? Currently there is still some code like this:
if(PythonSupport)
add_subdirectory(python)
add_subdirectory(python/plovasp)
add_subdirectory(python/elk)
endif()
in the cmake files.
Best,
Alex
c00ec5d to
872edfe
Compare
C++ code has been completely removed from the codebase. This commit removes all related CMake configuration: - Remove PythonSupport option (Python is now always built) - Remove cpp2py dependency from deps/CMakeLists.txt - Remove cpp2py module building logic from python/triqs_dft_tools/ - Remove wrap_generators handling (no *_desc.py files exist) - Update project description to remove cpp2py reference The project now builds Python-only components without conditional C++ support checks.
|
I removed now all C++ dependencies in cmake and also rebased this branch on top of dft_tools/unstable (was previously 3.3.x) . Can you have a look @Wentzell if I removed the right things (I removed also dependency on cpp2py). Thanks! |
Wentzell
left a comment
There was a problem hiding this comment.
I pushed some additional cleanups for the project structure / CMake. This looks good to be merged.
61add34 to
0298f18
Compare
Summary
This PR ports the C++ code in dft_tools to pure Python. Specifically, it replaces the linear tetrahedron integration routine from the VASP converter—used to calculate the density of states—with a Python implementation. Since this routine is not performance-critical, a Python version improves maintainability without impacting efficiency.
As a result, the dft_tools repository is now a Python + Fortran (via f2py) project.
Key Changes
c++/triqs_dft_tools/converters/vasp/.python/triqs_dft_tools/converters/vasp/plovasp/lintetra.py