2

I wonder if there is any command to show the enabled features of an MVAPICH installation similar to the one that we can find for OpenMPI:

ompi_info

Especially, I am interested in knowing if multi-thread support is enabled.

Bub Espinja
  • 4,029
  • 2
  • 29
  • 46

1 Answers1

3

I would recommend just running a simple test program like this:

#include <stdio.h>
#include <stdlib.h>

#include <mpi.h>

int main(void)
{
  int lvlrequired, lvlprovided;

  lvlrequired = MPI_THREAD_MULTIPLE;

  MPI_Init_thread(NULL, NULL, lvlrequired, &lvlprovided);

  if (lvlprovided < lvlrequired)
    {
      printf("Required level of threading support *not* available\n");
    }
  else
    {
      printf("Required level of threading support *is* available\n");
    }

  MPI_Finalize();

  return(0);
}

On my Ubuntu laptop with standard OpenMPI:

me@laptop$ mpicc -o threadcheck threadcheck.c
me@laptop$ mpiexec -n 2 ./threadcheck
Required level of threading support *not* available
Required level of threading support *not* available

which agrees with ompi_info:

me@laptop$ ompi_info | grep THREAD_MULTIPLE
          Thread support: posix (MPI_THREAD_MULTIPLE: no, OPAL support: yes, OMPI progress: no, ORTE progress: yes, Event lib: yes)

but if I request MPI_THREAD_SERIALIZED

me@laptop$ mpiexec -n 2 ./threadcheck
Required level of threading support *is* available
Required level of threading support *is* available

Hope this is useful.

David

David Henty
  • 1,694
  • 9
  • 11
  • That works! However, for MVAPICH, though by default multi-threading is enabled, in order to use it,we need to have set in the environment the variable: MV2_ENABLE_AFFINITY, OMP_NUM_THREADS – Bub Espinja Mar 10 '17 at 21:59