首页 > 解决方案 > mpirun 无法启动指定的应用程序,因为它无法使用 C 访问或执行可执行文件

问题描述

我使用 4 个节点使用 MPI 创建了一个集群程序。但是当我运行 MPI 程序时,即使我已获得对我创建的文件夹的完全访问权限,我也无法执行该程序。

我制作的用于计算从每个节点/客户端运行的处理器数量的程序

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

int main(int argc, char** argv){
    MPI_Init(NULL,NULL);

    int world_size;
    MPI_Comm_size(MPI_COMM_WORLD, &world_size);

    int world_rank;
    MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);

    char processor_name[MPI_MAX_PROCESSOR_NAME];
    int name_len;
    MPI_Get_processor_name(processor_name, &name_len);

    printf("hello world from processor %s, rank %d out of %d processors\n",processor_name,world_rank,world_size);

    MPI_Finalize();

    return 0;
}

但是当我使用命令运行程序时: mpirun -np 8 --hostfile /mnt/sharedfolder/hostfile /mnt/sharedfolder/hello_world.out

出现这样的消息

    mpirun was unable to launch the specified application as it could not access
or execute an executable:

Executable: /mnt/sharedfolder/hello_world.out
Node: node-02

while attempting to start process rank 0.
--------------------------------------------------------------------------
8 total processes failed to start

以前我已经在每个节点上完全访问了谷歌云平台上的防火墙。请帮助我,我还在学习

标签: cmpiopenmpi

解决方案


推荐阅读