marekandreas / elpa

A scalable eigensolver for dense, symmetric (hermitian) matrices (fork of https://gitlab.mpcdf.mpg.de/elpa/elpa.git)
Other
25 stars 11 forks source link

Check for MPI threading support incorrect #16

Closed jussienko closed 2 years ago

jussienko commented 2 years ago

In file elpa_impl.F90 the check for MPI thread level support looks at the moment

      if ((providedMPI .ne. MPI_THREAD_SERIALIZED) .and. (providedMPI .ne. MPI_THREAD_MULTIPLE)) then
#if defined(ALLOW_THREAD_LIMITING)
        write(error_unit,*) "WARNING elpa_setup: MPI threading level MPI_THREAD_SERALIZED or MPI_THREAD_MULTIPLE required but &
...

I think the check should be

if ((providedMPI .ne. MPI_THREAD_SERIALIZED) .or. (providedMPI .ne. MPI_THREAD_MULTIPLE)) then

or, as the levels are ordered

if (providedMPI .lt. MPI_THREAD_SERIALIZED) then
marekandreas commented 2 years ago

Hello,

I do agree with the ".lt." option, assuming that the MPI standard describes an order of the levels in the correct way (I will have to check this :-) )

I do not agree with the ".or." option: Another way to write the correct expression is if ( .not.(providedMPI .eq. MPI_THREAD_SERIALIZED) .or. (providedMPI .eq. MPI_THREAD_MULTIPLE) ) which is equivalent to if ((providedMPI .ne. MPI_THREAD_SERIALIZED) .and. (providedMPI .ne. MPI_THREAD_MULTIPLE))

jussienko commented 2 years ago

Hi, I was apparently too hasty, sorry for that. You are absolutely right that .and. is the correct operator, .or. is indeed a bug which was apparently present in 2021.005.001 but has been fixed since then.