dftbplus icon indicating copy to clipboard operation
dftbplus copied to clipboard

Compilation with ELSI 2.9 series

Open william-dawson opened this issue 3 years ago • 5 comments

Describe the bug DFTB+ fails to compile with ELSI >= 2.9.0 (works with 2.8.2).

To Reproduce

Get DFTB+ from git 8adfba7ef4b7c9a3bca418bce0889fa92d99fca9

Download ELSI version 2.9.0: https://gitlab.com/elsi_project/elsi_interface/-/archive/v2.9.0/elsi_interface-v2.9.0.tar.gz

Compile ELSI, and then try to compile DFTB+ with ELSI support.

CMAKE_PREFIX_PATH=../../install cmake .. -DWITH_ELSI=Yes -DWITH_OMP=Yes -DWITH_MPI=Yes -DSCALAPACK_LIBRARY="-L/usr/local/lib/ -lscalapack" -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_Fortran_COMPILER=gfortran

gcc/gfortran version 11.3.0.

Output:

/Users/wddawson/Documents/ELSI/comp_problem/dftbplus/src/dftbp/elecsolvers/elsisolver.F90:1864:89:

 1864 |           & this%elsiCsc%numColLocal, this%elsiCsc%rowIndLocal, this%elsiCsc%colPtrLocal)
      |                                                                                         1
Error: Type mismatch in argument 'nnz_g' at (1); passed INTEGER(4) to INTEGER(8)
/Users/wddawson/Documents/ELSI/comp_problem/dftbplus/src/dftbp/elecsolvers/elsisolver.F90:1880:37:

 1880 |           & this%elsiCsc%numColLocal)
      |                                     1
Error: Type mismatch in argument 'nnz_g' at (1); passed INTEGER(4) to INTEGER(8)
/Users/wddawson/Documents/ELSI/comp_problem/dftbplus/src/dftbp/elecsolvers/elsisolver.F90:1882:76:

 1882 |           & this%elsiCsc%rowIndLocal, this%elsiCsc%colPtrLocal, HnzValLocal)
      |                                                                            1
Error: Type mismatch in argument 'col_ptr' at (1); passed INTEGER(4) to INTEGER(8)
/Users/wddawson/Documents/ELSI/comp_problem/dftbplus/src/dftbp/elecsolvers/elsisolver.F90:1884:76:

 1884 |           & this%elsiCsc%rowIndLocal, this%elsiCsc%colPtrLocal, SnzValLocal)
      |                                                                            1
Error: Type mismatch in argument 'col_ptr' at (1); passed INTEGER(4) to INTEGER(8)
/Users/wddawson/Documents/ELSI/comp_problem/dftbplus/src/dftbp/elecsolvers/elsisolver.F90:1743:89:

 1743 |           & this%elsiCsc%numColLocal, this%elsiCsc%rowIndLocal, this%elsiCsc%colPtrLocal)
      |                                                                                         1
Error: Type mismatch in argument 'nnz_g' at (1); passed INTEGER(4) to INTEGER(8)
/Users/wddawson/Documents/ELSI/comp_problem/dftbplus/src/dftbp/elecsolvers/elsisolver.F90:1759:60:

 1759 |           & this%elsiCsc%nnzLocal, this%elsiCsc%numColLocal)
      |                                                            1
Error: Type mismatch in argument 'nnz_g' at (1); passed INTEGER(4) to INTEGER(8)
/Users/wddawson/Documents/ELSI/comp_problem/dftbplus/src/dftbp/elecsolvers/elsisolver.F90:1761:76:

 1761 |           & this%elsiCsc%rowIndLocal, this%elsiCsc%colPtrLocal, HnzValLocal)
      |                                                                            1
Error: Type mismatch in argument 'col_ptr' at (1); passed INTEGER(4) to INTEGER(8)
/Users/wddawson/Documents/ELSI/comp_problem/dftbplus/src/dftbp/elecsolvers/elsisolver.F90:1763:76:

 1763 |           & this%elsiCsc%rowIndLocal, this%elsiCsc%colPtrLocal, SnzValLocal)
      |                                                                            1
Error: Type mismatch in argument 'col_ptr' at (1); passed INTEGER(4) to INTEGER(8)

Expected behaviour Should compile.

Additional context For big matrices, the ELSI developers realized that int4 wasn't big enough for certain data structures. https://gitlab.com/elsi_project/elsi_interface/-/commit/3d68359132c0ffb3a419f9730fcc9e09fdfcdbb6

So I think the issue is that the datastructures in src/dftbp/elecsolvers/elsicsc.F90 need to be updated to match. Probably it is us ELSI developers who should fix this, but I thought I'd file this bug report in the meantime.

william-dawson avatar May 17 '22 02:05 william-dawson

That's unfortunate, having a breaking API change in minor version bump will require some extra preprocessor logic to support the current range of ELSI version + the new one. Alternatively, we could just drop support for everything that is not ELSI 2.9.0

awvwgk avatar May 17 '22 06:05 awvwgk

Hmm, odd. I believed I have a general interface for the subroutines in ELSI. For example https://gitlab.com/elsi_project/elsi_interface/-/blob/master/src/elsi_rw.f90#L71

yaoyi92 avatar May 18 '22 12:05 yaoyi92

It seems some of my commits didn't go into the release. I must have messed up the release process. Can you try the master version @william-dawson ? I can create another release v2.9.1 if you confirm it works.

yaoyi92 avatar May 18 '22 12:05 yaoyi92

Thanks @yaoyi92 , yes the compilation does work with the master branch. I think releasing version 2.9.1 makes sense and would solve this issue.

william-dawson avatar May 18 '22 13:05 william-dawson

I just made the v2.9.1 release. https://gitlab.com/elsi_project/elsi_interface/-/releases

yaoyi92 avatar May 23 '22 14:05 yaoyi92

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Nov 19 '22 15:11 stale[bot]