MPI无法创建并行进程,在MPI_INIT失败

我正在学习C的MPI接口,并且刚刚为我的系统安装了MPI(Mac Os Mojave 10.14.6)。我在这个tutorial的帮助下做到了。 一切都很好,现在我想开始我的第一个简单代码。 我试图了解该错误并寻找解决方案,但我自己找不到它。使用CLion作为IDE。 main.c

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

int main(argc,argv)
        int argc;

        char **argv;
{
    int rank,size;
    MPI_Init( &argc,&argv );
    MPI_Comm_size(MPI_COMM_WORLD,&size);
    MPI_Comm_rank(MPI_COMM_WORLD,&size);
    printf("Hi from process %d of $d\n",rank,size);
    MPI_Finalize();
    return 0;
}

CMakeList.txt

cmake_minimum_required(VERSION 3.15)
project(uebung02 C)

set(CMAKE_C_STANDARD 99)

add_executable(uebung02 main.c)
set(CMAKE_C_COMPILER /opt/openmpi/bin/mpicc)
set(CMAKE_CXX_COMPILER /opt/openmpi/bin/mpic++)

错误输出

/Users/admin/Documents/HU/VSuA/uebung02/cmake-build-debug/uebung02
--------------------------------------------------------------------------
PMIx has detected a temporary directory name that results
It looks like orte_init failed for some reason; your parallel process is
in a path that is too long for the Unix domain socket:
likely to abort.  There are many reasons that a parallel process can
fail during orte_init; some of which are due to configuration or
environment problems.  This failure appears to be an internal failure;

here's some additional information (which may only be relevant to an
Open MPI developer):
    Temp dir: /var/folders/9j/54dxfbf1451dk82nn7y99d8r0000gn/T/openmpi-sessions-501@admins-MacBook-Pro_0/15653


  orte_ess_init failed
Try setting your TMPDIR environmental variable to point to
something shorter in length
[admins-MacBook-Pro.local:44625] [[INVALID],INVALID] ORTE_ERROR_LOG: Unable to start a daemon on the local node in file ess_singleton_module.c at line 582
[admins-MacBook-Pro.local:44625] [[INVALID],INVALID] ORTE_ERROR_LOG: Unable to start a daemon on the local node in file ess_singleton_module.c at line 166
  --> Returned value Unable to start a daemon on the local node (-127) instead of ORTE_SUCCESS
--------------------------------------------------------------------------
--------------------------------------------------------------------------
It looks like MPI_INIT failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during MPI_INIT; some of which are due to configuration or environment
problems.  This failure appears to be an internal failure; here's some
[admins-MacBook-Pro.local:44625] *** An error occurred in MPI_Init
addition[admins-MacBook-Pro.local:44625] *** on a NULL communicator
[admins-MacBook-Pro.local:44625] *** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,[admins-MacBook-Pro.local:44625] ***    and potentially your MPI job)
al information (which may only be relevant to an Open MPI
developer):

[admins-MacBook-Pro.local:44625] Local abort before MPI_INIT completed completed successfully,but am not able to aggregate error messages,and not able to guarantee that all other processes were killed!
  ompi_mpi_init: ompi_rte_init failed
  --> Returned "Unable to start a daemon on the local node" (-127) instead of "Success" (0)
--------------------------------------------------------------------------

Process finished with exit code 1

whj901180 回答:MPI无法创建并行进程,在MPI_INIT失败

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3169588.html

大家都在问