dbcsr icon indicating copy to clipboard operation
dbcsr copied to clipboard

grid initialization in mp_env_obj. Unify dbcsr_mp_new and dbcsr_mp_grid_setup?

Open dithillobothrium opened this issue 5 years ago • 5 comments

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.

dithillobothrium avatar Dec 06 '18 17:12 dithillobothrium

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.

pseewald avatar Dec 07 '18 09:12 pseewald

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...

alazzaro avatar Dec 07 '18 09:12 alazzaro

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.

dithillobothrium avatar Dec 14 '18 16:12 dithillobothrium

this is my branch an commit where I refactor grid and init_lib https://github.com/dithillobothrium/dbcsr-1/commit/06d8d51da95d507f46bba81df40f0d4489f7b287

dithillobothrium avatar Apr 17 '19 12:04 dithillobothrium

it is postponed because of the
https://github.com/cp2k/dbcsr/blob/22e274011d9b31bbfd851d6eee71a9d102ce0f98/src/ops/dbcsr_test_methods.F#L401

dithillobothrium avatar Apr 26 '19 12:04 dithillobothrium