tomaskubar / gromacs-dftbplus

Public/backup repository of the GROMACS molecular simulation toolkit. Please do not mine the metadata blindly; we use Gerrit for code review and Redmine for issue tracking.
http://www.gromacs.org
Other
5 stars 2 forks source link

running 1 thread gromacs with few threads dftbplus api #6

Closed Golovin-Andrey closed 4 years ago

Golovin-Andrey commented 5 years ago

Dear @tomaskubar To start dftbplus with more than 1 thread one need use flag -DGMX_OPENMP=OFF, but gomp lib needed for libdftb+ , so again we need to modify ./src/programs/CMakeLists.txt like that:

find_library(GOMP         
    NAMES libgomp.so libgomp.so.1
    PATH /usr/ 
    add_library(gomp SHARED IMPORTED)
    set_target_properties(gomp PROPERTIES IMPORTED_LOCATION ${GOMP} )
    target_link_libraries(gmx libdftbplus libxmlf90 libdftd3 gfortran gomp )

gmx still checking for ntomp and OMP_NUM_THREADS fatal error if they are not equal. OK, comment lines 180-183 in src/gromacs/mdlib/gmx_omp_nthreads.cpp and line 728 in ./src/gromacs/taskassignment/resourcedivision.cpp . Last one is to make sure that gromacs use one thread.

tomaskubar commented 4 years ago

Dear @Golovin-Andrey This looks is a good idea, so thanks for these comments, also. I will need to enable OpenMP for MM at some point, too, to accelerate further.