How my program know thread level needed by PaMPA ?
As it is the PaMPA user responsability to initialize MPI, how I know the mpi thread level support needed ?
As far as I know, we need a MPI_THREAD_MULTIPLE support if we compile PaMPA with option PTHREAD All or Comm.
And this si checked in library_dmesh.c:l80.
But I would be convenient to have a function like :
int PAMPA_mpiThreadSupportNeeded() {
#ifdef PAMPA_PTHREAD
return MPI_THREAD_MULTIPLE;
#endif /* PAMPA_PTHREAD */
return MPI_THREAD_SINGLE;
}
// Or
void PAMPA_mpiThreadSupportNeeded(int* mpi_thread_spport) {
#ifdef PAMPA_PTHREAD
*mpi_thread_spport = MPI_THREAD_MULTIPLE;
#elif /* PAMPA_PTHREAD */
*mpi_thread_spport = MPI_THREAD_SINGLE;
#endif /* PAMPA_PTHREAD */
}
Note that I don't know the real mpi thread support needed by default.