【问题标题】:Error while compiling hello world program in mpi in C on openSUSE在 openSUSE 上用 C 语言在 mpi 中编译 hello world 程序时出错
【发布时间】:2014-02-24 06:57:47
【问题描述】:

程序:

#include <stdio.h>
#include <mpi.h>


int main (argc, argv)
int argc;
char *argv[];
{
    int rank, size;

    MPI_Init (&argc, &argv);    /* starts MPI */
    MPI_Comm_rank (MPI_COMM_WORLD, &rank);  /* get current process id */
    MPI_Comm_size (MPI_COMM_WORLD, &size);  /* get number of processes */
    printf( "Hello world from process %d of %d\n", rank, size );
    MPI_Finalize();
    return 0;
}

错误:

/usr/lib/gcc/i586-suse-linux/4.4/../../../../i586-suse-linux/bin/ld: cannot find -lopen-rte
collect2: ld returned 1 exit status

编译命令:mpicc hello.c -o ./hello。 我正在尝试构建一个 openSUSE 节点集群。 所以我正在测试 mpich2 程序是否在每个节点上运行。

【问题讨论】:

标签: c mpi opensuse mpich


【解决方案1】:

libopen-rte.so 指的是 OpenMPI,而不是 MPICH2。使用 mpi-selector 工具检查默认 MPI 实现。我个人更喜欢 OpenMPI。

【讨论】:

    【解决方案2】:

    您似乎同时安装了两个 MPI 库。虽然这是可能的,但如果您不是很小心,配置和使用通常会很痛苦。我建议卸载 Open MPI 或 MPICH。那应该可以解决您的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-19
      • 2012-10-24
      • 2018-04-26
      • 1970-01-01
      • 2016-04-24
      • 2011-01-11
      • 1970-01-01
      • 2021-12-07
      相关资源
      最近更新 更多