检查我的MVAPICH是否启用了多线程

时间:2017-03-09 14:00:25

标签: mpi mvapich2

我想知道是否有任何命令可以显示MVAPICH安装的启用功能,类似于我们可以为OpenMPI找到的功能:

  

ompi_info

特别是,我很想知道是否启用了多线程支持。

1 个答案:

答案 0 :(得分:1)

我建议只运行这样一个简单的测试程序:

#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);
}

在我的Ubuntu笔记本电脑上使用标准的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

与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)

但如果我请求MPI_THREAD_SERIALIZED

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

希望这很有用。

大卫