Mpi 检查我的MVAPICH是否启用了多线程
我想知道是否有任何命令显示MVAPICH安装的已启用功能,类似于我们可以找到的OpenMPI: ompi_信息Mpi 检查我的MVAPICH是否启用了多线程,mpi,mvapich2,Mpi,Mvapich2,我想知道是否有任何命令显示MVAPICH安装的已启用功能,类似于我们可以找到的OpenMPI: ompi_信息 特别是,我想知道是否启用了多线程支持。我建议只运行以下简单的测试程序: #include <stdio.h> #include <stdlib.h> #include <mpi.h> int main(void) { int lvlrequired, lvlprovided; lvlrequired = MPI_THREAD_MULTI
特别是,我想知道是否启用了多线程支持。我建议只运行以下简单的测试程序:
#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);
}
与ompi_信息一致:
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\u线程\u序列化
me@laptop$ mpiexec -n 2 ./threadcheck
Required level of threading support *is* available
Required level of threading support *is* available
希望这是有用的
大卫真管用!然而,对于MVAPICH,虽然默认情况下启用了多线程,但为了使用它,我们需要在环境中设置变量:MV2_ENABLE_AFFINITY,OMP_NUM_THREADS
me@laptop$ mpiexec -n 2 ./threadcheck
Required level of threading support *is* available
Required level of threading support *is* available