简体   繁体   English

mpirun不起作用并要求将TMPDIR变量更改为/ tmp

[英]mpirun doesnt work and ask to change TMPDIR variable to /tmp

I compiled the next code: 我编译了下一个代码:

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


int main(int argc, char* argv[]) {
    int rank, size, len;
    char host[MPI_MAX_PROCESSOR_NAME];
    MPI_Init(&argc, &argv);
    MPI_Finalize();
    return 0;
}

I did it this way: 我是这样做的:

mpic++ -o test test.cpp

and then i tried to run the file: 然后我试图运行该文件:

mpirun -np 2 test

but the error occured: 但是发生了错误:

PMIx has detected a temporary directory name that results in a path that is too long for the Unix domain socket: PMIx检测到一个临时目录名,导致Unix域套接字的路径太长:

Temp dir: /var/folders/12/k2b2579s1yz2cfl8ppb1c6m80000gn/T/openmpi-sessions-501@MacBook-Air-Alexander-2_0/22793 临时目录:/ var / folders / 12 / k2b2579s1yz2cfl8ppb1c6m80000gn / T / openmpi-sessions-501 @ MacBook-Air-Alexander-2_0 / 22793

Try setting your TMPDIR environmental variable to point to something shorter in length 尝试将TMPDIR环境变量设置为指向较短的长度

So I did this: 所以我这样做了:

export TMPDIR=/tmp

Tried to run again: mpirun -np 2 test 试图再次运行: mpirun -np 2 test

But another error occured: 但发生了另一个错误:

Primary job terminated normally, but 1 process returned 主要作业正常终止,但返回了1个进程

a non-zero exit code Per user-direction, the job has been aborted 非零退出代码按用户指示,作业已中止

------------------------------------------------------- -------------------------------------------------- -----

mpirun detected that one or more processes exited with non-zero status, thus causing the job to be terminated. mpirun检测到一个或多个进程退出非零状态,从而导致作业终止。 The first process to do so was: 这样做的第一个过程是:

Process name: [[22798,1],0] 流程名称:[[22798,1],0]

Exit code: 1 退出代码:1

Tell me please, what should I do to run this code? 请告诉我,我该怎么做才能运行这段代码?

the initial error was already reported and this is considered as a feature. 已经报告了初始错误,这被视为一项功能。 using a shorted TMPDIR as you did is correct. 使用短路的TMPDIR是正确的。

you might want to try adding orte_tmpdir_base = /tmp in your openmpi-mca-params.conf and see whether it fixes your problem (so you will not have to set TMPDIR in every terminal) 您可能想尝试在openmpi-mca-params.conf添加orte_tmpdir_base = /tmp ,看看它是否修复了您的问题(因此您不必在每个终端中设置TMPDIR

about the second issue, you are very likely running /usr/bin/test instead of your test program, so you can simply mpirun -np 2 ./test or rename your test program into something that is not in your PATH 关于第二个问题,你很可能运行/usr/bin/test而不是你的测试程序,所以你可以简单地mpirun -np 2 ./test或将你的测试程序重命名为不在你的PATH

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM