cp2k / dbcsr

DBCSR: Distributed Block Compressed Sparse Row matrix library
https://cp2k.github.io/dbcsr/
GNU General Public License v2.0
135 stars 46 forks source link

`TEST_MPI_RANKS=auto` does not account for ctest parallelization #706

Closed LecrisUT closed 8 months ago

LecrisUT commented 11 months ago

For example, if you have ctest -j 2, there will be 2 tests running in parallel. But the auto calculation gets the maximum number of processors through ProcessorCount and defines it statically to be used in mpiexec. This leads to the cores being oversubscribed and potentially switching between the tests.

https://github.com/cp2k/dbcsr/blob/579110dc00580dcdc06d3beef31bccd0378cf1dc/tests/CMakeLists.txt#L3-L7

On the cmake side, I am not sure if there is clear way to define this. The documentation is a bit vague on how to design this. Maybe there is some internal handling when using the PROCESSORS property. This should be investigated with the cmake team (discussion).

alazzaro commented 8 months ago

For your case I would suggest to set the number of ranks via -DTEST_MPI_RANKS. As you said there is not a clean solution for this problem, but please let us know if you can find something. Note that tests are really meant to check correctness and not performance.