dbcsr
dbcsr copied to clipboard
grid initialization in mp_env_obj. Unify dbcsr_mp_new and dbcsr_mp_grid_setup?
Currently dbcsr_mp_new
creates mp_env_obj
and does not initialize prow_group
and pcol_group
https://github.com/cp2k/dbcsr/blob/d97f28787a62e99c02aec38295bc8d88ea6a40e1/src/mpi/dbcsr_mp_methods.F#L80
This is done by the function dbcsr_mp_grid_setup
https://github.com/cp2k/dbcsr/blob/d97f28787a62e99c02aec38295bc8d88ea6a40e1/src/mpi/dbcsr_mp_methods.F#L127
It is not clear, that one needs to call both of these functions. I think one needs to put grid initialization in dbcsr_mp_new
.
It seems that the subgrids initialized by dbcsr_mp_grid_setup
are only used together with Arnoldi, so it makes sense that dbcsr_mp_grid_setup needs to be called in addition to dbcsr_mp_new if one needs this functionality.
Well, DBCSR uses subgrids during the multiplication too. Years ago the cartesian topology was not available in all MPI implementations, therefore DBCSR had a switch to use or not subcommunicators. Nowadays this is not needed anymore, we can have subcommunicators upfront...
I tried to move creation of the grid inside the creation of mp_env, but tests are crashing with MPI ABORT. Currently I reverted these changes and added manually creation and releasing of the grid in the mat x vec test. Now it is working without issues. https://github.com/dithillobothrium/dbcsr-1/commit/1b24a3c3ebdc105116b67997643f70d30871b180
So, the problem in this issue is more complicate.
this is my branch an commit where I refactor grid and init_lib https://github.com/dithillobothrium/dbcsr-1/commit/06d8d51da95d507f46bba81df40f0d4489f7b287
it is postponed because of the
https://github.com/cp2k/dbcsr/blob/22e274011d9b31bbfd851d6eee71a9d102ce0f98/src/ops/dbcsr_test_methods.F#L401